Tutorial  Updated

Installing mods/hacks for Citra 3DS emulator

What you will need:

- 64-bit OS
- A decrypted .3ds file of the game you want to mod
- The mod you want to install
- 3DS to CIA by Katsu (python 2.7 required)
- 3dstool
- Citra 3DS Emulator (you won't need it to do the hacking, only to run the game afterwards)

How to install the mod:

0. Before you start, if you don't already have it, download Python 2.7 with the link provided and install it; also, if you use Windows you must add Python to the PATH Environmental Variable. (To check whether you need to do this last bit, type python in the command prompt and hit Enter: if you get the message ‘python’ is not recognized as an internal or external command, you need to add Python to PATH.)

<!> Since many people are asking me about Fire Emblem Fates, namely adding the Same-sex Marriage patch by @UnassumingVenusaur, I'll use it as an example.

1. Rename your .3ds to <filename_modified.3ds>. Extract the archives of both 3DS to CIA and 3dstool

step1.png


2. Drag and drop your .3ds on Make2.07.bat in the 3DS to CIA folder you've previously extracted.

step2.png


Wait until you get this window:

step3.png


4. Leaving this command prompt (3ds_to_cia_2.07) open so you can later rebuild the game, go to the folder where the files have been extracted (don't move or delete the .3ds file which has been moved there) and copy the romfs file to the 3dstool directory which you've previously extracted.

step4.png


5. To extract the romfs file, use the following command:

3dstool -xvtf romfs romfs.bin --romfs-dir romfs

If you're not familiar with using the command prompt, here is a quick walkthrough:

+++++++

To open the command prompt, go to Start and type "cmd" and open the program that comes up.

step5.png


You'll get a black window. Type this in (including the first space): cd "path to the 3dstool folder on your computer goes here"
Hit Enter, and you should get a string with the path to the 3dstool folder.
For instance, on my pc, I type:

C:\Users\Username> cd "C:\Giochi\Nintendo3DS\3ds hacking tools\3dstool"

And I get:

C:\Giochi\Nintendo3DS\3ds hacking tools\3dstool>

To extract the romfs file, use the command:

3dstool -xvtf romfs romfs.bin --romfs-dir romfs

Following the example above, it'll look like this:

step6.png


To use the command, after you've copy-pasted 3dstool -xvtf romfs romfs.bin --romfs-dir romfs, hit Enter.
Wait until 3dstool is done extracting the romfs.bin file. You'll know when it stops and the same string with the path to the 3dstool folder appears.

step7.png


+++++++

6. Keeping the console open so you can later rebuild the romfs file, delete the file you've extracted and go to the folder which contains the extracted files.

step8.png


7. Depending on the mod, you'll now have to follow the instructions provided by the modder themselves, but generally you'll have to copy and paste the files provided by the modder (usually replacing the original ones). Modders often provide different folders for HANS, Luma and NTR CFW but the files inside are the same. Just use the HANS ones if you don't know which ones to choose, and remember to use the ones for your region (USA/EUR/JP)!

In the case of FEF, copy the contents of the HANS version>Your region folder, and paste them in the romfs folder:

step9.png


step10.png


8. Having applied the mod/hack, go back to the command prompt and use the following command to rebuild the romfs file:

3dstool -cvtf romfs romfs.bin --romfs-dir romfs

step11.png


9. Replace the modified romfs file with the one in the extracted folder.

step12.png
step13.png


10. Go back to the 3ds_to_cia_2.07 window from step 3, press 6 (Rebuild 3DS) and then s to start

step14.png


Wait until the rebuilding is done. (The process is pretty long and heavy, you likely won't be able to do anything else in the meantime.)

step15.png


step16.png


step17.png


You should get two folders with your original file and the modded one respectively. Done!

step18.png


POSSIBLE ERRORS

An issue people who use Windows 10 have run into is the batch file (3ds to cia; step 2) not running at all (opening and closing right after). This may be caused by encoding.
If you've got notepad++ (or if you don't, you can find it among the 3ds to cia "tools": 3ds_to_cia_v2.07\tools\n++), you can open the batch file for editing with it and check "Encoding". If anything else besides UTF-8 (or ANSI) is selected, you should select UTF-8 (without BOM) and save the file.

Most errors occur when rebuilding the .3ds file (step 10), and they're mostly related to the rsfgen.py script and Python by extension.

error.png

If you get this error up here, it means you have Python 3.5 installed, and it's being used to run the script instead of Python 2.7

Other instances:
- You don't have Python installed
- Python is installed in a partition where the system can't find it: install python in the same partition where your OS is!
- [Windows] Python's directory hasn't been added to the PATH e.v. (see Step 0)
- Python is not selected as the program to open .py files. If this happens, Pythonw.exe might have been selected to open .py files, while it should be Python.exe. In this case a white window with the script will appear, and once you close it, you'll get the fateful ERROR. You'll have to change the default program to open .py files to the correct one.

error pythonw.png

(If you see this the default program used to open .py files is pythonw.exe, you need to change it to python.exe)

In case you experience any other issues, tell me and I'll help you out!

-------

If you have any questions, feel free to ask!

Credits go to the creators of Citra, 3DS to CIA and 3dstool. Thank you!
 
Last edited by FriendlyHacker,

Xilthz

Member
Newcomer
Joined
Aug 7, 2019
Messages
10
Trophies
0
Age
26
XP
46
Country
United States
Wow, I'm sorry you're experiencing so many problems... :(
You know, I think you should try .Net 3ds Toolkit, instead. It's easier, it could work just fine and you won't have to be stressed by all these errors. You can download the latest version here, it has a GUI and it's pretty straightforward to use.

Yeah, I have no choice to try other methods.
But, I have 2 version of citra. Latest and... 890 iirc.
Somehow 890 thinks that the rebuilt .3ds is encrypted. But doesn't crash like the latest citra. Latest citra just stopped responding. Older citra just thinks it's still encrypted. For some reason...

Now I don't have 3ds console itself, and trying to decrypt that won't be easy w/ offline decryptor. Cuz the log of the decryptor says,
NCSD Warning! Failed to sign header
Not sure what's that suppose to mean, rn I'm trying to not mod the 3ds out. So just extract, then repack it.

Update:
Okay, extract and repack it doesn't seem to work. So I guess this method doesn't work for me. Was hoping the music was causing this but... no. Welp... Guess gonna try other method if there's no solution what so ever, guess I'll pass.
I was gonna ask for help to do it for me, but then again, don't think peeps gonna do it just for 7 music files to be changed in the game
and I was hoping someone will help me, but peeps tend to ask for money for the service so, I'm gonna try to find other method
>.>
 
Last edited by Xilthz,

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
Yeah, I have no choice to try other methods.
But, I have 2 version of citra. Latest and... 890 iirc.
Somehow 890 thinks that the rebuilt .3ds is encrypted. But doesn't crash like the latest citra. Latest citra just stopped responding. Older citra just thinks it's still encrypted. For some reason...

Now I don't have 3ds console itself, and trying to decrypt that won't be easy w/ offline decryptor. Cuz the log of the decryptor says,
NCSD Warning! Failed to sign header
Not sure what's that suppose to mean, rn I'm trying to not mod the 3ds out. So just extract, then repack it.

Update:
Okay, extract and repack it doesn't seem to work. So I guess this method doesn't work for me. Was hoping the music was causing this but... no. Welp... Guess gonna try other method if there's no solution what so ever, guess I'll pass.
I was gonna ask for help to do it for me, but then again, don't think peeps gonna do it just for 7 music files to be changed in the game
and I was hoping someone will help me, but peeps tend to ask for money for the service so, I'm gonna try to find other method
>.>

Hmm, maybe it's a problem of bad decryption in the first place? Can you get a different .3ds file to mod?
 

Xilthz

Member
Newcomer
Joined
Aug 7, 2019
Messages
10
Trophies
0
Age
26
XP
46
Country
United States
Hmm, maybe it's a problem of bad decryption in the first place? Can you get a different .3ds file to mod?
Idk how and why, different 3ds gives different .rsf file but its still in the same game.
I'll let you check it. Because this one gives me a .rsf error and Idk how to fix it.

Update: Okay... just realize that this .3ds doesn't have banner.bin extracted. But I did test if it is running at citra too and it does.
For .rsf still not sure, the error changed into .rsf to banner.bin so I have to test it rn. But since I have other .3ds in the same game, I have to extract that one for the banner.bin


Nvm, doesn't work either. Citra just gave massive unmapped errors. Another dead end I guess
 

Attachments

  • PokemonUM_modified.txt
    6.3 KB · Views: 160
Last edited by Xilthz,

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
Idk how and why, different 3ds gives different .rsf file but its still in the same game.
I'll let you check it. Because this one gives me a .rsf error and Idk how to fix it.

Update: Okay... just realize that this .3ds doesn't have banner.bin extracted. But I did test if it is running at citra too and it does.
For .rsf still not sure, the error changed into .rsf to banner.bin so I have to test it rn. But since I have other .3ds in the same game, I have to extract that one for the banner.bin


Nvm, doesn't work either. Citra just gave massive unmapped errors. Another dead end I guess

Now I'm sure it's because of the decryption. This other rsf is worse compared to the first one, too. If you can, try yet another .3ds file.
 

Xilthz

Member
Newcomer
Joined
Aug 7, 2019
Messages
10
Trophies
0
Age
26
XP
46
Country
United States
Now I'm sure it's because of the decryption. This other rsf is worse compared to the first one, too. If you can, try yet another .3ds file.
I got the other 3ds version, this one doesn't have .rsf errors or anything. But Citra still crashed even w/o file modifying. Is there a step I missed?
1. Renamed .3ds as name_modified.3ds
2. Wait for extraction of .3ds
3. 6, 8 and s when it asks for number and want to start
4. Checked the .rsf file
5. Wait for rebuild process w/ original exheader.
6. .3ds finished and got trimmed 4gig to 3.6gig. That's... normal ?
 
Last edited by Xilthz,

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
I got the other 3ds version, this one doesn't have .rsf errors or anything. But Citra still crashed even w/o file modifying. Is there a step I missed?
1. Renamed .3ds as name_modified.3ds
2. Wait for extraction of .3ds
3. 6, 8 and s when it asks for number and want to start
4. Checked the .rsf file
5. Wait for rebuild process w/ original exheader.
6. .3ds finished and got trimmed 4gig to 3.6gig. That's... normal ?

It seem you're doing everything right. The size being reduced happens every time, but the games run just fine for me.
Which version of Citra are you using? In my case, I use the last Nightly build.
 

Xilthz

Member
Newcomer
Joined
Aug 7, 2019
Messages
10
Trophies
0
Age
26
XP
46
Country
United States
It seem you're doing everything right. The size being reduced happens every time, but the games run just fine for me.
Which version of Citra are you using? In my case, I use the last Nightly build.
Same. 1319. Game runs fine before repacking but citra crashes after repack
 

ABZB

Member
Newcomer
Joined
Sep 10, 2017
Messages
17
Trophies
0
Age
32
XP
130
Country
United States
Is there a recommended guide on how to install python 2 alongside python 3, in a way that this will work without screwing up my Python-3 projects?
 

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
Is there a recommended guide on how to install python 2 alongside python 3, in a way that this will work without screwing up my Python-3 projects?

Hi! Sorry for the late reply!

https://stackoverflow.com/questions...ython-2-x-and-python-3-x-in-windows-7/3809404
https://stackoverflow.com/questions...n-the-same-windows-computer/13297878#13297878

Depending on what you need to do with both Python 2.x and 3.x, you should choose the solution that suits you best. So either use the Python Launcher for Windows, or rename the 3.x .exe (or both) and add both Python directories in order to PATH.
 

Splannin

New Member
Newbie
Joined
Sep 30, 2019
Messages
4
Trophies
0
Age
27
Location
the closet in Cali
XP
55
Country
United States
Okay so I currently cannot provide screenshots at the moment since I'm not at my computer right now.

But I had an error last night saying I had missing tools when I directly dragged the 3DS file onto Make 2.07 (3DS to cia) file. And whenever I opened the 3DS to cia file and dragged the 3DS file in the window it would close. I was able to do it one time but I got an error even though I have Python 2.7 on the path and the 3DS file is decrypted. Help?

(For reference my laptop version is on Windows 10.)
 
Last edited by Splannin,

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
Okay so I currently cannot provide screenshots at the moment since I'm not at my computer right now.

But I had an error last night saying I had missing tools when I directly dragged the 3DS file onto Make 2.07 (3DS to cia) file. And whenever I opened the 3DS to cia file and dragged the 3DS file in the window it would close. I was able to do it one time but I got an error even though I have Python 2.7 on the path and the 3DS file is decrypted. Help?

(For reference my laptop version is on Windows 10.)

Hi there! :)
"Missing tools" means that one or more .exe in the "tools" directory inside the 3ds to cia folder are missing. It's usually the antivirus/Windows Firewall grabbing some .exe because it thinks it's suspicious. Also, if some important executable like say makerom.exe or exinjector.exe got snatched by your antivirus, then that's most likely what caused the error when you tried to use the batch. If that's what happened, you should restore the file(s) and make the antivirus ignore the directory.
Hope this helps!
 

Splannin

New Member
Newbie
Joined
Sep 30, 2019
Messages
4
Trophies
0
Age
27
Location
the closet in Cali
XP
55
Country
United States
Hi there! :)
"Missing tools" means that one or more .exe in the "tools" directory inside the 3ds to cia folder are missing. It's usually the antivirus/Windows Firewall grabbing some .exe because it thinks it's suspicious. Also, if some important executable like say makerom.exe or exinjector.exe got snatched by your antivirus, then that's most likely what caused the error when you tried to use the batch. If that's what happened, you should restore the file(s) and make the antivirus ignore the directory.
Hope this helps!
Okay thank you!

So I've finally been able to put the 3DS file in 3DS to cia but I keep getting an error?? I have Python 2.7 on the Path e.v and the 3DS file is decrypted. Should I do the process over again?

Edit: So I did everything all over again and while I was reading the fourm I noticed you said to press 4 if its off. I noticed that my 4 says "no", so do I turn that on first and after the process is done do I press 6?
 
Last edited by Splannin,

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
Okay thank you!

So I've finally been able to put the 3DS file in 3DS to cia but I keep getting an error?? I have Python 2.7 on the Path e.v and the 3DS file is decrypted. Should I do the process over again?

Edit: So I did everything all over again and while I was reading the fourm I noticed you said to press 4 if its off. I noticed that my 4 says "no", so do I turn that on first and after the process is done do I press 6?

Hi!
No, don't press 4, press 8 instead and check the file that comes up. If it's full of ##### symbols and has no info it means the .rsf hasn't been created properly, meaning it's probably Python's fault. If you have doubts about it you can share the .rsf file, too.
 

Splannin

New Member
Newbie
Joined
Sep 30, 2019
Messages
4
Trophies
0
Age
27
Location
the closet in Cali
XP
55
Country
United States
Hi!
No, don't press 4, press 8 instead and check the file that comes up. If it's full of ##### symbols and has no info it means the .rsf hasn't been created properly, meaning it's probably Python's fault. If you have doubts about it you can share the .rsf file, too.
I pressed 8 and I saw some #### symbols in part of the file and when I said yes when 3DS to cia that it was ready it had an error so I assume that means that it wasn't created properly. What do I do now?
 

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
I pressed 8 and I saw some #### symbols in part of the file and when I said yes when 3DS to cia that it was ready it had an error so I assume that means that it wasn't created properly. What do I do now?

Looks like the issue is caused by Python. Python is supposed to run the .py script that creates the .rsf, and the batch finds Python thanks to the PATH environmental variables. You need to make sure that:
- Python is installed, preferably in the same partition where your os is installed, like C: (somebody mentioned that when they tried installing Python in D: or some other disk partition, the system couldn't find Python for some reason and the script didn't work);
- .py files are associated with Python.exe;
- Python has been added to the PATH environmental variables.
If you ever installed Python 3.x, now or even in the past, this may also cause problems because the rsfgen.py script is not compatible with Python 3.
 

Splannin

New Member
Newbie
Joined
Sep 30, 2019
Messages
4
Trophies
0
Age
27
Location
the closet in Cali
XP
55
Country
United States
Looks like the issue is caused by Python. Python is supposed to run the .py script that creates the .rsf, and the batch finds Python thanks to the PATH environmental variables. You need to make sure that:
- Python is installed, preferably in the same partition where your os is installed, like C: (somebody mentioned that when they tried installing Python in D: or some other disk partition, the system couldn't find Python for some reason and the script didn't work);
- .py files are associated with Python.exe;
- Python has been added to the PATH environmental variables.
If you ever installed Python 3.x, now or even in the past, this may also cause problems because the rsfgen.py script is not compatible with Python 3.
Thank you so much! Its finally working now. Also I assume I use the same process for the DLC correct? Or do I just download the DLC and it'll have the mod?
 

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
Thank you so much! Its finally working now. Also I assume I use the same process for the DLC correct? Or do I just download the DLC and it'll have the mod?

Hi! I'm glad it works for you! :)
Also, whatever mod you applied to the game should work for DLCs as well. As in, simply install the DLC and you'll have both the hack and the DLCs.
 
Last edited by FriendlyHacker,

Casual-One

Member
Newcomer
Joined
Oct 27, 2019
Messages
5
Trophies
0
Age
21
XP
56
Country
Australia
I get up to the step where you recompile the full modded file in 3ds to cia, and I keep getting error messages.
*Cap -> ture -> HELPMEPLEASE
 

Attachments

  • Cap.PNG
    Cap.PNG
    39.1 KB · Views: 187
  • ture.PNG
    ture.PNG
    43.2 KB · Views: 189
  • HELPMEPLEASE.PNG
    HELPMEPLEASE.PNG
    45.3 KB · Views: 221
Last edited by Casual-One,

FriendlyHacker

Well-Known Member
OP
Newcomer
Joined
Oct 19, 2018
Messages
82
Trophies
0
Age
26
Location
127.0.0.1
XP
386
Country
Italy
I get up to the step where you recompile the full modded file in 3ds to cia, and I keep getting error messages.
*Cap -> ture -> HELPMEPLEASE

Hi there!
I see you get a "[CCI ERROR] Not enough memory" makerom.exe related error, which apparently means you either don't have enough memory on your hard disk or not enough ram. Did you do other things on your pc while rebuilding (like browsing the internet and so on)?
 

Casual-One

Member
Newcomer
Joined
Oct 27, 2019
Messages
5
Trophies
0
Age
21
XP
56
Country
Australia
Hi there!
I see you get a "[CCI ERROR] Not enough memory" makerom.exe related error, which apparently means you either don't have enough memory on your hard disk or not enough ram. Did you do other things on your pc while rebuilding (like browsing the internet and so on)?
Nope, I was just waiting. and it can't be not enough space since I was using a large Hard drive that was barely a third full.
If it helps I tried again today without implementing changes and it worked fine, so it may be a hiccup with the changes themselves, is that common?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: 👈 Always touching 🍆