Homebrew [Release] GodMode9 Scripts Megathread

Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
Already finished checking.
@annson24 The dump scripts (USA one at least) here don't fail, but the dump script in your AIO script seems to. I'll see if I can't tweak it to work.
Btw, I merged your's and windows_server_2003 Dump_HomeMenu scripts (includes all regions: JPN, USA, EUR, KOR, CHN, TWN). Check post #115 if you get a chance. It was cross compared and found to work to your USA standalone script. Other regions will need to be tested and verified.
 

8BitWonder

Small Homebrew Dev
OP
Member
Joined
Jan 23, 2016
Messages
2,489
Trophies
1
Location
47 4F 54 20 45 45 4D
XP
5,358
Country
United States
Btw, I merged your's and windows_server_2003 Dump_HomeMenu scripts (includes all regions: JPN, USA, EUR, KOR, CHN, TWN). Check post #115 if you get a chance. It was cross compared and found to work to your USA standalone script. Other regions will need to be tested and verified.
I saw that, it looks good. I'll take a closer look at it and merge it into the OP once I'm done looking at the AIO script.
 
  • Like
Reactions: TurdPooCharger

8BitWonder

Small Homebrew Dev
OP
Member
Joined
Jan 23, 2016
Messages
2,489
Trophies
1
Location
47 4F 54 20 45 45 4D
XP
5,358
Country
United States
Apologies for the double-post,

Added @TurdPooCharger's Region-Free Dump HomeMenu Script to the OP, probably use this one since it actually supports all regions. Though if you really don't want a script that supports regions other than your own, the legacy standalone scripts are still there.
 
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
Apologies for the double-post,

Added @TurdPooCharger's Region-Free Dump HomeMenu Script to the OP, probably use this one since it actually supports all regions. Though if you really don't want a script that supports regions other than your own, the legacy standalone scripts are still there.

Hey man, would it be bad to tell you at this point that script can be reduced in lines some more? All the if & end can be cut down some with elif (I seriously didn't know how to use this).
 

8BitWonder

Small Homebrew Dev
OP
Member
Joined
Jan 23, 2016
Messages
2,489
Trophies
1
Location
47 4F 54 20 45 45 4D
XP
5,358
Country
United States
Hey man, would it be bad to tell you at this point that script can be reduced in lines some more? All the if & end can be cut down some with elif (I seriously didn't know how to use this).
Nah no worries. I've got some things I need to work on, but if you want to update your code and post it up I'll update it in the OP.
 
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
The script originally listed here is deprecated. Please check post #135 below.

FBI_Inject_and_Restore_H&S
* The script has been updated for universal CIA injection. The older versions only did FBI app. You may now inject anything any CIA files. Do not inject large size or retail CIA games as there's a size limitation preventing HOME Menu launch.

Shout out and thanks goes to:
  • @annson24 - For pointing out a flaw in trying to straight up dump FBI .app into H&S. This lead to the discovery of the strangeness of ncch.bin header file.
  • @d0k3 - For dropping by in the AIO megascript thread and giving me the heads up that 00000002.app needs to be encrypted in order for injection to work. I did some hex viewing to confirm this was the case. Huge thanks!
  • @The Real Jdbye - His feature requests piqued my curiosity in annson24's later mention of H&S injection. Is GM9 script capable of accomplishing such a feat?? The answer is a resounding YES!!
Details of this script's origins can be read starting at post #48 and onwards at the other thread here.

What is this?

Introducing (probably) the first gm9 script that is capable of injecting a CIA app into Health & Safety and restoring it back to original working order.

  • FBI_Inject_and_Restore_H&S.gm9

This script was written with only FBI app as proof of concept. It is usable but not coded as clean and compact as can be. The script was written for easier reviewing of how each part of the code works for those who would like to take up the mantle of porting a more universal H&S injector. improving and adding it into a AIO megascript.

Why did you make this script if GodMode9 can already handle H&S injection? What's the point of it?
To be honest, I have no idea why I made this script as I'm plenty happy using GM9 built-in H&S injector. I guess for the lulz and maybe to learn a thing or two about how injection works in general. But mostly for the lulz.

For a serious answer, I wrote this script as this was something annson24 was looking into doing. I thought I could help out. There are requests from some people who would like to see the menu selection intuitiveness of Decrypt9WIP in a GM9 script with the H&S injector being a prime candidate of (possibly??) improving the user friendliness front.

I don't buy your spiel for one moment that a script can do better than GM9 in H&S injection. You coded for nothing! Nothing I say!!
Hey man, you take it or leave it. All I wanted to find out was whether or not such a script was possible, and not that a script would do it better than GM9 itself. Personally, I'm more appreciative of d0k3's built-in H&S injector after learning the horrors of coding this thing.

As for the answer if injection by script is better than GodMode9 itself, that's a question only you the individual alone can answer.

How is this script able to inject? How does it operate?
By jumping through hoops of fire and performing ritual clap & dance. This script is extremely convoluted. The gory details can be found in the AIO megascript thread, but I'll give as brief a summary what goes on when injection happens.

Health & Safety and target app (FBI) both have their ncch.bin header files extracted into a temporary folder. The files are hex edited to create a hybridized ncch.bin which contains the needed TitleID and some other stuff. This script created ncch.bin matches one-to-one in hash to what GodMode9 creates when injecting into H&S.

The target app (FBI) has its .app extracted, injected with the new ncch.bin, and encrypted in order for it to properly launch in HOME Menu. The Health & Safety .app is renamed as .bak (back up??) file extension like how GodMode9 does it. The target app (FBI) .app is then renamed and transferred into the H&S content's folder.

Along with all this, there are many safety checks in place to prevent and minimize bad injection.

Can I trust your script not to implode my 3DS? Will games install through script injected FBI work?
I've ran this script and tried FBI by installing the Mario Kart Super Circuit (GBA Virtual Console) game in CIA. I launched Mario Kart, played it a bit, and my 3DS is still a 3DS. As for the implosion, I have yet to rip the fabric of space-time, or it's too late and the black hole is already all consuming with no notice from anyone's part due to time dilation.

♪ I make no promises! ♪, but you should be safe using this script. :mellow:

Anything I should know before using this?
You need a folder named cia on the root of your SD card and FBI.cia has to exactly match like this:

0:/cia/FBI.cia

If the file and folder is named anything else, the script will refuse to inject.


FBI is no bueno. Can you make one that injects the _____________ app?
Heavens no! My interest in this script ends here.
Try not to inject anything too big.

Edit #1- Script has been pulled for the time being due to being USA region only. Will code and update for region-free.

Edit #2 - Version 1.1 is now all inclusive for all regions.

Edit #3 - Version 1.2 has been cleaned up in redundant code. You're allowed to inject any CIA now, just don't try anything too big in size. The older versions had bugs when pressing and holding (B) button allowed you to cancel running the script. This is very bad in that you get an incomplete injection.

* There is one bug that cannot be fixed while holding (B) near the end of the script run.
During encryption of your new .app, it is possible to cancel and end the script. Your injected .app will be corrupt. You can do a Health & Safety restore, so it is recoverable and nothing breaking. There is no way to prevent this bug as GM9 script has no way of forcing encryption to continue.
* See Edit #7 for work around of this bug.

This version also allows injecting a new CIA .app into H&S if something else is already injected into H&S. Old script version required you restore H&S before injecting something new. Don't worry in case you try injecting something new but want to cancel. The old/current inject will persist.

Edit #4 - Version 1.3 adds an if statement in case of a failed new .app injection, restoring your old .app injection or H&S .app. Only the H&S case was accounted for and not the old .app . This was missing in v1.2 which would have been a pitfall if this rare occurrence was to happen.

Edit #5 - Re-uploaded the v1.3 script, one with annotation and another without. The password to access the DEVS version is 'password'. They will run exactly the same except for the regular version being faster due to having no comments or "fluff"

Edit #6 - Version 1.4 reorders the encryption step of the new injected '00000002.app' to be absolutely last. There was a step in deleting the old and renamed injection '00000002_old.app' that was placed last in action in the previous version. In case anyone decides to hold the (B) button cancelling the script at this very critical step of encryption, you won't have an orphaned '00000002_old.app' hanging about in the Health & Safety folder. Again, there is no way to prevent user error during encryption due to GM9 script possessing no option to force continuing encryption if you decide you want to cancel at the very last moment.

** Did minor adjustments where if encryption fails due to user error or bad .app because of bad source dump, etc. , you will now be redirected back to selection and instructed to either restore Health & Safety or try injecting again.

Edit #7 - Version 1.5 will now allow you to try re-encrypting your new .app if you accidentally interrupted the encryption process by pressing and holding (B) near the end. If you decide you do not want to install this new .app, the script will either restore your old injected .app or Health & Safety .app depending which was last holding the spot. You will then be returned to Selection without a busted .app as a placeholder in Health & Safety.

Edit #8 - Old 3DS and Old 2DS users, this H&S injector app might not work for your systems due to changes in Title ID versus those on the New 3DS and New 2DS. The script will be left here for the time being until the proper Title ID is identified and added.

Edit #9 - Version 1.6 accounts for and ensures compatible with both old and new series of 3DS/2DS. Also, because there may be differences in the Health & Safety .app title ID by region and old/new, the code has been adjusted so that Title IDs are not static values. The script will search up and record what your system's Health & Safety .app title is called, and do the rest of the injection and restoration accordingly. This script is Title ID agnostic.

For example, on my new USA N3DSXL, H&S .app is called "00000002.app" . The title ID for the app file is "00000002". However, on a different 3DS region or generation, the title ID number may not be that. ***This does add a bit of run time to the script. Unless I knew ahead of time what those Title ID's are by region [JPN, USA, EUR, CHN, KOR, TWN] and by generation [old/new], this is the only way for the script to be compatible for ALL users.
*** Run-time increase now negligible due to proper utilization of the strsplit function.

Edit #10 - Version 1.7 contains scripts these individual Nintendo apps. There is also a single script that can multi-app inject and restore.
- AR Games
- Download Play
- Face Raiders
- Health & Safety
- Mii Maker
- Nintendo eShop
- StreetPass Mii Plaza

The multi-version is called:
  • Inject and Restore Apps.gm9
which can inject all the ones listed above, restore them singularly, restore them all, and even clear the HOME Menu cache in case you get stuck icons from your injections.
 
Last edited by TurdPooCharger,

annson24

The Patient One
Member
Joined
May 5, 2016
Messages
1,191
Trophies
0
Age
32
XP
1,843
Country
Philippines
FBI_Inject_and_Restore_H&S
Clap Clap. :grog: Well done good sir. Still haven't reviewed the code though but job well done. I think I'll look at this tomorrow and see if I can find anything I can clean. Then, off to the Megascript. Can't do it today as my head is really cloudy now with all the work here in the office.
 
  • Like
Reactions: TurdPooCharger
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
Clap Clap. :grog: Well done good sir. Still haven't reviewed the code though but job well done. I think I'll look at this tomorrow and see if I can find anything I can clean. Then, off to the Megascript. Can't do it today as my head is really cloudy now with all the work here in the office.

There's plenty that can be optimized. Can you take it from here? I need a break away from gm9 scripting, lol.
 

annson24

The Patient One
Member
Joined
May 5, 2016
Messages
1,191
Trophies
0
Age
32
XP
1,843
Country
Philippines
There's plenty that can be optimized. Can you take it from here? I need a break away from gm9 scripting, lol.
Okay, just can't help myself and tried to peek a little. The first thing I noticed is 1:/title/00040010/20021300/content/00000002.app is specific for New 3/2DS US region only. So a few arguments needs to be added to support other Models and regions. Everything else is for later, kek.
 
D

Deleted User

Guest
Ok lol, I see everyone is making scripts that super complicated. I feel like I'll put down for such a simple and probably useless script. Either way, I made a script for when you want to put splashes into the CTRNAND. You have to put the splashes on the root of the SD card btw. Tell me if the file doesn't work.

This script needs to be put in the AIO version.
 
  • Like
Reactions: annson24
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
Hey guys. I know I said I wouldn't spend any more time messing with that H&S injection script. The latest v1.2 release has been cleaned up in coding and now allows selecting any .CIA files and games in the 0:/cia folder directory. Have fun with it.

Edit - I'm not touching these but perhaps someone can extend the injection for:
  • AR Games
  • StreetPass Mii Plaza
  • Mii Maker
  • Download Play
  • Face Raiders
  • Nintendo eShop (good candidate to inject freeShop here)
  • YouTube* (do people even watch YT through the 3DS?)
  • Nintendo 3DS Camera (assuming pressing L & R still pulls it up)
  • Nintendo 3DS Sound (???)
Reclaim back some of the title slots and make them useful. The title IDs for these by region are found here:
https://www.3dbrew.org/wiki/Title_list#00040010_-_System_Applications

Edit #2 - Do not try injection into StreetPass Mii Plaza and Mii Maker. The Activity Log will pick these up and log the actual game or homebrew injected in them.
- YouTube doesn't appear to be a system 000400010 title.
- Don't think it's a good idea to mess with camera and sound stuff.
 
Last edited by TurdPooCharger,

zweilous

Member
Newcomer
Joined
Mar 1, 2017
Messages
16
Trophies
0
XP
93
Country
United States
quickly wrote up a few scripts. some of them are redundant with what already exists but i either wanted to consolidate it into one script or rewrite it in a way that works for my own personal use

fair warning that i only loosely tested these so be sure to read through it first, but they did the job for what i needed them for. if anyone tests these and find that there's any problems or suggestions, i'll look into it and update accordingly

https://github.com/zweilous/gm9scripts

  1. dump cartridge
    • dump .3ds file as .cia from a CTR cartridge or dump .nds file from a NTR cartridge
  2. extract pokémon game files
    • extract romfs or .code from the main/update title from any 3DS pokémon game installed as an SD title
  3. reset activity log
    • for use with USA/JPN/EUR/KOR systems only
    • create backups of ptm and activity log savedata from sysnand
      • saves in output folder with the following format: yymmdd_serial_title_###
    • delete existing ptm and activity log savedata
  4. restore activity log
    • for use with USA/JPN/EUR/KOR systems only
    • restore a backup of ptm or activity log savedata to sysnand
      • must be located in the output folder with the following format: yymmdd_serial_title_###
      • to be used with the backup functions from the "reset activity log" script
 
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
* This is a continuation from post #127 above. If you've been following the story of this script, you already have a good idea or know what this is going to be about. Sorry again for some rehashed info!!​

Scripts available here below this post and also uploaded at GitHub: https://github.com/TurdPooCharger/Inject-and-Restore-Apps
To the mods who don't get paid enough (or at all but should), devs who should also get paid but alas (lol), fellow coders/gm9 script writers wondering why programming hurts you so good that at times you ponder if something is seriously wrong with you/us, and the awesome citizens of this wonderful community keeping it real with their 2DS & 3DS systems still kicking, I apologies ahead of time for having double and triple posted these past few days on this and other threads.

I never originally set out to write these scripts but did this for fun in experimenting and testing the limits of what GodMode9 and its scripting ability can do. All of this may have been better posted on GitHub as the scope of the coding and updates listed here have grown to the point where I believe they are very ill suited being posted on GBAtemp forum. I have a account on GitHub but am not familiar how that site works and what one needs to do in presenting code & work as legitimate for peer review. I may need help setting a repo in case this post gets the boot or the script in question is deemed "not legit". The earlier posts were written partially in jest in case techno-babble was boring to a layman and something relate-able but funny could be present in explaining what the code does when it injects.

This script contains over 600 lines of code and requires verification that it works regardless of region and old/new type. I've tried to code this as user friendly and as bug free as possible, but one person cannot and should not code for everything. More eyes are need to check against my work, and that it is indeed safe and sound. If you find something amiss or wrong with the script, please feel free to PM me. I'll setup a GitHub if one is required at this point and when I can after catching a break.

Inject and Restore Apps

Again, shout out and thanks goes to:
  • @annson24 - For pointing out a flaw in trying to straight up dump FBI .app into H&S. This lead to the discovery of the strangeness of ncch.bin header file.
  • @d0k3 - For dropping by in the AIO megascript thread and giving me the heads up that 00000002.app needs to be encrypted in order for injection to work. I did some hex viewing to confirm this was the case. Huge thanks!
  • @The Real Jdbye - His feature requests piqued my curiosity in annson24's later mention of H&S injection. Is GM9 script capable of accomplishing such a feat?? The answer is a resounding YES!!
To put it plainly, this is a gm9 script that allows you to inject your .CIA titles into multiple Nintendo apps many would deem as nonessential or wasteful to their precious 300 titles limit.
  • Inject and Restore Apps.gm9
This script can inject into the following Nintendo system titles:
  1. Activity Log
  2. AR Games
  3. Download Play
  4. Face Raiders
  5. Health & Safety
  6. Mii Maker
  7. Nintendo 3DS Camera
  8. Nintendo 3DS Sound
  9. Nintendo eShop
  10. StreetPass MiiPlaza
The script has the ability to individually inject and restore those titles back, or do all of them in one execution run for both inject and restore. It also has the ability to clear your HOME Menu icon cache in case your injections leave behind stuck icons after a restore.

Hey, you didn't add all the [insert negative adjective] Nintendo apps in the script. What gives?!
Ah hah, glad you asked. Here are the reasons why:
  • Nintendo Zone - This title will refuse to launch with the following message:
This service has been discontinued. Thank you for using this service.
Injection will not change this or bypass the blockade.
  • YouTube - I couldn't find the TitleID for this app as it doesn't show up in either FBI and GM9. Either it goes by a different name when searching by TMD ticket, not a system app, or a conundrum of a ghost app pandering as a system app. I have no clue for this strange fellow. Not a system title. Can be updated and then deleted off HOME Menu.
  • Nintendo 3DS Camera - I'm not sure if this app on HOME Menu is separate or the same one when pressing the L+R buttons to pull up the camera. If they're the same, the good scenario is you can quick launch your favorite app by shoulder buttons. The bad scenario is you end up crashing the 3DS using those buttons in case of a panic. An okay scenario is you retain L+R camera while launching injected title from its home icon. Another reason why this one was left alone is in case certain games and homebrew apps utilize the camera, and this app is somehow tied in. I could try testing what would happen but am in no hurry to figure this out at this moment. Included now.
  • Nintendo 3DS Sound - I dunno. I think it's a kinda neat app that you can play your music on the go with the 3DS. Actually, due to getting scared from the Camera app above and seeing Nintendo 3DS in the same title, I was like, nope, ain't touching that one too! Included now.
  • Game Notes, Friend List, Notifications, Internet Browser, and Miiverse - No idea what will happen if one tries to inject in those top row apps. If it works, Miiverse would be a perfect candidate injecting with Foxverse. I don't know, I never used Miiverse/Foxverse so can't tell ya. Will not launch injected titles but original apps.
  • Activity Log - Maybe? I think it's great for checking and verifying your apps were correctly injected. If you see the injected app's icon in the log, you'll know your homebrew is definitely not hidden from view by Nintendo. Included now.
  • System Settings - NO. *(Tried anyhow. You get ARM11 crash bug).
If required, the script can be updated to include any missing (cr)apps.

Some of my injections don't work when launched at HOME Menu. You said this can inject any CIA app!
Information pertaining to incompatible injections is outdated. An (upcoming) version 2.1 update will fix the majority of nonworking homebrew titles. Coming Soon™.

This can inject any title so long as the .cia file in question is decrypted, not a bad source dump, and can be encrypted in GodMode9. In fact, if the game or homebrew app you wish to inject doesn't work in GodMode9's built-in H&S injector, this script certainly won't either. There is either a system app size limiter in place or mismatch in the injected version of the header file causing the 3DS to crash due to bad header info input.

After hex editing many variations of the injected header files for apps that fail to launch, no workaround fix could be found. The only pattern I could determine if a game or homebrew is able to launch successfully is whether the source cia (ie: FBI , Checkpoint, Mario Kart GBA VC, etc) has what I call its "special hex key" at the correct offsets/positions.

To learn more about ncch.bin file injection, study this diagram. All you need to know is that the injected version of the header is a conglomerate of the two parent apps, the app you want to inject (ex: FBI) and the system app you want to inject into (ex: Health & Safety). Pay special attention to where the injections occur in the center for the areas highlighted lightly red and blue.


comparion_FBI.png

Here's a comparison picture that better explains what I mean by this "special hex key". Also, take note that the offsets are in hexadecimal numbers. These are not count and read like normal numbers of 1, 2, 3, etc. A hexidecimal number of lets say 100 is equivalent to a normal number of 256. We really don't care what the hex number value really is, but more of what it means.

HCCH_YES_NO.png
  • If the special key, symbol, or character for the source app is located at offsets 10A and 11A, the injection is most likely going to work.
  • If, however, that key is instead located at offsets 109 and 119, the injection will fail.
What this means is that you more or less cannot inject any official 3DS games in CIA format because all of them have their special hex key in their header files placed one over from what a Nintendo 3DS system app header has theirs at.

Hex editing the injected header does not borrow the special hex key from the source app but from the app getting injected into, so there's no way to fix those failed launches.

For the homebrew developers with apps that don't work with injection, this knowledge might mean they can adjust the info in their header files accordingly so that their app can be made compatible and working.


Hexes? Headers?? Offsets?! I ain't got time for that. Just tell me which apps to look out for.

Information pertaining to incompatible injections is outdated. An (upcoming) version 2.1 update will fix the majority of nonworking homebrew titles. Coming Soon™.

Working

  • 3DShell
  • 3DSident
  • CIAngel
  • Checkpoint
  • Cthulhu
  • DSP1
  • FBI
  • freeShop
  • GameYob
  • GYTB
  • Homebrew Launcher
  • JKSM
  • mGBA
  • TIKDevil
  • tikSweep
  • Themely
  • TWLoader * - Will launch into menu. NDS games will not boot when selected. Works now starting from v1.9, except for Health & Safety and Face Raiders. Those two still boot up blank when NDS game is select.
Not Working (as of v2.0)
  • Anemone3DS
  • BlargSNES
  • CHMM2
  • PicoDrive for 3DS
  • Snes9x for 3DS
  • sdllopan [I have not tested @nop90's collection of other games]
  • TemperPCE for 3DS
  • VirtuaNES for 3DS
  • All or most small sized 3DS games (ie: Virtual Consoles)
I can't test for everything as that's not really my department. Also, not to point fingers at anyone from the latter list... Can someone else (nicely) give *wink-wink* nudges to those authors. Perhaps their header files can be adjusted if that header difference is the actual underlying problem.

Any special warnings you need to tell me in case I use this script?
For those Nintendo apps you can inject into, you should not inject anything in them until after you have launched them at least once beforehand and checked they've been correctly recorded in the Activity Log. If you launch an app for the first time with an injection in place, the source app's shared icon and name will instead get recorded. You will need to use Cthulhu to clear the Acitivity Log and shared icons caches.

If you plan to inject, lets say freeShop into Nintendo eShop, I do not know and cannot tell you if Nintendo has a way of detecting you are running freeShop in place of their eShop. If you get flagged and banned from injecting into eShop, I take no responsibility here. (Please see information below regarding update v2.0 mitigating the risk of getting caught with stealth injection.)

In case you do a restore option to remove your injections, it is possibly that you can get stuck icons on HOME Menu. Let's say you injected FBI into Health & Safety, did a H&S restore, go back to HOME Menu, and find that H&S icon has been replaced with FBI icon. You can either run Cthulhu's HOME Menu icon cache management and do a Clear HOME Menu icon cache.

Doing this will delete the following two files:
  • 0:/Nintendo 3DS/<ID0>/<ID1>/extdata/00000000/000000**/00000000/00000004
  • 0:/Nintendo 3DS/<ID0>/<ID1>/extdata/00000000/000000**/00000000/00000005
The ** will depend on your region: [USA = 8F][EUR = 98][JPN = 82][CHN = A1][KOR = A9][TWN = B1]

The gm9 script's Misc Options > Clear Icon Cache will do the exact same thing of deleting those two files. Make sure you have nothing injected in those Nintendo apps when clearing the icon cache, or the stuck icons will still be there. In case you forget and cleared the cache while injections are still in place, no worries. Just go back into GM9, run the Restore All, Clear Icon Cache, and then boot into HOME Menu.

You may find that after following the steps above, you get a stuck icon to reappear when injecting a single app. Do not launch that injected title. Go back to GodMode9, run the script again, and try injecting into a different and second Nintendo app while the first injection is still in place.

Booting back into HOME Menu with those two injections in place should then remove that persistent stuck icon.

The script should work for all 3DS and 2DS systems from any region and whether it is old or new. There are slightly different TitleID differences for Face Raider and Health & Safety depending if the system is an old or new type. I don't know if the old type systems retain the old TitleID or were updated with the new TitleID for these two.

Also, the Clear Icon Cache is not explicit for regions such as CHN (China), KOR (Korea), and TWN (Taiwan). The ** wildcard region codes for these are not widely known, so the script defaults to finding that specific folder by choosing the first folder in its search. Unless someone shares with me the correct ** codes for these regions, the script makes the assumption the correct folder is always that first one listed no matter the region (for those three unknowns).

The Nintendo eShop app is weird. Most games and homebrew have one or two .app files within their CIA. The first .app is almost universally the game you launch and play. The second .app if one is present contains the e-manual. The script is agnostic about the TitleID of the .app you wish to inject into, so it does a first base .app file search up and assumes that first .app is the game one and not the e-manual.

In the abnormal case of Nintendo eShop, the first .app is actually the e-manual and the second .app is the title you launch into.
  • 00000067.app , 1.1 MB - Nintendo eShop e-manual
  • 00000070.app , 6.2 MB - Nintendo eShop launchable title
The script is explicit in choosing '00000070.app' when injecting into eShop. However, I do not know if that TitleID is named exactly the same for every region's eShop. I've only been able to test this script on my USA N3DSXL. Someone else with a real JPN, EUR, CHN, KOR, and TWN regions 3DS or 2DS needs to help verify this script works for their eShop.

* Also, you might want to do your injections while the 3DS/2DS is disconnected from the internet. Turn off your WiFi, do your injections, double check there's no stuck icons and Activity Log didn't record the wrong shared info, and check your injected titles run as they should before deciding to reconnect online.

You may find your 3DS tends to crash with an ARM9 log dump when turning the system off after having launched and used an injected title. This is something that will happen even in GM9's built-in H&S injector, so don't be surprise and be ready to expect this to happen. Fixed now.

If you plan to inject into Activity Log, know that your game play still gets recorded even with injection in place. The next time you restore Activity Log, whatever progress or new titles you've launched will show up recorded.

I only need like one or two of those listed apps. That multi-app injector script is overkill for me.
I got you fam. Within the archive below contains all of those titles individually in their own separate scripts.

Man, I don't want my folder containing my CIA files at 0:/cia. That location and name sucks.
Chill. It's all good. Open up the script in Notepad and edit this.

Code:
set CIA_FOLDER "0:/cia"
to
Code:
set CIA_FOLDER "0:/[directories locations]/[your cia folder name]"

If you really want to, you could put your CIA files at a location and named folder like this:

Code:
set CIA_FOLDER "0:/boring office stuff/tax forms and 401k/totally not secret stuff/cia pr0n"

Can you update the script to include injecting your mom?
Shame on you.

(Continuation...)
As of version 2.0, there is more information pertaining to this script that be can read at post #160.


Edit #1 - Version 1.1 now includes exact named directory of the HOME Menu extdata for KOR, CHN, and TWN regions. Old method of finding their respective folders required searching for the first folder listed. This search up method works but this assumes no one adds a folder within that directory that appears before the needed folder. Thanks to @zweilous for pointing out the correct extdata info.

Edit #2 - Version 1.2 fixes a teensy mistake in the code in which you try to name your CIA_FOLDER to something other than 0:/cia . The script had a file selection looking into this folder as a static variable named as "0:/cia" . Script will now properly work in specifying and choosing however that folder should be.

Edit #3 - Version 1.3 fixes a minor gripe at Line 322 where if you run the Clear Icon Cache and decide to cancel, you'll be returned to Misc Options. I missed catching and changing out the old pointer value where you get directed to Selection Menu.

Edit #4 - Version 1.4 adds Activity Log, Nintendo 3DS Camera, and Nintendo 3DS Sound to the list of inject-able titles.
  • I've checked what would happen if you inject Activity Log and launch a game not played before. Even with injection in place, Activity Log still records your game play.
  • If you press L+R to activate the camera, the camera still works. If you press the "Nintendo 3DS Camera" on the bottom right corner, that will launch your injection in place. It's not the fastest quick launch but you get to keep the best of both worlds.
  • I could not inject titles like "Game Notes" found at the top row. Even though they're located in the " 1:/title/00040010/ " system directory, they still launch as if no injections were in place.
  • Will still not add System Settings to the list.
Edit #5 - Posted the scripts at GitHub.

Edit #6 - Version 1.5 fixes a loophole of trying to select either a corrupt or fake .cia file. If one decides to rename a random file with the .cia extension and select this for injection, injection presequences will no longer occur. The script will first pre-check the integrity of the selected file in question by image mounting it. If the file cannot be mounted, the script will warn you the .cia file in question is bad and boot you back to the CIA file selection menu.

Edit #7 - Version 1.6 goes one step further in preventing bad injection due to malicious intent of receiving a fake CIA title and trying to inject an image mountable file that has been renamed with the .cia file extension. If an .app file is not found contained within the .cia file, the script will warn you about this and boot you back to CIA file selection menu.

Edit #8 - Version 1.7 adds name tracking for the CIA files injected into the system apps. Dummy files with the arbitrary " .inj " extension are made and placed within each of the Nintendo apps directories whenever an injection is done. The script copies the names from the CIA files and reads them off the inj files.

For example, lets say you inject the file FBI.cia into Health & Safety. The dummy tracker file named FBI.inj with the byte size of zero will be placed in
  • 1:/title/00040010/<SysApp TitleID by region>/content
If you were to inject a different homebrew title like 3DShell.cia into Health & Safety, FBI.inj gets replaced and updated with 3DShell.inj . When you restore Health & Safety through this version script, that .inj file gets deleted.

You should not use GodMode9's built-in Restore H&S if the last injection was done through the v1.7 script or else its .inj file gets orphaned in the Health & Safety directory. Nothing bad will happen if you do and decide to leave the .inj file behind as is. However, if you're a stickler for redundant files and want to remove that dummy file, re-inject something into H&S and then do a restore through the script alone. That will catch and delete that .inj file.

Other improves of version 1.7 includes streamlining lines of codes due to better order placements of safety checks and minor clunkiness when injecting (old injected .app now gets deleted before announcing inject success instead of after). A better placed safety check will identify sooner any Nintendo apps that are missing or deleted by the user. Injection sequence will not occur if the target's .app cannot be found in its directory, and you get booted from that sys app selection.

Edit #9 - Version 1.8 fixes the ARM9 bug crash when launching an injected title once and then turning off the 3DS. You can read the details of this at GodMode9's GitHub here. Name tracking is also present during CIA file selection, which is helpful when using the Inject All feature.

Edit #10 - Pulling repo until @ihaveamac gets credited. Will re-upload when fixed.

Edit #11 - Version 1.9 fixes a B button cancellation bug when the script tries to calculate the SHA-256 hash of the modified extended header. A looping statement now prevents the user from accidentally or purposely stopping the script during this injection process.

Edit #12 - Version 2.0 adds more safety checks for CIA files that are DSiWare, DLC, updates, eShop demo, and larger than 16 MB. It also incorporates "stealth" injection and splash screen option. Details of this version can be read at post #160 here.
 

Attachments

  • Inject and Restore Apps v2.0.zip
    118 KB · Views: 207
Last edited by TurdPooCharger,
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
Bravo, my man. Bravo. To think that you were gonna quit until d0k3 made like a two line comment. :)
He could totally update GodMode9 to include injecting those mentioned apps and render this script totally obsolete. LOL, ow.

I would feel kinda bummed out, but hey whatever works for the sake of progress. :lol:
 
Joined
Jan 1, 2018
Messages
7,292
Trophies
2
XP
5,947
Country
United States
@TurdPooCharger: KOR home menu extdata is 0x000000a9. i don't know which one is CHN or TWN but 0x000000a1 and 0x000000b1 are the other two

Thanks. For the time being, I'll leave the code as is when it does its search for that folder for those 3 regions. Will need to make sure those missing three are exactly that and which is which. I'll update when we get more confirmations. On my N3DSXL, these are what are listed in the directory:

0:/Nintendo 3DS/<ID0>/<ID1>/extdata/00000000/
  • 0000008f
  • 00000210
  • 00000217
  • 00000219
  • 000014d1
In case those other 4 folders are similarly named and placed after the HOME Menu extdata folder, the script will work for those missing regions.
 

zweilous

Member
Newcomer
Joined
Mar 1, 2017
Messages
16
Trophies
0
XP
93
Country
United States
Thanks. For the time being, I'll leave the code as is when it does its search for that folder for those 3 regions. Will need to make sure those missing three are exactly that and which is which. I'll update when we get more confirmations. On my N3DSXL, these are what are listed in the directory:

0:/Nintendo 3DS/<ID0>/<ID1>/extdata/00000000/
  • 0000008f
  • 00000210
  • 00000217
  • 00000219
  • 000014d1
In case those other 4 folders are similarly named and placed after the HOME Menu extdata folder, the script will work for those missing regions.
what i posted is correct. if you need confirmation, here's the gm9 script for clearing home menu extdata taken from the 3ds guide, and here's a cthulhu commit adding support for those regions
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Y @ YuseiFD: :creep: