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,

XLuma

Pkmn Rom Hacker
Member
Joined
Feb 12, 2017
Messages
490
Trophies
0
Age
23
Location
Quebec
XP
638
Country
Canada
actually, 3dstool isn't needed for the most part, since you can just extract, mod, and rebuild the rom directly, but that's a good tutorial anyway
 

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
actually, 3dstool isn't needed for the most part, since you can just extract, mod, and rebuild the rom directly, but that's a good tutorial anyway

Oh, I'm sorry about that, it's just the method I used among all the possible ones. ^_^
There are many tools out there one could use instead, but I found that 3dstool works like a charm for Japanese games because it supports unicode characters (which are often used in filenames), and not all tools do.
I wasn't sure if 3ds to cia supported unicode characters or not so I used this method to be on the safe side just in case. :)
 

Deleted member 414661

Well-Known Member
Newcomer
Joined
Feb 13, 2017
Messages
79
Trophies
0
XP
182
Okay, so I'm using the Karameru archive extractor to open up and mod Fire Emblem Fates to play the Good Guy Garon mod on Citra. The vanilla game runs just fine on Citra. But the mod only alters the cutscenes and dialogue between levels, nothing else, and yet the game opens but doesn't run at all on Citra.

What am I doing wrong here?

The only bit I think I might have not done right that you stated here was renaming the game to "filename_modified.3ds", but since I'm not using 3dstool I'm not sure if that's even necessary.

I'm also interested in trying to run Pokemon Supernova Sun or Penumbra Moon in the future on Citra.
 
Last edited by Deleted member 414661,

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'm using the Karameru archive extractor to open up and mod Fire Emblem Fates to play the Good Guy Garon mod on Citra. The vanilla game runs just fine on Citra. But the mod only alters the cutscenes and dialogue between levels, nothing else, and yet the game opens but doesn't run at all on Citra.

What am I doing wrong here?

The only bit I think I might have not done right that you stated here was renaming the game to "filename_modified.3ds", but since I'm not using 3dstool I'm not sure if that's even necessary.

I'm also interested in trying to run Pokemon Supernova Sun or Penumbra Moon in the future on Citra.

Hi there! If you use 3DS to CIA, renaming the file that way is needed so that 3DS to CIA can recognize your .3ds file as a decrypted file. If you don't do that you can't extract & rebuild it properly, as the program assumes your file is encrypted by default.
Try renaming it to something like "FireEmblemFates_modified.3ds", extracting and rebuilding with 3DS to CIA and let me know if it works! (by the way I also modded both Fates and Awakening using this exact method so they should work!)

As for the Pokémon games they should run without any problems since the person who made those hacks has run them on Citra as well.

EDIT:
I tried the method I described to install the Good Guy Garon hack and it works!
However, since I have the EUR edition I had to change the name of the directories in the hack's files from romfs\m\@E and romfs\m\B\@E to romfs\m\@U and romfs\m\B\@U. Then I copy-pasted them in the romfs folder (replacing the files) and rebuilt the romfs.bin and .3ds. Citra runs it just fine, so you shouldn't have any problems making it work if you use this method. Please try it and let me know if you still have trouble!
 
Last edited by FriendlyHacker,

Deleted member 414661

Well-Known Member
Newcomer
Joined
Feb 13, 2017
Messages
79
Trophies
0
XP
182
Hi there! If you use 3DS to CIA, renaming the file that way is needed so that 3DS to CIA can recognize your .3ds file as a decrypted file. If you don't do that you can't extract & rebuild it properly, as the program assumes your file is encrypted by default.
Try renaming it to something like "FireEmblemFates_modified.3ds", extracting and rebuilding with 3DS to CIA and let me know if it works! (by the way I also modded both Fates and Awakening using this exact method so they should work!)

As for the Pokémon games they should run without any problems since the person who made those hacks has run them on Citra as well.

EDIT:
I tried the method I described to install the Good Guy Garon hack and it works!
However, since I have the EUR edition I had to change the name of the directories in the hack's files from romfs\m\@E and romfs\m\B\@E to romfs\m\@U and romfs\m\B\@U. Then I copy-pasted them in the romfs folder (replacing the files) and rebuilt the romfs.bin and .3ds. Citra runs it just fine, so you shouldn't have any problems making it work if you use this method. Please try it and let me know if you still have trouble!
I'm not using 3ds to CIA and vice versa.

Karameru allows me to open up the 3ds file directly and alter it if I desire.

I have the US .3ds file for FE Fates, and in the mod there are files are "m/@E" and "m/B".
 

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'm not using 3ds to CIA and vice versa.

Karameru allows me to open up the 3ds file directly and alter it if I desire.

I have the US .3ds file for FE Fates, and in the mod there are files are "m/@E" and "m/B".

I've used Karameru (and its siblings) for other things but for some reason I haven't managed to make it work for extracting+rebuilding purposes, so if you insist on using it, I can't help you there, I'm sorry!
I've tried installing the GGG mod for Fates using Karameru and had the exact same problems you've run into. Either there is something specific we should do to make it work, or the program doesn't rebuild the GameData.cxi file or the .3ds file the way it should.
I know this tutorial sounds like it's a lot of work, but it's not really. If you use the method I described you won't get a .cia file instead of a .3ds file, you'll simply get a modded .3ds file which will run on Citra without any problems.
If you still don't like it and don't want to try using it, I'm sorry I couldn't help you out!
 
Last edited by FriendlyHacker,

Peyton

New Member
Newbie
Joined
Dec 16, 2018
Messages
2
Trophies
0
Age
26
XP
49
Country
United States
Okay, I made it up to four but five is really confusing me as I have zero experience working with this kind of stuff. If you could explain step by step, I'd really appreciate it. Thank you so much for this 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
Okay, I made it up to four but five is really confusing me as I have zero experience working with this kind of stuff. If you could explain step by step, I'd really appreciate it. Thank you so much for this tutorial.

Hi, sorry for the late reply! You're welcome, I hope this method will help you! :)

So, to open the command prompt, go to Start and type "cmd" and open the program that comes up. 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:\3dstool"

And I get:

C:\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:

C:\3dstool>3dstool -xvtf romfs romfs.bin --romfs-dir romfs

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.
Keep this window open so you can later rebuild the romfs file (step 8), and delete the romfs.bin file you've just extracted (because you'll rebuild it later and it'd only get in the way).

Step 8 is identical, the only difference is the command used.

If you find anything to be not clear or have any more questions, feel free to ask!
 
Last edited by FriendlyHacker,

Miguel Gomez

Well-Known Member
Member
Joined
Jan 10, 2016
Messages
2,867
Trophies
0
Age
25
Location
Planet Earth
XP
1,530
Country
  • 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
A nice way to do so. May I include my method to mod Smash Bros 3DS and other parts of Pokemon SM/USUM? Citra Emulator can support SaltySD by patching code.bin.

I have my guide on Gamebanana and Citra Community Forums. It's better for Smash 3DS.
https://gamebanana.com/tuts/12515
https://community.citra-emu.org/t/guide-how-to-install-smash-3ds-mods-on-citra/68320

Thank you for reading this and sharing another method!
If a different way of doing this works better for someone (or for a specific game), then by all means it should be included and shared!
Thank you, feel free to edit the initial post if you want to!

On that note, @Fishmalk has written another method for installing hacks to run on Citra which is worth checking out!
 
Last edited by FriendlyHacker,

RobinThePhoenix

New Member
Newbie
Joined
Dec 26, 2018
Messages
4
Trophies
0
Age
25
XP
50
Country
Ireland
Hello, I really appreciate the tutorial you've done but im just not great at programming :/ I thought I had everything done right but I think I'm missing something obvious. Thats the error I keep getting. Any help would be greatly appreciated!
Screenshot (10).png
 

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
Hello, I really appreciate the tutorial you've done but im just not great at programming :/ I thought I had everything done right but I think I'm missing something obvious. Thats the error I keep getting. Any help would be greatly appreciated!
View attachment 153313

I assume your .3ds file is not decrypted. This tutorial skips the dumping & decrypting part which many nice people described in different guides and tutorials. You can try looking it up on this site. Or I guess... if you got your .3ds file on that site, then look for "decrypted for Citra" or smtg along those lines in the download...
 
Last edited by FriendlyHacker,

RobinThePhoenix

New Member
Newbie
Joined
Dec 26, 2018
Messages
4
Trophies
0
Age
25
XP
50
Country
Ireland
I assume your .3ds file is not decrypted. This tutorial skips the dumping & decrypting part which many nice people described in different guides and tutorials. You can try looking it up on this site. Or I guess... if you got your .3ds file on that site, then look for "decrypted for Citra" or smtg along those lines in the download...

The file runs on citra before I start doing any of the modifying so i believe its decrypted? I used Batch CIA 3DS Decryptor, do I need to do it a different way instead cause then I'll try one of the tutorials on here. Also thanks for replying so quickly :)
 

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
The file runs on citra before I start doing any of the modifying so i believe its decrypted? I used Batch CIA 3DS Decryptor, do I need to do it a different way instead cause then I'll try one of the tutorials on here. Also thanks for replying so quickly :)

Ok, I'm very very very sorry about not mentioning this before... do you have Python 2.7? If not, that may be what causes the error! (Again, I'm really really sorry about not writing this anywhere and assuming everyone to already have Python... sorry) It's said in Katsu's post that you need to have python 2.7 installed (in C:\python27 I believe).
 
Last edited by FriendlyHacker,

RobinThePhoenix

New Member
Newbie
Joined
Dec 26, 2018
Messages
4
Trophies
0
Age
25
XP
50
Country
Ireland
Ok, I'm very very very sorry about not mentioning this before... do you have Python 2.7? If not, that may be what causes the error! (Again, I'm really really sorry about not writing this anywhere and assuming everyone to already have Python... sorry) It's said in Katsu's post that you need to have python 2.7 installed (in C:\python27 I believe).

I think that's it! I don't have it so I'll give that a go. Don't worry about it thank you so much for taking the time to do this!
 
  • Like
Reactions: FriendlyHacker

Orsin456

New Member
Newbie
Joined
Jan 3, 2019
Messages
1
Trophies
0
Age
24
XP
52
Country
United States
Quick question, do i need to also replace certain files such as: .code.bin, banner.bin, icon.bin, etc?

Another words, I typically see the main folder I need to replace (romfs) that is included in the mod. But my concern is that i see other things as well. What should i do?
 

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
Quick question, do i need to also replace certain files such as: .code.bin, banner.bin, icon.bin, etc?

Another words, I typically see the main folder I need to replace (romfs) that is included in the mod. But my concern is that i see other things as well. What should i do?

Usually you don't have to touch the other .bin files unless the mod creator stated so. From my experience, hackers usually change files only within the romfs.bin file. (I hope I understood your question correctly)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Que dices?