[Tutorial] Create & Use NTR LayeredFS Plugins

Discussion in '3DS - Tutorials' started by cots, Jul 13, 2016.

  1. cots
    OP

    cots GBAtemp Fan

    Member
    488
    315
    Dec 29, 2014
    United States
    [​IMG]

    [ 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 ]


    [​IMG]

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

    [​IMG]

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

    [​IMG]

    (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)

    [​IMG]

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

    [​IMG]

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

    [​IMG]

    (6) Install Python 2.7.12

    [​IMG]

    (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

    [​IMG]

    (8) Copy the \Layeredfs\ folder from the "NTR LayeredFS" archive to a folder on your hard drive

    [ Part 1 - Game Data ]

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    [​IMG]

    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.

    [​IMG]

    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".

    [​IMG]

    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).

    [​IMG]

    [​IMG]

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

    [​IMG]

    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.

    [​IMG]

    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 ]

    [​IMG]

    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!

    [​IMG]
    (this is an example of an english translation layeredfs plugin)
    [​IMG]
     
    Last edited by cots, Jul 22, 2016
    XAIXER, hiten, Voxel and 5 others like this.
  2. TheLegendofMario

    TheLegendofMario GBAtemp Regular

    Member
    143
    42
    May 15, 2016
    United States
    Bravo, excellent guide
     
  3. Gray_Jack

    Gray_Jack GBAtemp Advanced Fan

    Member
    725
    262
    Jan 13, 2016
    @cots
    The NTR 3.4 works on the Old 3DS, but there is a N3DS only feature, to stream the game on PC
    This tutorial will work on a Old 3DS
     
  4. zFerry

    zFerry Member

    Newcomer
    31
    8
    Jul 15, 2016
    Italy
    Error during build .plg
    NO PAYLOAD.bin in Plugin folder of the NTRlayered folder.
    (Yeah, in plugin folder there isn't a file called payload.bin)

    A screen of the error

    LAYEREDfs-PAYLOAD.jpg
     
  5. cots
    OP

    cots GBAtemp Fan

    Member
    488
    315
    Dec 29, 2014
    United States
    That step is when it copies and renames the .plg file which is not being created for you. Make sure that Devkitpro is in you PATH environment variables.
     
  6. zFerry

    zFerry Member

    Newcomer
    31
    8
    Jul 15, 2016
    Italy
    Thank you.
    I worked a little about environment variables, in the end it worked.
    Now let's see if it works on the console.
    Thanks again
     
  7. zFerry

    zFerry Member

    Newcomer
    31
    8
    Jul 15, 2016
    Italy
    OK, work but ...

    I changed the base folder for RomFS "Unique ID" with "LayeredFS/Gamename" and don't works, so i open .plg on hexEditor and i see this "ram:/layeredFSGamename/", I modify it in "ram:/layeredFS/Gamename/" and it works.
    Thanks for the tutorial and the help. :yay3ds:
     
  8. cots
    OP

    cots GBAtemp Fan

    Member
    488
    315
    Dec 29, 2014
    United States
    Cool! You figured out how to use sub-directories. This should make the clutter on the sd card not so bad.
     
  9. PabloMK7

    PabloMK7 Red Yoshi! ^ω^

    Member
    1,764
    1,041
    Feb 21, 2014
    Spain
    Yoshi's Island
    You should also add to the tuto that having a patch downloaded will hang at Nintendo3ds logo.
     
  10. pinguino1234

    pinguino1234 Advanced Member

    Newcomer
    56
    4
    Sep 22, 2015
    Mexico
    Maybe this is a noob question but... Its possible to have custom banner by editing the exefs?
     
  11. PabloMK7

    PabloMK7 Red Yoshi! ^ω^

    Member
    1,764
    1,041
    Feb 21, 2014
    Spain
    Yoshi's Island
    Not with layeredfs
     
    pinguino1234 likes this.
  12. Protatoxxxeater

    Protatoxxxeater GBAtemp Regular

    Member
    292
    29
    Jun 17, 2016
    United States
    somebody told me that Ntr does all the things hans can do, im trying to load a code.bin but with NTR not hans, someone said i could use layeredfs and edit the code.bin and rebuild, it didnt work. is there another way to do this
     
  13. Yokujin

    Yokujin GBAtemp Regular

    Member
    238
    21
    Mar 23, 2009
    Gambia, The
    i understand nothing how @zFerry fixed his problem...
     
  14. zFerry

    zFerry Member

    Newcomer
    31
    8
    Jul 15, 2016
    Italy
    What did you not understand?
    If it relates to the modification of the mod file directory, simply when you enter the path, write what you want.
    If we talk about the problem with PATH, things get complicated ...
     
  15. Yokujin

    Yokujin GBAtemp Regular

    Member
    238
    21
    Mar 23, 2009
    Gambia, The
    [​IMG]
    this stuff and all
    i have the same problem and nobody tells me how to get layeredfs to work with devkit
     
  16. zFerry

    zFerry Member

    Newcomer
    31
    8
    Jul 15, 2016
    Italy
    I DO NOT know how to speak English, so I will try to do my best.
    You have to open "System" and click on "Advanced system settings", then "Environment Variables" and in the <System Variables> search for "PATH" to add the "X position: \ devkitPro \ devkitARM \ bin" where X stands for the united devkitPro where the program is installed.
    Example: (For me this is it) "C: \ Program Files \ devkitPro \ devkitARM \ bin".
    1.png 2.png 3.png 4.png
     
    DolphinPussy likes this.
  17. Yokujin

    Yokujin GBAtemp Regular

    Member
    238
    21
    Mar 23, 2009
    Gambia, The
    yeah thanks it was devkit\msys something that didnt even exist