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

  • Thread starter Thread starter annson24
  • Start date Start date
  • Views Views 82,787
  • Replies Replies 118
  • Likes Likes 21
Status
Not open for further replies.
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?

Just a remark... how do you check for A9LH? If you don't already do so, it may be better to check for the sector0x96 SHA (yes, that's the one that gets modified in an A9LH install). You can also fix the sector0x96 if the SHA does not match. But, keep in mind the sector0x96 is empty on untouched O3DS consoles.
 
Last edited by d0k3,
  • Like
Reactions: annson24
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.
What if it doesn't fit in the RAM? I mean, you could potentially have a lot of stuff if you're installing a lot of stuff.

--------------------- MERGED ---------------------------

Just a remark... how do you check for A9LH? If you don't already do so, it may be better to check for the sector0x96 SHA (yes, that's the one that gets modified in an A9LH install). You can also fix the sector0x96 if the SHA does not match.
What's the SHA-256 of an unmodified sector0x96 and how does one "fix" it?
 
Just a remark... how do you check for A9LH? If you don't already do so, it may be better to check for the sector0x96 SHA (yes, that's the one that gets modified in an A9LH install). You can also fix the sector0x96 if the SHA does not match. But, keep in mind the sector0x96 is empty on untouched O3DS consoles.
Whoa, I think I got confused with the HAX command. No matter what hax is installed in the system, if gm9 was booted up with a different hax e.g ntrboot, gm9's HAX command will result with ntrboot, right? Okay, I'll fix the script. Thank you for this.

What if it doesn't fit in the RAM? I mean, you could potentially have a lot of stuff if you're installing a lot of stuff.
I wouldn't recommend using the PCless installation if you have lots of files, RAM is less than 1GB, more than enough for the essential files to fit. The goal of the PCLess b9s installer is to automate plailect's guide in one scrip. Also even if you did maximize the RAM's space, it would take forever to move the files from the RAM back to the target SD card.

What's the SHA-256 of an unmodified sector0x96 and how does one "fix" it?
If I'm not mistaken, it's 82F2730D2C2DA3F30165F987FDCCAC5CBAB24B4E5F65C981CD7BE6F438E6D9D3, the fix part I believe it's as easy as copying the secret_sector.bin to S:/sector0x96.bin since secret_sector.bin's SHA-256 is also 82F2730D2C2DA3F30165F987FDCCAC5CBAB24B4E5F65C981CD7BE6F438E6D9D3.

EDIT:
All request, I'll get back to them. First I have to fix the bugs and also reorganize and revamp the script.

EDIT2:
I can't promise fast updates as I only touch the script in the office (when nobody's looking), and it's really hard here to test it myself (I might get fired if caught, kek). I couldn't do this at home either...my wife will kill me.
 
Last edited by annson24,
Last edited by TurdPooCharger,
Script Updated

Changelog:

- Fixed some errors.
- added sector0x96 checks in b9s install and uninstall, and added an option to fix if found not genuine. Thanks @d0k3
- Revamped
- Easier to the eyes of the users.
- Sh*ttier to the eyes of the debugger.
- Added "Setup Luma3DS to CTRNAND" option.
 
Last edited by annson24,
will this dump the trimmed nand or the full nand with all the empty space?

and how new is pcless b9s? I honestly have no idea how I installed that, but I got b9s pretty early.
 
Also, adding to the scripts that need to be added, the incognito mode scripts. Can be found with a simple Google search.

--------------------- MERGED ---------------------------

Change_Nin3DS_#_Folders

Shout out and thanks goes to:
  • @d0k3 (and @Kazuma77) - for GodMode9 and the three "Hello" gm9 example scripts.
  • @8BitWonder - His Swap Nintendo 3DS Folder script found here. Our concurrent development and implementation of our scripts highlighted a HUGE deficient in mine: no ability to choose between more than two folders. I was humbled by this insight and determined in creating these script(s) that will (hopefully) fill an intermediate need gap for those who require more than two folders.
  • @annson24 - His AIO megascript found at this thread here. This wouldn't have been made possible without having known the structural options. His script is the first to clearly demonstrate the codes "@" and "MainMenu_*" with drop down listings.
  • @SirNapkin1334 - For helping me with gm9 syntax on my previous script. I derped with how to handle variables with spaces.
What are these?
Introducing the newest Nintendo 3DS folders selector scripts.
  1. Change_Nin3DS_3_Folders.gm9
  2. Change_Nin3DS_4_Folders.gm9
These are two gm9 scripts that allow you to change between either three (3) or four (4) Nintendo 3DS folders: (A) , (B) , (C) , and/or (D). These scripts can create the missing (A)-(B)-(C)-(D) folders if its the first time running them, have safety checks if you have too many or missing some folders, can track which folder is which [ex: Folder (A) is always (A) unless it's currently loaded up as Nintendo 3DS], and allows you to select whichever folder you want with the (Up/Down) D-Pad and A button in a menu list.

Why would I want to use one of these scripts?
  • You are a heavy duty 3DS user who has more than 600 titles or games.
  • Your (micro) SDXC card is massive enough that 600 titles is chump change. You have serious hoarding issues.
  • You don't like the idea of using emuNAND to expand your library due to heavy I/O wear & tear on the SD card.
  • You don't want to carry around two, three, or more cards when changing between your game collections.
  • You like to organize your games into categories and separate sets. For example:
  1. (main) library
  2. (secondary) library
  3. GBA Virtual Console
  4. SNES Virtual Console
I have more than 300 but less than 600 titles, or I only need two (2) Nintendo 3DS folders. Should I use one of these?
Absolutely not. You are better off with my previous script Switch_Nin3DS_folders, which was explicitly coded for only two folders, (A) and (B), with name tracking. This script can be found attached at post #98 here.

Wait. This is confusing. Why did you make the Create scripts if the Swap script can already handle multiple folders? WHY SO MANY OF THESE?!
Edit - In lieu of the recent Florida school shooting (Feb-14, 2018), my analogy example may not have been the wisest in trying to explain the differences of the scripts. I did not mean to be insensitive during this precarious moment. I will put my explanation in spoilers if you still intend to read what I wrote. My apologies. I live in Florida and should know better.

Just know that the scripts are different.
Okay, I'm going to use an analogy here. We are presented with three different types of guns: pistol, assault rifle, and sniper rifle. Each gun does basically the same thing where you shoot bullets usually with the intention of hitting a target.

- A pistol is great at quick draws, close quarter firing with really tight spaces, and light carry-on.
- An assault rifle is bread and butter, or workhorse, that balances attack range, rate of fire, and carry size.
- A snipe rifle can hit some of the furthest targets the scope can see with meticulous pin point accuracy.

Each type of gun has their strengths and weaknesses. Any of these can very well cause massive collateral damage, but each may be better suited for specific target(s) at a certain distance, etc.

You wouldn't try to shoot a pistol at something that's 1000 yards away, and you sure as hell wouldn't want to find yourself in a fire fight with only a single shot sniper rifle. Of course, this poor example doesn't apply for professional FPS gamers in Battlefield, Call of Duty, or whatever shooting games played these days, but hopefully you get the idea.

Without having actually described how these three types of scripts work,
Switch_Nin3DS_folders = pistol
Change_Nin3DS_X_Folders = assault rifle
Swap Nintendo 3DS Folder = sniper rifle

Try and test them all out and see which one best suits your needs.

I would like my folders named something other than (A), (B), (C), and/or (D). How do I change them?
For example with the Change_Nin3DS_4_Folders script, instead of having:
  • Nintendo 3DS (A)
  • Nintendo 3DS (B)
  • Nintendo 3DS (C)
  • Nintendo 3DS (D)
Let's say you want to instead have the folders as:
  • Nintendo 3DS (main)
  • Nintendo 3DS (secondary)
  • Nintendo 3DS (GBA VC)
  • Nintendo 3DS (SNES VC)
Open up the script with Notepad. Press Ctrl + H to pull up the program's search and "Replace" feature. Use the "Replace All" to change these:
Code:
Find what:
(A)
(B)
(C)
(D)

With these:
Code:
Replace with:
(main)
(secondary)
(GBA VC)
(SNES VC)

If you have white spaces " " within your renamed folders in the parenthesis (...), you need to do additional search and replace steps in order for them to show up in the menu.

For (GBA VC) and (SNES VC), this requires replacing:
Code:
Find what:
@Choices_Nintendo_3DS_(GBA VC)
@Choices_Nintendo_3DS_(SNES VC)

With these (see the underscore "_" where the white spaces were):
Code:
Replace with:
@Choices_Nintendo_3DS_(GBA_VC)
@Choices_Nintendo_3DS_(SNES_VC)

None of your scripts meet my criteria. I need one that handles 5 or more folders. Can you make one with X amount of folders for me?
... You're on your own, buddy. Study the subtle differences between the (3) and (4) versions of the Change scripts. If you know a bit of coding and have a good eye for detail, you can easily expand the script to handle more than 4 folders. Just know that the script will quickly get massive and become increasingly slower to run as you accommodate for more folders.

Anything else I should know when using one of these scripts?

Do not use a combination of Switch_Nin3DS_folders, Change_Nin3DS_3_Folders, and Change_Nin3DS_4_Folders scripts. You only need to have one depending how many Nintendo 3DS folders you have, or else you run into naming collusion issues when using all three or two of them. You can, however, use one of those three in tandem with @8BitWonder 's Swap Nintendo 3DS Folder as his script will not conflict with any of mine.

Both (3) and (4) versions are attached within the same RAR archive below.

You also have these to add.
 
You also have these to add.

@Leafgreen26 and @annson24 , as much I would be honored if my script(s) were added into the megascript, I can understand and be perfectly fine if they were not due to redundancy when @8BitWonder's Swap Nintendo 3DS Folder script already serves this function with much cleaner coding and universal folder naming/swapping.

Depending which of my scripts, I have to warn you that my codes are have 51, 118, and 145 lines of codes making the damn things sluggish as you go up a folder count. Also, it'll be terrible to present all three or even two of my scripts within the megascript due to the high chance of naming collusion.

If you feel there is a place and spot to add one of my scripts into yours, I only recommend the Switch_Nin3DS_folders one as it's the most simplistic. Hope you understand you don't need to include every gm9 script out there, and thanks for your understanding.
 
  • Like
Reactions: annson24
What if the user is not running from B9S? For example, fb3DS / GM9 Bootloader? Then the Dump boot9/boot11 would fail.
To fix this, @d0k3 should add more precise $[HAX] checking. It should check if it is running from B9S (should be easy, just check if the system is able to display the bootroms), GM9 bootloader (would be pretty obvious to check too), and then you can leave sighax for if it is running from something else (i.e. Luma3DS or fb3DS).
So, the new hax output would be:
"a9lh"
"ntrboot"
"b9s"
"bootloader"
"sighax"
Perhaps you could maybe add in special checks for fb3DS, though I see no reason for that.
Also, I saw that it can also ouput empty. Why would this happen?
Edit: Something completely unrelated, but for the "ask" command in scripts, we should be able to change the two option's names.
For example:
Code:
ask "Reboot or exit script?" -y "Reboot" -n "Exit"
reboot
Would replace the Yes and No with Reboot and Exit. This could sometimes be handy.
 
Last edited by SirNapkin1334,
will this dump the trimmed nand or the full nand with all the empty space?

and how new is pcless b9s? I honestly have no idea how I installed that, but I got b9s pretty early.

It's the trimmed one. The PCless b9s is explained on the 1st page. I think I'll have to add the explanation to the 2nd post so that everyone could see it.

@Kazuma77 why does your full SysNAND restore script require NTRBoot?

This ensures that you have something that can help you get back incase you brick after you do a full restore since full restore might remove your system's hax.

Anyway, thanks for this question. I just remembered decrypt9 will only warn the user of what might happen but gives the option to continue or not. I'll add that to the script.

Also, adding to the scripts that need to be added, the incognito mode scripts. Can be found with a simple Google search.

--------------------- MERGED ---------------------------



You also have these to add.



@Leafgreen26 and @annson24 , as much I would be honored if my script(s) were added into the megascript, I can understand and be perfectly fine if they were not due to redundancy when @8BitWonder's Swap Nintendo 3DS Folder script already serves this function with much cleaner coding and universal folder naming/swapping.

Depending which of my scripts, I have to warn you that my codes are have 51, 118, and 145 lines of codes making the damn things sluggish as you go up a folder count. Also, it'll be terrible to present all three or even two of my scripts within the megascript due to the high chance of naming collusion.

If you feel there is a place and spot to add one of my scripts into yours, I only recommend the Switch_Nin3DS_folders one as it's the most simplistic. Hope you understand you don't need to include every gm9 script out there, and thanks for your understanding.

Thank you. As I was reading through the comment, the swap nintendo3ds folder was the first to pop on my mind. But your sceipt also gave me an idea. I'll try to modify the swap folder script to somewhat incorporate yours to it.

Can't do it until sunday tho.

What if the user is not running from B9S? For example, fb3DS / GM9 Bootloader? Then the Dump boot9/boot11 would fail.
To fix this, @d0k3 should add more precise $[HAX] checking. It should check if it is running from B9S (should be easy, just check if the system is able to display the bootroms), GM9 bootloader (would be pretty obvious to check too), and then you can leave sighax for if it is running from something else (i.e. Luma3DS or fb3DS).
So, the new hax output would be:
"a9lh"
"ntrboot"
"b9s"
"bootloader"
"sighax"
Perhaps you could maybe add in special checks for fb3DS, though I see no reason for that.
Also, I saw that it can also ouput empty. Why would this happen?
Edit: Something completely unrelated, but for the "ask" command in scripts, we should be able to change the two option's names.
For example:
Code:
ask "Reboot or exit script?" -y "Reboot" -n "Exit"
reboot
Would replace the Yes and No with Reboot and Exit. This could sometimes be handy.

You're right. Gm9'a scripting is still isn't updated to check those new bootloaders. I'll look into that. Thanks.

Sent from my SM-G950F using Tapatalk
 
  • Like
Reactions: TurdPooCharger
It's the trimmed one. The PCless b9s is explained on the 1st page. I think I'll have to add the explanation to the 2nd post so that everyone could see it.



This ensures that you have something that can help you get back incase you brick after you do a full restore since full restore might remove your system's hax.

Anyway, thanks for this question. I just remembered decrypt9 will only warn the user of what might happen but gives the option to continue or not. I'll add that to the script.







Thank you. As I was reading through the comment, the swap nintendo3ds folder was the first to pop on my mind. But your sceipt also gave me an idea. I'll try to modify the swap folder script to somewhat incorporate yours to it.

Can't do it until sunday tho.



You're right. Gm9'a scripting is still isn't updated to check those new bootloaders. I'll look into that. Thanks.

Sent from my SM-G950F using Tapatalk
IMO instead of saying NTRBoot is required, say WARNING: AFTER RUNNING THIS SCRIPT YOU MIGHT NOT BE ABLE TO RUN CFW!!! USE WITH CAUTION!
 
What if the user is not running from B9S? For example, fb3DS / GM9 Bootloader? Then the Dump boot9/boot11 would fail.
To fix this, @d0k3 should add more precise $[HAX] checking. It should check if it is running from B9S (should be easy, just check if the system is able to display the bootroms), GM9 bootloader (would be pretty obvious to check too), and then you can leave sighax for if it is running from something else (i.e. Luma3DS or fb3DS).
So, the new hax output would be:
"a9lh"
"ntrboot"
"b9s"
"bootloader"
"sighax"
Perhaps you could maybe add in special checks for fb3DS, though I see no reason for that.
Also, I saw that it can also ouput empty. Why would this happen?
Edit: Something completely unrelated, but for the "ask" command in scripts, we should be able to change the two option's names.
For example:
Code:
ask "Reboot or exit script?" -y "Reboot" -n "Exit"
reboot
Would replace the Yes and No with Reboot and Exit. This could sometimes be handy.
It's even easier... just check if M:/boot9.bin and/or M:/boot11.bin are available.
 
Yes, but at the very least $[HAX] should check if running from the bootloader.
It does, but because there are multiple b9s compatible bootloaders now, boot9.bin and boot11.bin being available is not a given anymore, so you need this additional check.
 
  • Like
Reactions: SirNapkin1334
In case @Leafgreen26 mention of the Incognito Mode scripts were missed.

https://gbatemp.net/threads/how-to-3ds-in-incognito-mode-with-godmode9.473630/page-3#post-7566162

I had made two Godmode9 Scripts, one which creates a backup of the activity log file (00000000), and then proceeds to name it to 00000001. Essentially it is a script which does what you stated. The second script ends the incognito mode session.

EDIT: I might mess around with the script more, so needless to say I will be updating the upload.
 
Using the backup/restore localfriendseed_B part of the script results in the backup file named with an output name that is not normal when compared to guides suggesting to rename the downloaded public seed name to LocalFriendCodeSeed_B for restoration. I worked around the issue by renaming the file localfriendcodeseed_B downloaded file to the same one that was outputted by the script.
 
Using the backup/restore localfriendseed_B part of the script results in the backup file named with an output name that is not normal when compared to guides suggesting to rename the downloaded public seed name to LocalFriendCodeSeed_B for restoration. I worked around the issue by renaming the file localfriendcodeseed_B downloaded file to the same one that was outputted by the script.
Yes, this is actually intentional. The backup will generate the 3DS's Serial Number followed by "_LocalFriendCodeSeed_B_###." This is to avoid confusion if you happen to have multiple localfriendcodeseed files especially if some are already banned.

EDIT:

Script Updated!

Changelog:
- Another major cleanup.
- Added some Preview_Modes
- Fixed a few more bugs.
- Added Lazarus3DS.
 
Last edited by annson24,
@annson24
I figured out what was wrong with your Dump Home Menu Script.
You set up CIA2 and all the CIA1 paths to include OUTPATH, but forgot to initialize OUTPATH.

Here's a fix:
Code:
####################Dump Home Menu to .cia####################

@Dump_Options_Dump_HomeMenu_to_.cia
set PREVIEW_MODE "GODMODE9 ALL-IN-ONE MEGASCRIPT\nby annson24\n \nDump Options\n>HomeMenu to .cia Dump"

if    not ask "Dump HomeMenu to .cia?\n \nPlease make sure you have\nenough storage space."
    goto MainMenu_Dump_Options
end

set OUTPATH "0:/gm9/out"        <-----------ADD THIS INITIALIZATION (But not this text obviously)
set CIA2 "$[OUTPATH]/homemenu.cia"

if    find 1:/title/00040030/00008202/content/*.tmd TMD
    echo "JPN region detected."

    if    buildcia $[TMD]
        find $[OUTPATH]/0004003000008202* CIA1
     
    else
        echo "Operation failed."
        goto MainMenu_Dump_Options
     
    end
 
elif find 1:/title/00040030/00008F02/content/*.tmd TMD
    echo "USA region detected."
 
    if    buildcia $[TMD]
        find $[OUTPATH]/0004003000008F02* CIA1
     
    else
        echo "Operation failed."
        goto MainMenu_Dump_Options
     
    end
 
elif find 1:/title/00040030/00009802/content/*.tmd TMD
    echo "EUR region detected."
 
    if    buildcia $[TMD]
        find $[OUTPATH]/0004003000009802* CIA1
     
    else
        echo "Operation failed."
        goto MainMenu_Dump_Options
     
    end
 
elif find 1:/title/00040030/0000A102/content/*.tmd TMD
    echo "CHN region detected."
 
    if    buildcia $[TMD]
        find $[OUTPATH]/000400300000A102* CIA1
     
    else
        echo "Operation failed."
        goto MainMenu_Dump_Options
     
    end
 
elif find 1:/title/00040030/0000A902/content/*.tmd TMD
    echo "KOR region detected."
 
    if    buildcia $[TMD]
        find $[OUTPATH]/000400300000A902* CIA1
     
    else
        echo "Operation failed."
        goto MainMenu_Dump_Options
     
    end
 
elif find 1:/title/00040030/0000B102/content/*.tmd TMD
    echo "TWN region detected."
 
    if    buildcia $[TMD]
        find $[OUTPATH]/000400300000B102* CIA1
     
    else
        echo "Operation failed."
        goto MainMenu_Dump_Options
     
    end
 
else
    echo "Unknown Region.\nPlease contact the script author.\Aborting."
    goto MainMenu_Dump_Options

end

mv -w -n $[CIA1] $[CIA2]
echo "HomeMenu Dumped in:\n$[OUTPATH]"

if    ask "Decrypt $[CIA2]?"
    decrypt $[CIA2]
    echo "$[CIA2] decrypted"
 
else
    echo "Decrypt declined."
 
end
goto MainMenu_Dump_Options
 
Last edited by 8BitWonder,
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum