How to make a fast CFW-Installer ntrboot card

Discussion in '3DS - Tutorials' started by CheatFreak47, Oct 19, 2017.

  1. CheatFreak47
    OP

    CheatFreak47 Complex Donut

    Member
    1,395
    1,007
    Oct 11, 2011
    United States
    Michigan, USA
    This guide is for advanced users only.
    (Ya know, people that know their way around command prompt or terminal window.)
    It's also a bit long and wordy. Not good for those with little patience. :unsure:

    This is the goal of this guide.

    All that the target stock 3DS needs is an SD card of decent size (at least 1.3ish GiB if you want to do a NAND backup) and an internet connection.

    Interested? Continue on if you're feeling confident.

    Disclaimer:
    If you decide to try this, know that you are responsible for yourself and your actions.
    I will not be held responsible for any action you take. This includes the potential for bricking of 3DS consoles and/or flashcarts.


    Prerequisites:
    • python (3.X)
    • git (doesn't really matter what version, but you should have this obviously)
    • devkitpro with devkitarm installed (latest version)
    • firmtool installed (latest version, installed using the above python)
    • 3dstool (either added to path or stored locally when used)
    • A text editor you are comfortable with.
    • Some sort of internet web host for serving a file. (This needs to be direct linkable, something like mega.nz won't work. I use github pages.)
    • A 3DS already outfitted with boot9strap and ntrboot_flasher.
    • A flashcart capable of ntrboot (with at least 1MiB flashable, the amount of flashable varies. Ex: TTDS is too small, Ak2i and R4i Gold 3DS RTS work fine.)
    • That perfect aeskeydb mentioned in the GodMode9 readme.
    All set? Ok good. I won't be providing help for setting these up, either. That stuff is basic, if you can't sort it out on your own, this thread probably isn't for you.

    Part 1: Getting some things
    The first thing you want to do is download the following things.
    The second thing you want to do is use git to clone the following repos to wherever you feel like on your machine.
    (command reminder: git clone --recursive <url>)
    Part 2: The self-extracting homebrew zip file
    This part revolves around crafting the zip file (and the zip3dsfx) that will be downloaded from your webserver. If you don't have somewhere to host it, you should go set that up. Ideally you want something you can control and update if necessary, like Github Pages.

    First, decide what homebrew you think you want to include in this zip file. You are essentially making your own homebrew starter pack here. In fact, you can also just use the actual homebrew starter pack if you would like. All you need, at minimum, is a copy of the homebrew launcher, named boot.3dsx, in the root of the zip archive, since this will be extracted to the root of the SD card.

    In addition, you will also be able to include anything else you want on the SD card in this zip file, provided you try to keep the zip file under about 10MiB. I recommend including your boot9strap payloads, such as GodMode9 and Ntrboot_Flasher in the typical luma chainloader path as well, but this is all up to you.

    Once you've decided on the files, zip them up with your favorite archiver, generally Deflate at Ultra compression is a good way to compress it. Once you have it, name it archive.zip and copy it into data folder inside the zip3dsfx folder you cloned in Part 1.

    Next, pull up a terminal or command prompt and do "make sfx_hard" in the zip3dsfx folder, to build the software, and it should be dumped into the /build/ folder as Homebrew.3dsx. You're gonna want to rename this to boot.3dsx and 7z it, and upload it to your webserver.

    Part 3: Creating the VRAM image
    So, the next step leads right out of the one from Part 2, you should now have a url for the 7z file (containing the zip3dsfx you compiled, named boot.3dsx) you uploaded to your webserver. Now you need to copy it and open the config.json you downloaded earlier. You're going to need to paste it in the URL field over the placeholder I stuck there. Simple enough. Save the file and we'll get on with things.

    The next step is to gather the 5 necessary files for the embedded vram you need to put together to go with the godmode9 script. Go ahead and make a folder, called whatever you want (for example, vram-content would work) and drop the following 3 files in here.
    • boot.firm (from the Luma 3DS stable download)
    • boot9strap.firm (from the latest regular boot9strap download)
    • config.json (from a moment ago)
    The next two are a bit more involved. You next need to provide a copy of MultiUpdater 3.2.1 named as boot.3dsx, so go ahead and grab that from the file I had you download earlier and place it in here.

    The next one is a bit more annoying to get- you're going to want to set up Luma 3DS on your hacked 3DS system with settings you want to be the default for the target 3DS system, and copy the config.bin from that systems SD card (in the luma folder) to your computer. For most people this means setting download play as the Rosalina Homebrew Launcher title, and maybe toggling a couple of the regular settings in the Luma 3DS configuration if you please.

    So, with that last file, that makes 5. Once again, that's:
    • boot.3dsx
    • boot.firm
    • boot9strap.firm
    • config.json
    • config.bin
    With all 5 of these file in your folder, go ahead into your command prompt or terminal again and navigate it into the folder above the one containing your files. You're now going to run a command that will build a romfs containing those 5 files. In order to run this command, you need to have 3dstool either in the current location or in the system path. (As mentioned in the prerequisites.)

    The command you'll run to build it will be something like this:
    3dstool -c -t romfs -f vram0.img --romfs-dir vram-content
    with vram-content being the name of the folder you created to contain the above 5 files. If you did everything correctly, it should spit out a file called vram0.img, and it should be about 490 to 500KiB or so. If it's much larger or smaller you messed up somehow probably.

    Once you have this file, it's time to move on to...

    Part 4: Building a customized GodMode9
    This part is the most integral thing, building the firm you will be flashing to your flashcart.
    GodMode9 offers several options for ways to customize your build of the software. Today we will be taking advantage of three major functions.
    1. Including an aeskeydb.
    2. Including an autorun script.
    3. Including a vram image.
    By combining of these functions together we can perform actions with the script with the files in the vram image. So let's go through this one by one.

    You need to find the perfect aeskeydb online somewhere. Google it. The MD5 hash of the file you are trying to find is A5B28945A7C051D7A0CD18AF0E580D1B. Good Luck, it's not too hard to get your hands on. Once you have it, copy it and paste it in the data folder, inside of the GodMode9 folder you cloned way back in Part 1.

    Next, you need the autorun script. I provided you with one way back in Part 1 as well, this script is pretty easy to figure out if you want to have a look. GM9 is very similar to shell script or bash script, so it's not too hard to learn, especially if you are already experienced with scripting. I also commented very liberally, which definitely helps. :P

    There's actually an option you can enable in the script to perform a NAND backup and sha256 filedump automatically before performing the install of boot9strap. You may enable it by removing the comment symbol (#) from the line it is on if you wish. (I leave this disabled by default as it greatly slows down the process, since making a NAND backup takes a considerable amount of time)

    Once you're done tweaking the script to your liking (or not touching it at all, which is fine too) go ahead and copy it to the data folder, inside the cloned GodMode9 folder.

    Lastly, you have your vram image, which you generated in Part 3 above, go ahead and copy this vram0.img into the data folder as well.

    Once all three files are present, you may return up a directory to the GodMode9 folder and open your terminal or command prompt and navigate it to this location. In order to build this firm, you will of course, need firmtool, which is installed with python. These were listed in the prerequisites section. You may also need to update firmtool if you already had it, as- at the time of writing, it was just updated only 5 days ago.

    You will want to run the following command to build GodMode9.
    "make ntrboot" Once it's done running, you should be able to open the /output/ folder and find a handful of files, including two rather important ones.

    Part 5: Flashing the Firm
    The two important files here are
    • GodMode9_ntr.firm
    • GodMode9_ntr.firm.sha
    GodMode9_ntr.firm specifically should be about 920KiB to 1MiB in size roughly, which about what you want.

    These two files you must rename as "boot9strap_ntr.firm" and "boot9strap_ntr.firm.sha" and place upon the SD card of your 3DS in the ntrboot folder. This will allow you to flash them to suitable flashcarts using ntrboot_flasher.

    From here, it's a simple matter of launching ntrboot_flasher, making sure your flashcart is backed up, and flashing ntrboot to the flashcart. It's worth noting that this payload will not work in the event that the flashcart is unable to actually fit the payload on it.

    Some supported flashcarts for this have absurdly limited storage space, such as the TTDS line- which typically has only about 64KiB of flashable storage. Unfortunately, if you flashcart is unsupported due to not having enough space for the firm, there's not much you can do.

    I can confirm personally that this works fine with the Acekard2i and R4i Gold 3DS RTS, the latter of which was shown in the demo I did at the start of the thread.

    Part 6: The fruits of your labors
    If you did everything right, this flashcart will hack any 3DS you want in only a few minutes. Here's how you use it.
    1. Insert the flashcart in the 3ds you want to hack.
    2. Place the magnet on the sleep switch spot or switch sleep mode on.
    3. Hold X+Start+Select+Power until the console boots into the script.
    4. Input the necessary button inputs to allow firm writing.
    5. Wait for the console to reboot.
    6. You should be rebooted into the 3DS's Home Menu. Verify the console is online. (If it is not, go connect it to the internet)
    7. Open the application you configured Rosalina to open Homebrew Launcher as.
    8. Press A to download the file and extract you uploaded to the internet.
    9. Press Start to exit the downloader and run the zip3dsfx you made, extracting the files to the SD card.
    10. Once it's finished extracting, press any button to exit the zip3dsfx to exit into what is now the Homebrew Launcher, fully stocked with whatever homebrew you included.
    The entire process can take about 2 minutes, maybe an extra 5 minutes longer if you decided to have the script automatically perform a NAND backup before hacking the console initially.

    Afterword and FAQ:
    This thread/guide is provided as is with no guarantee for support and no guarantee that this will even work. (though it probably does for the most part.) Here's some cool people I'd like to thank: @AnalogMan @ihaveamac @Wolfvak @d0k3

    I will not be uploading any pre-built/compiled files and I actively discourage anyone participating in this thread from doing so. This is intended to be built and used personally, not publically distributed.

    Thanks for reading, and if this helped you or was of use to you, cool. I put in a lot of time writing this thread. :yay3ds:
     
  2. TheFIrstAv3nger

    TheFIrstAv3nger Advanced Member

    Newcomer
    69
    17
    Apr 2, 2017
    United States
    Michigan
    Thanks for this guide! Just did this with a few changes to speedrun. Using EixMode9 instead to get rid of the write protection and using Zip3DSfx as boot.3dsx, then that extracts HBL and FBI to the right paths.

    Gonna redo this with multiupdater and such for hacking friends consoles and I'll edit this and let you know how it goes!
     
    Eix likes this.
  3. CheatFreak47
    OP

    CheatFreak47 Complex Donut

    Member
    1,395
    1,007
    Oct 11, 2011
    United States
    Michigan, USA
    The main issue with embedding a Zip3DSfx instead of downloading it is that many flashcarts have extremely limited space for a firm, and the vram itself is unable to be above 3MiB anyway for various reasons.
     
    Eix likes this.
  4. TheFIrstAv3nger

    TheFIrstAv3nger Advanced Member

    Newcomer
    69
    17
    Apr 2, 2017
    United States
    Michigan
    True. Mine just has FBI and HBL. So my .firm that I flash to my R4i is 1.34mb, which is almost pushing it.
     
  5. thisisallowed

    thisisallowed 中国御宅族

    Member
    587
    132
    Oct 8, 2015
    China
    Jinan, Shandong
    For some reason my 3DSs does not want to boot from the ntrboot card, but GM9 boots the firmware perferctly. Size of firm is just above 1mb, r4i gold. Built new firm, gonna test it.

    — Posts automatically merged - Please don't double post! —

    Same thing, gonna restore and inject again.
     
  6. TheFIrstAv3nger

    TheFIrstAv3nger Advanced Member

    Newcomer
    69
    17
    Apr 2, 2017
    United States
    Michigan
    How much above 1mb? What firm is gm9 booting perfectly?
     
  7. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,039
    901
    Mar 8, 2009
    United States
    Japan
    Nice guide!

    But why even mention including ntrboot_flasher in the .zip? If you're hacking a 3ds for someone, they most likely will not have what is needed to use it themselves, or understand how to use it in the first place :unsure:. And obviously, you already have your cart flashed with it...
     
  8. TheFIrstAv3nger

    TheFIrstAv3nger Advanced Member

    Newcomer
    69
    17
    Apr 2, 2017
    United States
    Michigan
    Pretty sure he was just using that as an example. But regardless just because you're doing it for someone else doesn't mean they can't or won't ever use it.
     
  9. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,039
    901
    Mar 8, 2009
    United States
    Japan
    It means they can't (because they don't own a compatible flash cart) or they shouldn't even try (if they had a flash cart, but needed you to do everything for them, do you really think they should be trying this with someone else's system?). If they went out of their way to get a good flash cart and wanted to do this for other people they can easily find all of the files and understand the tutorials, if it's something they should be trying in the first place. Until that time, it's a waste of space.
     
    Last edited by urherenow, Oct 20, 2017
  10. thisisallowed

    thisisallowed 中国御宅族

    Member
    587
    132
    Oct 8, 2015
    China
    Jinan, Shandong
    nvm my firmtool was outdated.
     
    CheatFreak47 likes this.
  11. TheFIrstAv3nger

    TheFIrstAv3nger Advanced Member

    Newcomer
    69
    17
    Apr 2, 2017
    United States
    Michigan
    Well then don't add it to your zip :)
    Simple as that, as you don't know anyone elses but your own situation. And you know what they say about assuming things.
    That whopping 205kb firm file isn't barely taking any space. And this isn't just for other peoples consoles, could just be for your personal use. I can see what you're saying to an extent but we all started somewhere, and including a thing like this isnt gonna enable them to go mess up anyone else's console.
     
  12. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,039
    901
    Mar 8, 2009
    United States
    Japan
    last I'll comment (because I do think it's a good guide), but again, if it's for your own personal use you don't need the darn thing because you've already flashed your card!
     
  13. TheFIrstAv3nger

    TheFIrstAv3nger Advanced Member

    Newcomer
    69
    17
    Apr 2, 2017
    United States
    Michigan
    What if you wanna flash a new firm or update? What if you get a new cart? What if you brick your cart or 3ds? Better to be safe than sorry.
     
  14. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,039
    901
    Mar 8, 2009
    United States
    Japan
    You already have it on your PC, your 3/2DS, and still have no reason to include it in a package that's intended to get installed into a non-hacked system. *snip*

    P.S. If you need to update b9s, it STILL has nothing to do with the ntrboot_flasher. B9S goes in the boot9strap folder. And this method doesn't even allow updating without rebuilding stuff anyway. If you get a new cart? And you want to flash it with ntrboot as well? Guess what? IT'S ALREADY ON YOUR 3DS. STILL no need to include it in this package.
     
    Last edited by TwinRetro, Oct 21, 2017 - Reason: Tone down the venom. Keep it civil.
  15. jimmyj
    This message by jimmyj has been removed from public view by porkiewpyne, Oct 21, 2017.
    Oct 21, 2017
  16. TheFIrstAv3nger
    This message by TheFIrstAv3nger has been removed from public view by TwinRetro, Oct 21, 2017, Reason: Chill out..
    Oct 21, 2017
  17. Eliot15

    Eliot15 Member

    Newcomer
    13
    0
    Feb 26, 2017
    Where is the download link of devkitpro?
     
  18. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,039
    901
    Mar 8, 2009
    United States
    Japan
    Really? How about here?
     
  19. thisisallowed

    thisisallowed 中国御宅族

    Member
    587
    132
    Oct 8, 2015
    China
    Jinan, Shandong
    devkitarm is on the AUR. So if you have Arch linux you can just download it. pakage name is devkitarm
     
  20. CheatFreak47
    OP

    CheatFreak47 Complex Donut

    Member
    1,395
    1,007
    Oct 11, 2011
    United States
    Michigan, USA
    If you have to ask, this thread isn't for you.
    Feel free to try anyway but that's on you.
     
    Gamer4Ever likes this.
  21. squall14716

    squall14716 GBAtemp Maniac

    Member
    1,209
    698
    May 16, 2011
    United States
    Thanks for putting this together and sharing your scripts/config. I have flashed this setup to my Acekard now.

    Weirdly though, I don't think the GodMode9 on the flashcart is able to actually copy files to my main 3DS's SD card. The script fails the first time it tries to use the SD card. It works perfectly on one of my other 3DSes, so it seems like a weird quirk/bug in GodMode9.

    Edit: My issue was just a recent bug with GodMode9: https://github.com/d0k3/GodMode9/issues/262
     
    Last edited by squall14716, Nov 11, 2017
    CheatFreak47 likes this.