[Tutorial] How to Decrypt, Extract & Rebuild 3DS|CIA|CXI Files

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by Asia81, Mar 4, 2015.

?

How is my english?

  1. So bad...

    37 vote(s)
    6.9%
  2. Good, sometimes it's not understandable

    83 vote(s)
    15.5%
  3. Very understandable

    330 vote(s)
    61.8%
  4. Perfect?

    84 vote(s)
    15.7%
  1. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    [​IMG]

    This tutorial will try to help you extract a 3DS|CIA|CXI file to change its content, and will also explain how to rebuild your game once edited.

    Thanks a lot to Ericzander & BullyWiiPlaza for their help to translate this tutorial in english :)
    (Because I'm French, it’s difficult to make a full tutorial in a good english...).
    If anyone see any typo or something wrong with my english (in the setup, the script, the tutorial...) let me know!

    Ce tutoriel est également disponible ici pour les français (Pas à Jours) :
    This tutorial is also available here for french users (Outdated):
    http://www.pokemontrash.com/jeux-pokemon/decrypter-compiler-rom-3ds.php

    SUMMARY

    - What you need
    - Prerequisites
    - Decrypting
    - Extracting
    - Editing
    - Rebuilding​

    What you Need
    • A 3DS|CIA|CXI File (It can either be a game, game's update, system application, but anyways not a DLC file nor a DSi Ware!)
    • WinRAR, or another archive extractor
    • HackingToolkit9DS -> Click Here
    Prerequisites

    Install the new SetupUS|FR.exe of HackingToolkit9DS as a common tool:



    Extracting

    Open HackingToolkit9DS:
    [​IMG]

    Don't forget, your file(s) should not have any spaces in its(their) name(s), nor special characters, like é or à.
    You want extract PokemonMoon.3ds ? Just write PokemonMoon.


    If you plan to extract a 3DS file:
    Write the "D" command, and enter the name of your .3DS file WITHOUT its extension.

    If you plan to extract a CIA file:
    Write the "CE" command, and enter the name of your .CIA file WITHOUT its extension.

    If you plan to extract a CXI file:
    Write the "CXI" command, and enter the name of your .CXI file WITHOUT its extension.

    You are asked if you want decompress your code.bin file, choose (n/y).
    Wait while it's extracting.

    The ExeFS content will be extracted in an ExtractedExeFS folder.
    The RomFS content will be extracted in an ExtractedRomFS folder.
    The DownloadPlay content will be extracted in an ExtractedDownloadPlay folder.
    The Old3DS update will be extracted in an ExtractedO3DSUpdate folder.
    The New3DS update will be extracted in an ExtractedN3DSUpdate folder.
    The Manual will be extracted in an ExtractedManual folder.
    The 3D Banner will be extracted in an ExtractedBanner folder.

    The work here should be ok.
    Now you’re able to edit the game, go to Editing.

    Editing

    Do what you want.
    Edit music, textures, banner, icon..
    If you follow this tutorial, you know what you want to do.
    Once it's finished, rebuild your game.


    Rebuilding

    If you extracted and plan to rebuild a 3DS file:
    Open HackingToolkit9DS, write the "R" command, then enter the name you want for the output file.
    [​IMG]

    Once done, don't forget to encrypt it using Decrypt9.
    Open Decrypt9 using the method of your choice, choose Content Decryptor Options, then NCCH/NCSD File Options and finally NCCH/NCSD Encryptor.

    Enjoy!

    If you extracted and plan to rebuild a CIA file:
    Open HackingToolkit9DS, write the "CR" command, then enter the name you want for the output file.
    [​IMG]

    Once done, and only if you have dealed with a system application (HomeMenu, SystemSettings, etc...) you need to encrypt the CIA back before install it.
    Start Decrypt9, choose Content Decryptor Options, then CIA File Options and finally CIA Encryptor (NCCH).

    Enjoy!

    Troubleshooting

    Before report an issue, be sure:
    - Your 3DS/CIA/CXI file doesn't have any space or special caracter in its name (such as é or à).
    - Your 3DS/CIA/CXI file is in the same folder as HackingToolkit9DS.
    - You're not trying to extract the file in the ProgramFiles folder (where installed core files are).
    - To write or don't write the extension of your file when specified.
    - To have installed the setup package for your langage (SetupXX.exe file).

    Changelogs

    [​IMG]

    Version 10
    - Added: Support for Boot9 extraction on PC. Absolutely no more decryption is required on 3DS.
    - Renamed: Project is renamed HackingToolkit9DS for the occasion.
    - Edited: Some strings, words and sentences has been changed.
    - Removed: Temporarily removed the 32 bits support.
    - Removed: Integrated 3DS Builder.
    - Removed: Integrated Pokemon Patch Pointer Tool.
    - Removed: Integrated RomFS Extractor.
    - Removed: Integrated RomFS Builder.

    Version 9
    - Fixed CIA rebuild script.

    Version 8
    - Fixed MassExtraction and MassRebuild scripts.

    Version 7
    - 32bits support should be fixed (I forgot to include a 32bits build of MakeRom).


    Credits and Thanks

    Credits:
    CtrTool : profi200 | 3DSGuy| Neimod
    Makerom : profi200 | 3DSGuy
    Decrypt9 : d0k3, Shadowtrance & Archshift
    HackingToolkit9DS : Asia81
    CleanTool9 : Asia81

    Thanks to:
    Megadrifter
    Stratovarius
    Reisyukaku
    Guitoh
    Weby
    Apache Thunder
    Ericzander
    BullyWiiPlaza
    Cellenseres​

    THE LAST WORD

    AS ALWAYS #TEAMONODERA AND #TEAMREM UNTIL THE DEATH

    [​IMG] [​IMG]
     
    Last edited by Asia81, Sep 1, 2017
    rivenliu, DaMan, DarthDub and 67 others like this.
  2. Apache Thunder

    Apache Thunder I have cameras in your head!

    Member
    4,123
    4,074
    Oct 7, 2007
    United States
    Levelland, Texas
    You can also perhaps provide an alternative method (which would be a lot shorter to explain then the old xorpad method) by using rxTools to decrypt the rom instead, then extract everything with CTRTool/3DSExplorer. The resulting files will already be decrypted and if ran on 7.x or newer sysnand, the key slot bin file won't be needed. :D
     
  3. g.a.u

    g.a.u Member

    Newcomer
    43
    2
    Oct 11, 2014
    Ho Chi Minh City, Vietnam
    --sorry for my bad english--
    i did all of these step ,when i rebuild Kingdom hearts 3d (with rsf editted) ,it created a 3ds rom has smaller size than it was (2,1gb -> 1.8gb)
    Load the rom on 3ds and nothing happen (the icon is blank)
    Tried to use this tool
    https://gbatemp.net/threads/tool-makerom-gui.376540/
    and this is error it give me
    [​IMG]
     
  4. Eli'

    Eli' Member

    Newcomer
    10
    0
    Feb 17, 2015
    France
    I have done all correctly your tutorial here without update but it does not work!
    The game freeze in the 3ds logo when you start to play. I edit nothing in the game (Extractedromfs's folder) only because I wanted to test before if it work or not but It does'nt work!
    I can even put a full video of your tutorial to show you that it don't work. (perhaps I made something wrong but I don't think because If I update the game it work so...) I don't want the update.
     
  5. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    Proof it's working :

    Just read the tutorial.



    I'm sorry, but i don't really know how to do this with other game such as Pokemon.
    Give me your RSF, i will try it.
    It's Kingdom Hearts 3D EUR ?
     
    Margen67 likes this.
  6. g.a.u

    g.a.u Member

    Newcomer
    43
    2
    Oct 11, 2014
    Ho Chi Minh City, Vietnam
    its KH3D US
    this is my RFS
     

    Attached Files:

    • RSF.rar
      File size:
      2.1 KB
      Views:
      544
  7. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    I haven't US version, i will download it later
     
  8. Leftshark

    Leftshark Member

    Newcomer
    11
    1
    Feb 25, 2015
    United States
    i did this but every time it loads pass 3s logo it stays on a black screen can anyone help?
     
    Eli' likes this.
  9. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    What's your game ?

    I will try to make a video tutorial if he can help someone
     
  10. Leftshark

    Leftshark Member

    Newcomer
    11
    1
    Feb 25, 2015
    United States
    pokemon AS. I tried changing the .mm files from the sprites around but it wont load the game :/
     
  11. Eli'

    Eli' Member

    Newcomer
    10
    0
    Feb 17, 2015
    France
    Just read the tutorial?

    Here a video to show you it don't work for me and i don't know for other (Video edited because I forget to not show the 3ds key):


    What is wrong? I don't understand!
     
  12. Fishaman P

    Fishaman P Speedrunner

    Member
    3,244
    510
    Jan 2, 2010
    United States
    Wisconsin
    I'm pretty sure it's against the rules to link the (copyrighted) 3DS keys.
     
  13. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    WtF ?
     
  14. Fishaman P

    Fishaman P Speedrunner

    Member
    3,244
    510
    Jan 2, 2010
    United States
    Wisconsin
    Did you not understand this was a rule, or what's the deal?
     
  15. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    I know, but where i give a 3DS key oO ?
    My slot0x25KeyX.bin in the pack is not blank ?
     
  16. Fishaman P

    Fishaman P Speedrunner

    Member
    3,244
    510
    Jan 2, 2010
    United States
    Wisconsin
    That's not the issue.


    The page you linked to directly features a link to the copyrighted key. The fact it's not directly included doesn't matter.
     
  17. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    fail, removed.
     
  18. Fishaman P

    Fishaman P Speedrunner

    Member
    3,244
    510
    Jan 2, 2010
    United States
    Wisconsin
    Also, a little more subjective, but your "preview" of the key shows more than half of it.
    Showing a single random byte in the middle is fine, but showing the first 2 bytes, the last byte, and quite a few in between would be enough for me to delete it were I a mod.
     
  19. Asia81
    OP

    Asia81 In my Ecchi World <3

    Member
    5,149
    2,567
    Nov 15, 2014
    France
    Albi
    and now ?
     
  20. Fishaman P

    Fishaman P Speedrunner

    Member
    3,244
    510
    Jan 2, 2010
    United States
    Wisconsin
    :yay: