Official [Release] GodMode9 - All Access File Browser for the 3DS

Discussion in '3DS - Homebrew Development and Emulators' started by d0k3, Mar 22, 2016.

  1. Kazuma77

    Kazuma77 GBAtemp Advanced Fan

    Member
    833
    341
    May 11, 2008
    United States
    @d0k3 you have really outdone yourself this time. I am loving the new chainloading capabilities, especially useful with this new exploit. Not that the RTC feature isn't handy so I can tell when files were modified. I also thoroughly enjoyed seeing the "encrypt" and "decrypt" options added. Now I can setup a dedicated folder for removing seed encryption from CIAs by decrypting and re-encrypting them with a script. It might be nice if there was a "log" command, so I could see which ones actually had seed encryption, though.

    I think a "run" command would go well with this new chainloading feature. That or a configurable menu for the chainloader. I'm working on a drag-and-drop method for NTRBootHax that only requires one trip to the PC. The basic concept is already complete. Use GM9 to chainload Safe B9S Installer instead of running it directly. Then use a script to copy "boot.firm.bak" (a backup copy I'll be including with my configurations in the next version of my AIO pack) to "boot.firm" and delete the temporary installation files. It would be convenient if I could have Safe B9S Installer launch from a menu instead of having to tell people to find it on the SD card and launch it. It will still work as is, it's just that it would look more polished that way.

    Though a "run" command has other possibilities as well. Renaming external firmware files for CFWs that still require them, for example. You could have a script copy "firmware90.bin" to "firmware.bin" right before launching Cakes or Corbenik/Skeith with a 9.2 EmuNAND, and have another copy "firmware114.bin" to "firmware.bin" so you could easily switch to running it with your updated SysNAND.

    Thanks again for all you do for the scene.

    It actually already has some backwards compatibility. It can run some converted payloads (using the "-e 0" command from firmtool's readme file). Gateway and EmuNAND9 work just fine. Though Puma and Salt do not (then again, even BootCTR9 doesn't run Salt). So, if you've got an old A9LH payload you're wanting to run, convert it and see what happens. It very well may run.

    The key words there are "source code" though. And you're better off building from the source now if you want an A9LH version. He's added a new feature where you can build the keys in. No more need for aeskeydb.bin as an external file on A9LH systems. But of course, he's not going to provide the key file (at least not on Github ;) ). So, you'll either have to build it yourself, or wait for an unintended update to an AIO pack that was supposed to be final.

    Nice. Actually, I am already using GM9 as my default payload with this exploit because Safe B9S Installer is a dead end. GM9 can chainload the installer, then run a script that copies your chainloader of choice to "boot.firm" once it's installed. Technically this is even better, because you can have the desired chainloader in place right from the start. Though of course, as you've already mentioned, there are many things you could do without even installing a permanent exploit.
     
    Last edited by Kazuma77, Aug 13, 2017
    julialy and Ryccardo like this.


  2. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,593
    2,610
    Dec 3, 2004
    Gambia, The
    And, thanks to you, too! Useful feedback is always appreciated.

    A 'run' or 'boot' command will be added and I'll also add a menu for quick booting of payloads.

    Now, the A9LH compatibility. Yeah, I'll be honest, it wasn't planned to ditch it that fast, but, right now, it will not work. Don't worry though, I have something in the works that will cover this (and more) and that will be released very soon.
     
  3. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,593
    2,610
    Dec 3, 2004
    Gambia, The
    Alright, didn't expect "very soon" to be this soon :).

    Here's a little something that will, again, allow to run GodMode9 from any entrypoint. Big thanks go to @Wolfvak for making OldLoader possible (seriously, thank him, not me). Make sure you read the release notes. Also note that I still recommend updating to B9S and running from there.
     
  4. lomejor18

    lomejor18 Member

    Newcomer
    41
    2
    Sep 12, 2009
    United States
    hey guys, i have this situation...

    2 chinese flashcarts, one working normally and another broken for messing with YSmenu...
    using godmode with the working flashcart, i see 2 NDS files on it and i copied those files on the SD card...
    using godmode with the broken flashcart shows nothing, it's empty... i tried to copy the NDS files from the working flascart and godmode says "not allowed in virtual path"...

    is there any way i can copy those files on the broken flashcart?
     
  5. Kazuma77

    Kazuma77 GBAtemp Advanced Fan

    Member
    833
    341
    May 11, 2008
    United States
    Just tested it from an A9LH device. It works. I was also able to chainload the latest Skeith build with it. A significant find, since the last working .bin was released on May the 3rd. As you would expect, Luma does not work. Also, the payload name is visible in a hex editor. So we can theoretically have a copy for each working payload we find (of course, patching the payload name with CBM9 is also a possibility). Oh, right, the path is at the top of main.c as well, so if you can compile the source, it's easy to make a separate copy per payload.

    EDIT: Thanks for making this, @Wolfvak. I just have one question. Does the .3dsx version provide it's own access elevation, or does it have to be used with something like Safehax? If it does it's own then that would simplify guides (because this could simply be "boot.3dsx" for installation purposes -- a post-install script could easily replace it with the HB menu after B9S is installed).

    EDIT2: I just saw the "Payloads" menu in the commits and decided to build it and try it. Very nice. I especially like how that and the "Scripts" menu are on the first page of the home menu now. I can see GM9 becoming the centerpiece for all future guides and tutorials. My "new system" configuration works great now. I copy one of my pre-made configurations over to the SD card, then copy that over and it's all ready to go. I can backup SysNAND, run Safe B9S Installer, reboot, run my post-install script, and the system boots with BootCTR9 (or CBM9 or Luma) as the chainloader (and all the temporary files are already deleted). Perfect! I almost feel sorry for the next person that watches me setup their 3DS. Because this will make their head spin. Thanks again, @d0k3. Now, all that's left is to do a *hax variant of this setup configuration and it will be ready to release (hopefully). Not that I'm trying to compete with the guide. Just seeing how much of it I can automate.

    EDIT3: Please tell me "installfirm" and "extractfirm" are going to be script commands soon. Then we can have a single script install B9S (or even A9LH), copy Luma to CTRNAND, and delete all the temporary files. Also, can we get that safe restore option as a command? I thing a "Transfer EmuNAND to SysNAND.gm9" might help avoid errors. Actually, nvm, figured that one out. Backup the firm partitions and secret sector, then just restore them afterward.
     
    Last edited by Kazuma77, Aug 20, 2017
    CrimsonMaple and d0k3 like this.
  6. windows_server_2003

    windows_server_2003 Member

    Newcomer
    17
    2
    Jul 13, 2017
    Japan
    Why do we have to keep secret about the URL of the aeskeydb.bin?
     
    GilgameshArcher likes this.
  7. Asia81

    Asia81 In my Ecchi World <3

    Member
    4,950
    2,434
    Nov 15, 2014
    France
    Albi
  8. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,593
    2,610
    Dec 3, 2004
    Gambia, The
    GM9 with top and bottom screens switched. If you like it better that way.

    I missed your edits earlier. Yes, this is based on my Brahma Loader and already contains the access elevation. The 3DSX does only work on 9.0...9.2 (afaik), though.

    And thanks for trying this cutting edge stuff :). You can actually already automate more, see below.

    You don't need these commands. Installing a FIRM is simply copying it to S:/firm0.bin / S:/firm1.bin. I strongly recommend not forgetting safety when scripting this (sha checks / verification of FIRM, maybe sha check of sector0x96.bin). Extracting stuff from a FIRM works via mounting it, then copy what you need. If you meant doing a backup of the FIRM0, then just copy it out of S:/firm0.bin / S:/firm1.bin. And, the safe restore - I'd go about this differently. Mount the backup image, then copy I:/ctrnand_full.bin, I:/twln.bin, I:/twpl.bin to their respective locations on the SD card, done. It's the same as a safe restore (won't work if the current NCSD has a different partitioning than the current, but when is that ever the case?).
     
    GilgameshArcher and Asia81 like this.
  9. urherenow

    urherenow GBAtemp Addict

    Member
    2,915
    845
    Mar 8, 2009
    United States
    Japan
    So the owners of this site can't be held liable. Keys are copyrighted.
     
  10. Kazuma77

    Kazuma77 GBAtemp Advanced Fan

    Member
    833
    341
    May 11, 2008
    United States
    Sounds about right. OldLoader's .3dsx worked great with 9.2, but not 11.2 or 11.3. That's OK. The udsploit and safehax combo gets the .bin up and running on newer firmwares. I've actually compiled my own copies for launching Godmode9 and Skeith in A9LH so I can launch them from my preferred "b9s/payloads" folder. I named them "GodLoader" and "SkeithLoader" respectively. Anyone still using my A9LH packs should love it.

    So, you're saying that a "cp 0:/boot9strap/boot9strap.firm S:/firm0.bin" would work for installing B9S to the first partition, for example? Interesting. The "Install FIRM" feature seems to not like B9S for some reason, btw. As for the extracting thing, never mind. I was thinking of extracting a .firm file from an A9LH install that could be installed directly using that new "Install FIRM" option. Then it hit me later. A9LH uses console-specific info and could not be made a universal .firm file of anyway (then again, I guess "otp.bin" could be injected straight from M:/). Well, at least when you get that boot command added, my script that dumps OTP can run the installer at the end, reducing it to two steps. Not that I see myself getting that many requests going forward.

    I have made some use of firm backups from the S: drive. I have scripts that can switch between A9LH and B9S now. I reused your script for the A9LH one, since the Safe B9S Installer conveniently provides the backups and everything, and just added commands to move payloads around, swap configuration files, etc. so that it has something to run upon completion. But I used the decrypted copies from S: to go back to B9S successfully.

    Thanks for telling me how to do a proper safe restore. I'll be sure to put it to good use. And I'll be sure to include those checks when/if I go public with it. I have a hard mod and NTRBootHax, so worries here, but the last thing I would want is someone to brick using something I released.
     
    Last edited by Kazuma77, Aug 21, 2017
  11. Asia81

    Asia81 In my Ecchi World <3

    Member
    4,950
    2,434
    Nov 15, 2014
    France
    Albi
    Is there a thread with a list of godmode9 scripts?
     
    SaffronXL likes this.
  12. Kazuma77

    Kazuma77 GBAtemp Advanced Fan

    Member
    833
    341
    May 11, 2008
    United States
    Considering they're like bash scripts for the 3DS, that seems unlikely. But if you wait for my next AIO release, it's going to do most of what is possible with them :D
     
    d0k3 likes this.
  13. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,593
    2,610
    Dec 3, 2004
    Gambia, The
    Make sure you don't forget about sector0x96 when actually doing an A9LH install. Also, re installing FIRMs by just copying - in that case you need to make absolutely sure you've got the correct sighax sig, otehrwise brick. Especially if you go public. I may change the sha command so it allows just checking part of a file (in that case, 0x100...0x200). Also, don't hesitate to ask if you need more functionality in scripting (additional commands, f.e.). Can't promise anything, but normally I add everything that has a plausible use case.
     
  14. AnalogMan

    AnalogMan sumoCheatMenu Dev

    Member
    1,413
    831
    Apr 20, 2007
    United States
    Got a question for you @d0k3, feel like your understanding of B9S would be able to answer his pretty easily.

    I took a copy of S:/firm0.bin from a n2DS XL and another from an o3DS XL. Their SHAs were different but when I copied the firm0.bin from the n2DS XL to S:/firm0.bin & S:/firm1.bin of the o3DS XL, it still booted.

    Question is, why were the SHAs different if the same firm file worked on both models?
     
  15. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,593
    2,610
    Dec 3, 2004
    Gambia, The
    Padding is the answer. The firm0.bin / firm1.bin files are each 4MB (on a standard NCSD partitioning), and we don't know what happens beyound the end of the actual FIRM payload. Compare these files, and you will see changes start onl later in teh file.
     
  16. AnalogMan

    AnalogMan sumoCheatMenu Dev

    Member
    1,413
    831
    Apr 20, 2007
    United States
    Gotcha, thank you!
     
  17. windows_server_2003

    windows_server_2003 Member

    Newcomer
    17
    2
    Jul 13, 2017
    Japan
    OK.
     
  18. windows_server_2003

    windows_server_2003 Member

    Newcomer
    17
    2
    Jul 13, 2017
    Japan
    @d0k3
    Would you add a WARNING message when trying to run "firmware.bin" as firm image? I heard it will uninstall the B9S!
    I'm sorry if it is already added.
     
  19. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,593
    2,610
    Dec 3, 2004
    Gambia, The
    Umm... that's a mysterious filename, and you already get a warning message + button sequence everytime you tr to boot a firm.
     
  20. c4388354

    c4388354 GBAtemp Regular

    Member
    101
    81
    Jan 23, 2015
    United States
    Would it be possible to add support to use the 'gateway red card' as a second 'sd card' slot so I can copy files to/from the gateway micro-sd card to/from the 3DS SD card?
    (Mainly so I can dump a NAND backup to the 'Gateway Card', then I can easily transfer the backup to my computer instead of having to take the microSD out of my New3DS-XL)

    I saw that someone managed to do it with decrypt9 with this 'gwcard' source code they wrote here: https://github.com/shinyquagsire23/gwcard
    Code:
    This repository contains source files for initializing and utilizing protocol in Gateway 3DS cartridges, and by derivation, Supercard DSTWO+ and possibly other clones.
    A few quotes from the topic: https://www.reddit.com/r/3dshacks/c...an_old_gateway_use_the_blue_card_for/d6drcjl/

    I don't really know much programming, but this feature would be really nice to have (maybe have it as a 'G' drive?)
     
    Last edited by c4388354, Aug 23, 2017