[GM9][Script]All-in-One Megascript

Discussion in '3DS - Homebrew Development and Emulators' started by annson24, Feb 14, 2018.

  1. annson24
    OP

    annson24 GBAtemp Advanced Fan

    Member
    605
    229
    May 5, 2016
    First of all huge thanks to the following people for making this possible:
    windows_server_2003
    SvenDaHacker64
    MyLegGuy
    AnalogMan
    emillois
    8bitwonder - I referenced most of the options from his megathread, check it out here.
    d0k3 - for pretty much everything.


    Disclaimer!
    This script is based on 689f6f7 commit of GodMode9, but latest stable release should work just the same.
    The script is only half tested. I've only tested the functions I commonly use (i.e Nand Backup/Restore, CFW Install/Uninstall, Cart Dump, Boot9 and Boot11 Dump, OTP Dump).
    Always have a backup in case something goes wrong. I will not be held responsible for bricked devices, dead sd cards, thermonuclear war, or you getting fired because you were up all night tweaking.



    What does it do?
    It's an all-in-one script consisting of almost all available gm9 scripts I can find.


    To-do:
    1. Complete the automated FBI to H&S Injection in the PCless B9S Installation. (Only currently working on New & Old US & EU Region)(Help Needed)
    2. Figure out and add a ctrtransfer option.


    Requests, suggestions, and bug reports are highly appreciated.


    Summary of Options:

    1. Backup Options

    1.1 NAND Backup
    1.1.1 SysNAND Backup
    1.1.2 EmuNAND Backup
    1.2 FriendSave Backup
    1.3 LocalFriendCodeSeed_B Backup
    1.4 GBAVC.sav Backup
    2. Restore Options
    2.1 NAND Restore
    2.1.1 SysNAND (full) Backup
    2.1.2 SysNAND (safe) Backup
    2.1.3 EmuNAND Restore
    2.2 FriendSave Restore
    2.3 LocalFriendCodeSeed_B Restore
    2.4 GBAVC.sav Restore

    3. Hax Options

    3.1 Install Boot9strap
    3.1.1 Normal Install
    3.1.2 PC-Less Install
    3.2 Uninstall Hax
    4. Dump Options
    4.1 Cartridge Dump Options
    4.1.1 Dump Private Header
    4.1.2 Dump Cart to .3ds
    4.1.2 Dump Cart to .cia
    4.1.2 Dump Cart to .nds
    4.2 Title Dump Options​

    4.2.1 CTRNAND Titles
    4.2.2 User Installed Titles​

    4.2.3 TWLNAND Titles
    4.3 Dump Boot9.bin & Boot11.bin
    4.4 Dump OTP.bin
    4.5 Dump Citra Files
    4.6 Dump HomeMenu to .cia

    5. Miscellaneous

    5.1 .3ds to .cia Converter
    5.2 Nintendo3DS Folder Swap
    5.3 Setup Luma3DS to CTRNAND
    5.4 Lazarus3DS Options

    6. Reboot

    7. Shutdown


    8. Quit

    PS. You might notice some personal references especially in the PC-less B9S Installation since that was initially just a personal script. You can edit them out if you want, I've removed most of 'em but I'm too lazy to edit them all out myself.

    DOWNLOAD HERE: https://github.com/annson24/GM9Megascript
     
    Last edited by annson24, Feb 17, 2018 at 7:25 PM
    Disco, KanterZ, emuashui and 14 others like this.
  2. annson24
    OP

    annson24 GBAtemp Advanced Fan

    Member
    605
    229
    May 5, 2016
    Instructions:

    For normal gm9 usage:

    1. Download the "AIO Megascript.gm9"
    2. Move or copy it to sdmc\gm9\scripts
    3. Run godmode9 on your 3ds and press the home button.
    4. Select "scripts," and select the AIO Megascript.

    For use with PCLess b9s install:

    1. Download the "AIO Megascript.gm9"
    2. Move or copy it to sdmc\gm9\scripts
    3. Download the "18.02.14 PCLessB9SPack.7z" and open it.
    4. Inside the archive, find and extract the "annson24" folder to the root of your sdmc.
    5. Use NTRBoot to run godmode9.
    6. Press the home button, select "scripts," and select AIO Megascript.
    7. Choose "InstallBoot9Strap" option and select "PCLessInstall"



    What is PC-Less Boot9strap?

    Here's a brief explanation on what it does.

    1. First, it checks the system if sector0x96 is genuine (usually the check will fail if a9lh is installed in the system).

    If the check fails, the script will prompt the user if they want to attempt to fix it. Fixing it, the user should have the secret_sector.bin file inside sdmc/annson24/boot9strap folder.

    2. Once confirmed that sector0x96 is genuine, it'll then check if the required files are present in the sdmc/annson24 folder.

    Here's the branches of the folder that it checks.

    SDMC
    annson24
    boot9strap
    boot9strap.firm
    boot9strap.firm.sha​
    Luma3DS
    sdcompiled​

    3. If everything is in check, it'll then backup your boot9.bin and boot11.bin.

    4. After that, the user will be ask if they want FBI to be injected to H&S; If chosen 'yes,' the script will automatically inject FBI to H&S; if chosen 'no,' the script will continue without FBI injection.

    5. The script will now install boot9strap.

    6. Now that boot9strap is installed, it'll set up Luma3DS to your CTRNAND.

    7. now within the annson24 folder, there is another folder named 'sdcompiled' inside this are all the necessary files we need to have on our sd card after we install boot9strap. Think of this as the finalization proccess on plailect's guide. But since this is a 'PCless' installation, this is done purely on the 3ds.

    7.1 the script will copy all the files from 'sdcompiled' folder to the RAM of the 3DS, then it'll prompt the user to swap the sd card to whichever sd card the user wants to use. Once sd cards are swapped, the script will then move the files from the RAM to the newly inserted sdcard.

    And that's it.
     
    Last edited by annson24, Feb 16, 2018 at 6:04 AM
    Disco, emuashui and DarthDub like this.
  3. ThisIsDaAccount

    ThisIsDaAccount GBAtemp Maniac

    Member
    1,009
    583
    Apr 8, 2016
    United States
    This seems worth the risk of thermonuclear war. Good job!
     
  4. LucaDark

    LucaDark Member

    Newcomer
    GBAtemp Patron
    LucaDark is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    19
    11
    Dec 14, 2016
    Italy
    Afar
    Good job!
     
  5. MattKimura

    MattKimura 3DS & WiiU Enthusiast

    Member
    1,886
    1,000
    Jun 30, 2014
    United States
    Whoa you can install boot9strap with Godmode9? Guess I saw someone doing that in a speedrun but didn't realize it. What would be suggested, Safeb9sinstaller or godmode9?
    This has major potential to become the only script we'd ever need! Really looking forward to this.
     
    Last edited by MattKimura, Feb 14, 2018
    annson24 likes this.
  6. annson24
    OP

    annson24 GBAtemp Advanced Fan

    Member
    605
    229
    May 5, 2016
    Assuming you know what you're doing, safeb9sinstaller is no more safer than gm9.

    Regarding the PC-less b9s installation, here's a 'brief' explanation on what it does.

    1. First, it checks the system if a9lh is currently installed. As far as I can recall, if we were to install b9s to a a9lh 3ds, we would need the secret sector file first. What I just did is to abort the operation and instruct the user to uninstall the cfw first before re-running pcless installation.

    2. Once confirmed that a9lh is not installed, it'll then check if the required files are present in the sdmc/annson24 folder.

    Here's the branches of the folder that it checks.

    SDMC
    annson24
    boot9strap
    boot9strap.firm
    boot9strap.firm.sha​
    Luma3DS
    sdcompiled​

    3. If everything is in check, it'll then backup your boot9.bin and boot11.bin.

    4. After that, you will be ask if you want FBI to be injected to H&S; If chosen 'yes,' the script will automatically inject FBI to H&S; if chosen 'no,' the script will continue without FBI injection.

    5. The script will now install boot9strap.

    6. Now that boot9strap is installed, it'll now copy Luma3DS to your CTRNAND.

    7. now within the annson24 folder, there is another folder named 'sdcompiled' inside this are all the necessary files we need to have on our sd card after we install boot9strap. Think of this as the finalization proccess on plailect's guide. But since this is a 'PCless' installation, this is done purely on the 3ds.

    7.1 the script will copy all the files from 'sdcompiled' folder to the RAM of the 3DS, then it'll prompt the user to swap the sd card to whichever sd card the user wants to use. Once sd cards are swapped, the script will then move the files from the RAM to the newly inserted sdcard.

    And that's it. So much for my 'brief' explanation huh?
     
    MattKimura likes this.
  7. MattKimura

    MattKimura 3DS & WiiU Enthusiast

    Member
    1,886
    1,000
    Jun 30, 2014
    United States
    After reading your post for a while and planning things out, I've settled for the PC-less installation by adding it to my own 3DS SD card. This way I can essentially hack any 3DS I want while on the go. My 3DS is equipped with a ntrboot capable flashcard at all times, and a magnet is in my pouch. All I have to do is swap boot.firm with gm9, put it in the person's 3DS and do ntrboot and run your script. I've done some slight modification to the files such as removing pretty much everything in the 3DS folder, and adding some of my personal recommended cia's (Just a few not much)(Also lumaupdater is about to become obsolete on the 22nd of Feb).
    I realized that the pc-less installation will only ever be good enough when helping someone in real life rather than over the internet. This will be a fun way of hacking a 3DS quick and in public like at a school library or something. Overall it only takes up 16 MB on my own SD card and its always there for me ready to hack another 3DS with ease. I often dont meet someone with a 3DS but it would be cool for a moment like that. I also came into realization that the godmode9 boot9strap installation is only ever useful when doing the ntrboot method, not the soundhax or Dsiwarehax methods.
    At first I questioned your use of FBI injection since we dont use that anymore. But then I realized just how much faster it would be to get in and get out, shaving off some steps to get some cia's and FBI installed. Yeah I added FBI.cia to the cia folder. Just OCD reasons, I know one could just use FBI from H&S.

    Thanks a lot for the thorough explanation, I've always wanted to know more about how this works. It's little innovations like these that make a difference in the scene.
    First the wiiu gets an all in one app, now the 3DS gets an all in one GM9 script.
     
    Last edited by MattKimura, Feb 14, 2018
  8. annson24
    OP

    annson24 GBAtemp Advanced Fan

    Member
    605
    229
    May 5, 2016
    If you have a spare card, you could just put the compiled pack there so that you wouldn't have to use your personal sd card. Honestly speaking, I also keep one set of ntrboot tools (cart, magnet, and the 'setup' sd card) on each of my three bags; and the only time I use em is when I see a friend or a new colleague using a 3DS and I'll be like "Hey, want me to install CFW to your 3ds?" and when they agree, it's like <5mins and it's done. It's really fun to see their reactions after.

    The FBI injection part is, I know, obsolete now with rosalina around, but having FBI as a system app is much more convenient for those who isn't knowledgeable enough. Before, I would always get a call from some of my friends that their sd card got corrupted or took a virus in and all the files was deleted. So I would, again, set up their sd card just so that they can use FBI. Because of that, I went back to injecting FBI to H&S rather than using rosalina to redirect.

    My personal 'setup sd card' has different files than the one I attached here. But I tried to keep the files of the one attached here to be as close to plailect's guide as possible.
     
    MattKimura likes this.
  9. 8BitWonder

    8BitWonder Small Homebrew Dev

    Member
    1,016
    847
    Jan 23, 2016
    United States
    47 4F 54 20 45 45 4D
    Good work on this!

    But just as a friendly heads up, the gbavc.sav backup and restore scripts from my megathread don't work on gm9 1.4.2 and up.
    Something to do with a name change I believe, and I never got around to fixing them.
     
    Last edited by 8BitWonder, Feb 14, 2018
    MattKimura and annson24 like this.
  10. annson24
    OP

    annson24 GBAtemp Advanced Fan

    Member
    605
    229
    May 5, 2016
    Thanks for the heads up, will also look into it. And again, thank you for your scripts. More than half of the options from this came from your scripts.
     
    8BitWonder likes this.
  11. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    13,123
    5,883
    Mar 17, 2010
    Norway
    Alola
    That is pretty nice, it turns GodMode9 into a proper replacement for Decrypt9.
    Could I request nnidsave.bin and SecureInfo_A/SecureInfo_C/movable.sed (SecureInfo_C is simply an alternate file supported by Luma so as to not touch the original, not 100% sure if it's still supported though) backup/restore?
    nnidsave.bin is useful for removing the NNID from a console by injecting a blank one, or possibly for having multiple NNIDs and switching between them (might allow using eShop for different countries in the same region?)
    SecureInfo is mostly for region changing and unbanning.
    movable.sed is useful for de/encrypting SD card data on a PC, or for using things such as the 0-key movable.sed.

    Also, the ability to dump ticket.db (and encTitleKeys/decTitleKeys if possible) would be useful, the former is for tools like FunkyCIA2 and the latter has a similar purpose but also makes it easy to submit keys to the title key site.

    And one last request. The NAND backup scripts made with GM9 create a so-called Essentials backup. I don't know if the NAND backup in your script also does that, but either way it would be nice to have a separate option for making just the Essentials backup. I guess GM9 nags you to do this so there wouldn't be much point in adding it to the script. I thought it was actually the NAND backup script that made it but it seems I was wrong.
     
    Last edited by The Real Jdbye, Feb 14, 2018
    annson24 likes this.
  12. annson24
    OP

    annson24 GBAtemp Advanced Fan

    Member
    605
    229
    May 5, 2016
    Great idea. Thanks! Will consider adding those if possible. Regarding the nand backup, the option was directly referenced from d0k3's script, if that's what you're asking. Both of them only makes a min. size backup.
     
  13. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    13,123
    5,883
    Mar 17, 2010
    Norway
    Alola
    It seems like I was wrong about the Essentials backup, I edited my post after you started replying to it. Looks like it's something GM9 nags you to do and not something actually part of a script.
     
  14. MattKimura

    MattKimura 3DS & WiiU Enthusiast

    Member
    1,886
    1,000
    Jun 30, 2014
    United States
    @annson24 Two ideas for scripts, the "Setup ctrnand luma" script, and the "Clean Setup Files" script. Just suggestions though, I don't care if they make it on the list or not haha. Forgot to add this to my other post.
     
    annson24 likes this.
  15. Zerius

    Zerius Advanced Member

    Newcomer
    82
    24
    Jul 17, 2017
    United Kingdom
    New Donk City
    Wait a minute
    You can uninstall CFW?
    I didn't know that was possible
     
  16. Leafgreen26

    Leafgreen26 GBAtemp Regular

    Member
    108
    28
    Jul 17, 2017
    United States
    You can already do this in GodMode9. If you press the home button and press create support files, these files will be dumped in your /gm9/out folder.

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

    There are no releases on the github page.

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

    On Github, how do you download from the latest commit?
     
  17. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    13,123
    5,883
    Mar 17, 2010
    Norway
    Alola
    You can already do all of this with GodMode9. The point is to have it all in one place and not spread across 20 different menus with confusing names where you aren't sure which one is the right one.
    Though I wasn't aware there was an easier way to do it than going to the right path in CTRNAND and copy+pasting the file to the SD (or vice versa), I guess that's nice.

    Edit: The .gm9 script is on the page he linked to, just scroll down a bit if you don't see it.
     
    Last edited by The Real Jdbye, Feb 14, 2018
  18. Agent Moose

    Agent Moose GBAtemp Fan

    Member
    364
    107
    Dec 6, 2014
    United States
    This is awesome! I wouldn't use half the features, but still helpful none-the-less!

    I do have two questions:
    1. I've never heard of "Nintendo3DS Folder Swap" It's obvious what it would do, but why would someone want to do this?
    2. What's the difference between "Sysnand Restore (Full)" and "(Safe)"?
     
  19. 8BitWonder

    8BitWonder Small Homebrew Dev

    Member
    1,016
    847
    Jan 23, 2016
    United States
    47 4F 54 20 45 45 4D
    The point of swapping the folders is so that you can install 300 titles on one "3DS Folder" and then swap with another "3DS Folder" and install more there. It's basically a janky way of installing more than 300 titles on one SD card.

    This would of course, require you to switch between folders frequently if you use titles from both folders often, so it's kind of a silly solution.
     
    Last edited by 8BitWonder, Feb 14, 2018
    Agent Moose likes this.
  20. SirNapkin1334

    SirNapkin1334 Renound Aritst

    Member
    990
    371
    Aug 20, 2017
    United States
    Crap Mountain
    You should add HomeMenu Injection, like EixMode9.

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

    Safe will protect your sighax/A9LH installation, so if you restore a backup without it, you will keep it, and full will overwrite everything, so if you were to use the aforementioned dump with this it would overwrite your sighax/A9LH.
     
    Agent Moose likes this.