Tutorial
Updated
Create & Use NTR LayeredFS Plugins

[ Introduction ]
Welcome to another kick-ass guide by Cots. In this guide you'll learn how to create and use the NTR Debugger's LayeredFS plugins. Using these plugins you can modify the contents of Nintendo 3DS games allowing you to create game patches for purposes of texture hacking, translation, asset replacement, etc... Even though the NTR Debugger is not being worked on anymore it is still a viable option and alternative to HANS and is used by many in the community for its robust features such as game streaming, cheating and of course LayeredFS plugins.
[ Requirements ]
* a9lh (arm9loaderhax) Old or New Nintendo 3DS
* 3DS Game already installed onto the Home Menu
* BootNTR - https://github.com/astronautlevel2/BootNTR/releases
* NTR CFW 3.4 Preview 2 - ttps://github.com/44670/BootNTR/releases (NTR_3.4PREVIEW2_STARTER_KIT.zip)
* NTR LayeredFS - http://www.mediafire.com/download/upx189osoighcur/NTR_LayeredFS.rar
* BrainDump - https://github.com/neobrain/braindump/releases
* devkitpro - http://devkitpro.org/wiki/Getting_Started
* Python 2.7.12 - https://www.python.org/downloads
* PackHack - http://pastebin.com/A1s8cmsD
To start things off you'll need to install a few things to get the environment required for created plg (plugin) files for NTR and also get your 3DS prepared for running the LayeredFS plugins.
[ Preparing the Environments ]

(1) Copy "NTR.BIN" from the NTR_3.4PREVIEW2_STARTER_KIT.zip to the [root] of your 3DS SD Card

(2) Create a folder in the [root] of your 3DS SD Card name /plugin/

(3) Copy the "braindump" folder from the 7z file to /3ds/ folder on your 3DS SD Card (you will launch in from the homebrew launcher)

(4) Install BootNTR.cia using your favorite CIA Manager

(5) Install devkitpro using the "Windows Installer/Updater package"

(6) Install Python 2.7.12

(7) Copy the contents of PackHack archive from /PackHack/ & /SecretFiles/ to a folder on your hard drive (combine the two folders inside of the archive) and then install the "SetupUS.exe" program

(8) Copy the \Layeredfs\ folder from the "NTR LayeredFS" archive to a folder on your hard drive
[ Part 1 - Game Data ]

The first thing you're going to need to do after setting up the environment is to fetch the game data from the game you're going to be working with. This is accomplished by running braindump from your Homebrew Launcher.

Once you launch braindump you can browse your installed system titles by pressing "Left/Right" until you find the game you're going to be editing. Press "A" on it and sit back and relax as this process could take some time.

What you'll end up with is a CXI dump of your game's RomFS partition. This is a package containing most of the game data that is accessed by the 3DS including fonts, scripts, graphics, sounds and other types of files.
Locate the CXI file on the [root] of your 3DS SD Card and copy it onto your computer into the folder you extracted PackHack into. PackHack will be used to extract the contents of the CXI so you can edit them. Take note of the file name of the CXI as it represents the Unique Title ID of the game you're going to be editing as the ID is used by NTR to load your customized assets.


To extract the contents of the CXI run PackHack and from the main menu type in "CXI" and then press "enter". This will extract all of the contents within the CXI into the folder you're running PackHack from. Next type in the name of the CXI file (without an extension) and type in "n" when it asks you about decompressing code.bin.
[ Part 2 - Creating the plg ]
Next locate the "DecryptedExeFS.bin" file inside of the "PackHack" folder and copy it to the "LayeredFS\workdir" and then rename it to "ExeFS.bin".
Now run the "BuildLayeredFS.bat" batch file. If you get an error saying "MSVCR120.dll is missing" visit this site and grab the 32-bit version and then place it inside the LayeredFS folder.

Once the BuildLayeredFS batch file does some of its thing it will ask you to "Enter the folder of the layeredFS file". Now enter in the Unique ID (the file name of the CXI without the extension) and press "enter".

It will then ask you for the Language Code for the Language Emulation and if you're not going to be using this just press "enter" (Luma CFW does this automatically now so you shouldn't need it).


When the program finishes you will have a "layeredfs.plg" file inside of the "LayeredFS\workdir" folder.

Next create a folder on your 3DS SD Card inside of the plugin folder and name it the Unique ID and then place the "layeredfs.plg" file you just created into that folder.

You'll also want to create a folder in the [root] of your 3DS SD Card and name it the Unique ID too. This folder is where the contents of the RomFS that you replace/change will be located. If you look at the contents of "\PackHack\ExtractedRomFS\" you will see all of your games files. So if you change "\scripts\A000_Terrain.cmb" (using this name as an example only) you'll want to create a folder in the Unique ID folder on your 3DS SD Card named "scripts" and place the modified "A000_Terrain.cmb" inside of it.
[ Part 3 - Running NTR w/Hacks ]

Once you're done editing you files copy them over to the folder in the [root] of your 3DS's SD Card (the Unique ID folder you created) and then turn on your 3DS and run NTR. If all goes well you'll be told to press the home button to return. To check if NTR is working press X + Y to see its onscreen menu.
Now run the game you've been working with and keep an eye on the top Nintendo 3DS boot screen. If it flashes green you're good to go and anything you've replaced will now load.
That's all there is too it. I hope you find this guide useful.
I'd like to thank TheLegendofMario for helping me with getting to know NTR's LayeredFS system!

(this is an example of an english translation layeredfs plugin)

Last edited by cots,