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,

Blackbeared

New Member
Newbie
Joined
Jan 21, 2019
Messages
3
Trophies
0
Age
32
XP
56
Country
Netherlands
So I'm kinda at a loss here. I have everything mentioned in the post, also Python 2.7 installed in C:\pyton27, all the tools a decrypted Ultra Sun file. And followed this guide to the letter. But at the last step, the final one I get the same error as another user has uploaded in this forum. With the file not being able to be created. I followed it to the letter but still getting the errors.

It's at the same when I press 6 & S to start it, it opens something to open a .py (I think py, python atleast) file, so I select my Python.exe, and that's it. After like a few seconds it gives me the ERROR.

Any ideas ?
 

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
So I'm kinda at a loss here. I have everything mentioned in the post, also Python 2.7 installed in C:\pyton27, all the tools a decrypted Ultra Sun file. And followed this guide to the letter. But at the last step, the final one I get the same error as another user has uploaded in this forum. With the file not being able to be created. I followed it to the letter but still getting the errors.

It's at the same when I press 6 & S to start it, it opens something to open a .py (I think py, python atleast) file, so I select my Python.exe, and that's it. After like a few seconds it gives me the ERROR.

Any ideas ?

Hello!
Hmm, I apologize, this is slightly confusing.
First, can I ask how you installed Python, exactly? If you used the installer and followed the common installing process, you should have it in C:\Python27.
Since you get a message asking to open (or maybe locate) a .py file (which you correctly assumed to be a python file), I can only guess the problem lies with Python and the way/path you installed it in.
If you correctly installed it in the right directory, then the issue may be somewhere else.
For now, could you please check Python again? (And maybe tell me what .py file it wants?)
 

Blackbeared

New Member
Newbie
Joined
Jan 21, 2019
Messages
3
Trophies
0
Age
32
XP
56
Country
Netherlands
So I'm following the tutorial again, reinstalled Python through the link you provided. Python is indeed installed in C:\Python27. The file it wants to open is called rsfgen.py. Which I can select to open with the python.exe

But even after that I still get the same error message namely:

[EXHEADER ERROR] Parameter Not Found: "BasicInfo/Title"
[EXHEADER ERROR] Failed to create ExHeader
[NCCH ERROR] NCCH Build Process Failed
[RESULT] Failed to build outfile

Creating Pokemon_Photonic_Sun_modified.3ds failed.

Press a button to continue.

That's the error I'm getting, no matter what I try with following the tutorial.
 

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
So I'm following the tutorial again, reinstalled Python through the link you provided. Python is indeed installed in C:\Python27. The file it wants to open is called rsfgen.py. Which I can select to open with the python.exe

But even after that I still get the same error message namely:

[EXHEADER ERROR] Parameter Not Found: "BasicInfo/Title"
[EXHEADER ERROR] Failed to create ExHeader
[NCCH ERROR] NCCH Build Process Failed
[RESULT] Failed to build outfile

Creating Pokemon_Photonic_Sun_modified.3ds failed.

Press a button to continue.

That's the error I'm getting, no matter what I try with following the tutorial.

I'm sorry you're having this problem...
You're not supposed to get a message asking you to open rsfgen.py. It shouldn't occur if your file is decrypted (properly), renamed with "_modified" at the end, and you used the correct instructions when rebuilding (also you should have the last version of the batch, that is 3ds to cia v2.07, since there was a bug with auto rsf in earlier versions).
I believe this can only mean:
1- your file is not actually decrypted (or has bad rsf/exheader idk)
2- you are not aware that you are skipping or getting wrong some small step while extracting or rebuilding the .3ds file (most likely when rebuilding).
When rebuilding, you press 6 and then s, right? Try checking [4] as well, though it usually uses it automatically anyway.
Also, you didn't move around the original file or the other extracted files (besides messing with the romfs.bin), did you? Like moving or deleting Pokemon_Photonic_Sun_modified.3ds from the folder where all the extracted files are located.
 
Last edited by FriendlyHacker,

Blackbeared

New Member
Newbie
Joined
Jan 21, 2019
Messages
3
Trophies
0
Age
32
XP
56
Country
Netherlands
Alright I may have succeeded this time. Found a whole new base rom that was decrypted (made sure of that), and installed the Python version you linked. And I got to the end of the "Rebuilding" part and I noticed you said:

"Try checking [4] as well, though it usually uses it automatically anyway." . This was set to "No" on my end so for safety I turned it on. And well now it succeeded and I think, atleast I HOPE the hack I applied is working as intended, for me it does. So far so good. It seems either I needed to turn [4] on, or I needed another Rom base, but so far it succeeded!
 
  • Like
Reactions: FriendlyHacker

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
Alright I may have succeeded this time. Found a whole new base rom that was decrypted (made sure of that), and installed the Python version you linked. And I got to the end of the "Rebuilding" part and I noticed you said:

"Try checking [4] as well, though it usually uses it automatically anyway." . This was set to "No" on my end so for safety I turned it on. And well now it succeeded and I think, atleast I HOPE the hack I applied is working as intended, for me it does. So far so good. It seems either I needed to turn [4] on, or I needed another Rom base, but so far it succeeded!

I'm glad it works for you! :)
I think the file you used before wasn't decrypted properly. Option [4] seems to turn on by default when using those instructions, so I think checking it manually isn't needed.
If you still have trouble or need help with anything else, feel free to ask!
 

Cereza

New Member
Newbie
Joined
Jan 28, 2019
Messages
1
Trophies
0
Age
26
XP
52
Country
Paraguay
Uh, is the first time i'm doing something like this and i'm a little bit lost... I don't know where to put the comads you say and with that I didn't what I was doing after that... I think I got to extract the romfs but nothing more than that... I'm just a dumbass... I don't know how to explain myself (and sorry for my awful english)
 

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
Uh, is the first time i'm doing something like this and i'm a little bit lost... I don't know where to put the comads you say and with that I didn't what I was doing after that... I think I got to extract the romfs but nothing more than that... I'm just a dumbass... I don't know how to explain myself (and sorry for my awful english)

Hi there! :)
Can you please tell me where you got stuck, exactly? If you managed to extract the .3ds file (up to step 4), and don't know how to do step 5, I wrote about it in detail in the comments, in response to someone else who had the same doubts the intial post is now updated with more details on how to use the command prompt.
If you managed to extract the romfs.bin file (step 6/7), then you need to follow the instructions provided by the modder and substitute or patch files, etc.
If you tell me which game you're trying to mod, I can write detailed instructions for you, step by step, for that specific game.
 
Last edited by FriendlyHacker,

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
I have an issue, I did extract the game file where the romf is and stuff, but i just realised that the black window (the one of 3ds to citra and the comand prompt) just dont show any text, and when I write something it doesnt show characters like: q, x, w, etc.... Whats happening?

Edit-Basicilly I am stucked in the extract romf part.

NVM Fixed it, just restart the computer
 
Last edited by DParedes,

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
Oley so I did have a problem at the end, when repacking the folder to .3ds it says that it doesn’t find the archive or something and turn all red, it also auto opens a .text (notes block)
 

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
Oley so I did have a problem at the end, when repacking the folder to .3ds it says that it doesn’t find the archive or something and turn all red, it also auto opens a .text (notes block)

Hi! I'm sorry I'm replying late!
Could you please explain your problem more in detail, please? What "archive" is it unable to find when you try to rebuild the .3ds? Is something written on the .txt file it opens?
Also, did you by any chance move or delete the .3ds file inside the folder containing the extracted files (before rebuilding I mean)?
 

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
Hi! I'm sorry I'm replying late!
Could you please explain your problem more in detail, please? What "archive" is it unable to find when you try to rebuild the .3ds? Is something written on the .txt file it opens?
Also, did you by any chance move or delete the .3ds file inside the folder containing the extracted files (before rebuilding I mean)?
No I did not delete the .3ds. ummm When I entered the 3ds to cia app, I selected option 6, repack, then pressed s and it turns all light blue, then i see somthing saying it doesnt find the game; FE Awakening_modified, in my case. or did i needed to take the .3ds out of the exteacted folder?

Just when it turns blue it opens a .text, and it sais rsfgem: bloc de notas, and in the actual text it has som weid coding, staring whith import struct, import binascii, Import sys, etc.... When I close it it all turn red (in the 3ds to cia)
 
Last edited by DParedes,

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
No I did not delete the .3ds. ummm When I entered the 3ds to cia app, I selected option 6, repack, then pressed s and it turns all light blue, then i see somthing saying it doesnt find the game; FE Awakening_modified, in my case. or did i needed to take the .3ds out of the exteacted folder?

Just when it turns blue it opens a .text, and it sais rsfgem: bloc de notas, and in the actual text it has som weid coding, staring whith import struct, import binascii, Import sys, etc.... When I close it it all turn red (in the 3ds to cia)

Hmm, well you must not move or delete the .3ds file, so that's okay.
So let me know if I'm getting this right: you have a decrypted .3ds file of FE Awakening. After installing Python 2.7 (unless you already had it) and renaming the .3ds file, you drag&dropped it on the 3ds to cia batch, and waited for the .3ds file to be extracted. Then you extracted and modified the romfs.bin file. And then you went back to the 3ds to cia window and pressed 6 and s to rebuild the .3ds.
If you've done all of this correctly, I suspect your file may not be properly decrypted. Does it run on citra before you try doing any modding?
(By the way I also modded FE Awakening so I can help you out there if you need it)

EDIT: I forgot to mention, whatever it says while it's blue doesn't matter as long as it doesn't turn red. And it shouldn't open a text file, especially not one called rsfgen, which is why I can only think your file is not decrypted or maybe you don't have python. (Badly decrypted files are also a possibility, as you can see in the previous comments.)
 
Last edited by FriendlyHacker,

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
Hmm, well you must not move or delete the .3ds file, so that's okay.
So let me know if I'm getting this right: you have a decrypted .3ds file of FE Awakening. After installing Python 2.7 (unless you already had it) and renaming the .3ds file, you drag&dropped it on the 3ds to cia batch, and waited for the .3ds file to be extracted. Then you extracted and modified the romfs.bin file. And then you went back to the 3ds to cia window and pressed 6 and s to rebuild the .3ds.
If you've done all of this correctly, I suspect your file may not be properly decrypted. Does it run on citra before you try doing any modding?
(By the way I also modded FE Awakening so I can help you out there if you need it)

EDIT: I forgot to mention, whatever it says while it's blue doesn't matter as long as it doesn't turn red. And it shouldn't open a text file, especially not one called rsfgen, which is why I can only think your file is not decrypted or maybe you don't have python. (Badly decrypted files are also a possibility, as you can see in the previous comments.)

jeje yes to everything, it did run on citra, hmmm probably the problem was when i replaced the romfs with the moded?? I am adding the gay expansion, witch folder did you use? i used Hans and replaced evrything in the extracted romf, data, m, person, reliance, etc.... idk what happened D:
 

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
jeje yes to everything, it did run on citra, hmmm probably the problem was when i replaced the romfs with the moded?? I am adding the gay expansion, witch folder did you use? i used Hans and replaced evrything in the extracted romf, data, m, person, reliance, etc.... idk what happened D:

I also used that hack and also used the Hans files, I don't think you did anything wrong there. Also whatever you do with the romfs doesn't matter for rebuilding the .3ds, so the problem has to be there somewhere.
Do you have Python 2.7 installed in "C:\Python27"?
You could try pressing 4 as well as 6 and then s when rebuilding, it might help.
 
Last edited by FriendlyHacker,

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
I also used that hack and also used the Hans files, I don't think you did anything wrong there. Also whatever you do with the romfs doesn't matter for rebuilding the .3ds, so the problem has to be there somewhere.
Do you have Python 2.7 installed in "C:\Python27"?
You could try pressing 4 as well as 6 and then s when rebuilding, it might help.

Thea i have the python there, lemme try

I think the problem is the exheader, but it doesnt let me selest 4 and 6 at the sme time
 
Last edited by DParedes,

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
Thea i have the python there, lemme try

I think it's also worth mentioning that rebuilding takes a whole lot of time and is very "heavy" (basically if you did everything right you'll have to wait some five minutes without doing anything else until it's done with the rebuilding).
 

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
I think it's also worth mentioning that rebuilding takes a whole lot of time and is very "heavy" (basically if you did everything right you'll have to wait some five minutes without doing anything else until it's done with the rebuilding).

Didnt worked jaja, ima do it all again, maybe ill work
 

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
Didnt worked jaja, ima do it all again, maybe ill work

I'm sorry I can't help you more! ;_;
If you want I can redo the whole modding thing and post the screenshots here? It doesn't take much so if it'd help you, I can do that no prob.

EDIT: I'll do just that, so please wait a sec.
 
Last edited by FriendlyHacker,

DParedes

Member
Newcomer
Joined
Feb 2, 2019
Messages
8
Trophies
0
Age
22
XP
54
Country
Mexico
Didnt worked jaja, ima do it all again, maybe ill work

Didnt, idk what to do, cant a .3ds file be shared? xD

--------------------- MERGED ---------------------------

I'm sorry I can't help you more! ;_;
If you want I can redo the whole modding thing and post the screenshots here? It doesn't take much so if it'd help you, I can do that no prob.

EDIT: I'll do just that, so please wait a sec.

Thank youuuuuuuuuuuuuuuuuuuuuuu <3
 
  • Like
Reactions: FriendlyHacker

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    The Real Jdbye @ The Real Jdbye: you can fap to your favorite character without it being gay