Homebrew [Release] Inject any app into Health & Safety (O3DS/N3DS/CFW only)

  • Thread starter d0k3
  • Start date
  • Views 238,195
  • Replies 527
  • Likes 40

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
A lot of people know that problem - you just setup a brand new EmuNAND, just to notice, moments later, that you forgot about installing a CIA manager. Now you're out of luck, and the only choice you've got left is setting up your SysNAND (via PastaCFW / ReiNAND Sys / rxTools dev) with a CIA manager and formatting your EmuNAND anew. Don't fret, cause this thread contains the solution.

Thanks to the work of @Syphurith, @Shadowtrance, @dark_samus3 and mself, we can now comfortably inject any homebrew app into the Health & Safety app. That does not only include FBI and DevMenu (which would be obvious choices), but in fact anything you can think off.


What you will need:
  • A N3DS or O3DS on or below FW 9.2.
  • A CFW (rxMode, ReiNAND, CakesFW, PastaCFW) already set up (I won't help with that). Injected apps don't work without CFW.
  • Some way to run Decrypt9 on your 3DS plus the most recent version of Decrypt9WIP.
  • The most recent copy of the Universal Inject Generator, extracted to some place of your choice on your Windows / Linux PC. Alternatively, use the GUI written by @Shadowtrance.

How to use it:
  1. Dump hs.app from either SysNAND or EmuNAND using Decrypt9 "Dump Health & Safety" feature. It's in "SysNAND File Options" or "EmuNAND File Options". Decrypt9 needs to be run from SysNAND.
  2. Get hs.app from the root of your 3DS SD card and put it plus as many homebrew CIAs as you like into the "input" folder of the Universal Inject Generator.
  3. Run go.bat, you'll get two inject-ready apps per CIA.
  4. If the last one for some reason doesn't work, you may try deep-decrypting (via Decrypt9, "Game Decrypt Options") your CIAs first. Then go back to step 2.
  5. To inject, copy the inject-ready .app files into the root of your 3DS SD card and inject via Decrypt9. The feature is also found in "SysNAND File Options" or "EmuNAND File Options", but stay with the NAND you used for dumping!
  6. That's it!

Limitations of this:
  • Inject apps can not be bigger than the original H&S app. It is possible that this will not work for some homebrew. For a workaround, keep reading.
  • Obviously, the injected app will only show up when signatures are patched. Without signature patches, f.e. in SysNAND, you'll simply see nothing at all.
  • Won't work with commercial stuff (ie roms). You're free to try, of course, but to be honest I don't see much use in having games replace your H&S app ;).
  • You need to generate your inject apps yourself to prevent incompatibilities. Don't take ones from other persons if you can avoid it.

C# rewrite with GUI:
For all the command line illiterates, @Shadowtrance rewrote this in C# with a nice GUI. Get his release from here.
tj5nER9.png



Is this safe?

The only critical feature is the injector itself. It (as well as all other file injector features in Decrypt9) is designed so that it will never touch anything but the space of the file to inject. For Health & Safety, the worst that can happen (if you do something wrong) is that Health & Safety vanishes from your menu, and that is still totally fixable (most likely, even for people who are too lazy to do backups). I still won't take any responsibility if anything breaks and advice you to do backups. You're on your own.


Injecting apps larger than H&S

Try @Syphuriths script. That one doesn't need Decrypt9, relies on xorpads and the user doing the inject himself via EmuNAND tools, 3DSFAT16tool and OSFmount. Needless to say, not for noobs, and you will have to do the reading on that yourselves.


Credits
 
Last edited by d0k3,

dark_samus3

Well-Known Member
Member
Joined
May 30, 2015
Messages
2,372
Trophies
0
XP
2,042
Country
United States
In the script it seems to check the size at the end and warn the user that it is bigger than the original why is that? I'm guessing it has to do with decrypt9's feature to not have to fully decrypt and then reencrypt the whole NAND image... Anyways thanks for such a useful tool and the openness that we never got from rxTools and Riku's injection tool, this will make things so much easier :)
 
  • Like
Reactions: Subtle Demise

Dean_

Well-Known Member
Member
Joined
Sep 11, 2014
Messages
684
Trophies
0
XP
712
Country
In the script it seems to check the size at the end and warn the user that it is bigger than the original why is that? I'm guessing it has to do with decrypt9's feature to not have to fully decrypt and then reencrypt the whole NAND image... Anyways thanks for such a useful tool and the openness that we never got from rxTools and Riku's injection tool, this will make things so much easier :)
To prevent fragmentation or something I guess.
 

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
In the script it seems to check the size at the end and warn the user that it is bigger than the original why is that? I'm guessing it has to do with decrypt9's feature to not have to fully decrypt and then reencrypt the whole NAND image... Anyways thanks for such a useful tool and the openness that we never got from rxTools and Riku's injection tool, this will make things so much easier :)
To prevent fragmentation or something I guess.
Exactly that. Fragmentation may have unexpected side effects (an untouched SysNAND is never fragmented). Decrypt9 even checks for fragmentation before injecting and will stop if it detects something. Plus, I would never touch the CTRNAND FAT table in Decrypt9, not even utilizing something like FatFS. You accidentially turn it off during the process of reencryption, or even I missed something when coding it, and what would happen? You'd be left with a bricked NAND, that's what. Too dangerous, so this will only support apps smaller than the original H&S app.

On a sidenote - each and every feature in Decrypt9 is developed with that principle of "touch only what is absolutely needed" in mind. A lot of stuff would actually have been so much easier without that prinicple, but I understand that not everyone has a hardmod (even I do not) and for many a brick would have dire consequences. And, so that this doesn't stay unmentioned... of course the last responsibilty is always with the users. There are multiple safetly locks in place, but it is possible to brick your 3DS with Decrypt9, after all. Carefully read the information that you are given. Have backups. If you are unsure about something, just stop.
 
Last edited by d0k3,

peteruk

Well-Known Member
Member
Joined
Jun 26, 2015
Messages
3,002
Trophies
2
XP
7,265
Country
United Kingdom
@d0k3

Thanks this is awesome to finally be able to inject something like FBI or Devmenu into H&S on N3DS

For me though is very difficult to follow, i failed at the first step, as soon as i pressed on Decrypt9 i got a black screen
 

Dean_

Well-Known Member
Member
Joined
Sep 11, 2014
Messages
684
Trophies
0
XP
712
Country
@d0k3

Thanks this is awesome to finally be able to inject something like FBI or Devmenu into H&S on N3DS

For me though is very difficult to follow, i failed at the first step, as soon as i pressed on Decrypt9 i got a black screen
Did you put the files in the right folders?
sd:/Decrypt9WIP.bin
sd:/3ds/Decrypt9WIP/~~.3dsx and ~~.smdh
 
  • Like
Reactions: peteruk

Shadowtrance

Well-Known Member
Member
Joined
May 9, 2014
Messages
2,493
Trophies
0
Location
Hervey Bay, Queensland
XP
1,797
Country
The .bin file isn't needed.
And sometimes you WILL get a black screen when trying to load it, just the nature of the loader it runs on. It isn't perfect and can fail to load properly sometimes. :)
If that happens, just restart and try again. :)
 
  • Like
Reactions: peteruk

peteruk

Well-Known Member
Member
Joined
Jun 26, 2015
Messages
3,002
Trophies
2
XP
7,265
Country
United Kingdom
The .bin file isn't needed.
And sometimes you WILL get a black screen when trying to load it, just the nature of the loader it runs on. It isn't perfect and can fail to load properly sometimes. :)
If that happens, just restart and try again. :)

Thanks, i re downloaded all the decrypt9 files, will have a go this evening when kids have settled, thanks @Shadowtrance :)
 

peteruk

Well-Known Member
Member
Joined
Jun 26, 2015
Messages
3,002
Trophies
2
XP
7,265
Country
United Kingdom
Ok quick update

I persisted, using the guide above, followed it step by step and can confirm it worked 100%

I used it on emuNAND because i am always too afraid to mess with sysNAND, but wish to feedback to the creator's that it worked 100% on N3DS EURO 9.0 / 9.5 emu

Thanks for this awesome guide !!
 

camicortes

Chochos
Newcomer
Joined
Sep 20, 2006
Messages
23
Trophies
1
Age
37
Location
Concepción, Chile
Website
camifran.tumblr.com
XP
288
Country
Chile
Hey guys, I get the following error while trying to inject FBI:

https://www.dropbox.com/s/6gcw60l1ieqtp5v/InjectError.PNG?dl=0

If I try to run the go.bat as administrator it says it hasn't found the hs.app (it's inside the input folder).

It generated two FBI apps either way, none of which work when I inject them back to the emunand (if I try to open the H&S App, an error occurs and the 3ds prompts me to reboot it).

Any help with this?
 

dark_samus3

Well-Known Member
Member
Joined
May 30, 2015
Messages
2,372
Trophies
0
XP
2,042
Country
United States
Hey guys, I get the following error while trying to inject FBI:

https://www.dropbox.com/s/6gcw60l1ieqtp5v/InjectError.PNG?dl=0

If I try to run the go.bat as administrator it says it hasn't found the hs.app (it's inside the input folder).

It generated two FBI apps either way, none of which work when I inject them back to the emunand (if I try to open the H&S App, an error occurs and the 3ds prompts me to reboot it).

Any help with this?

Hmm interesting, I'll send you a PM in a bit regarding a fix
 

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
Well, my spanish is a bit rusty, but it looks like the fsutil tool is asking for administrative privileges. In fact, that tool is not required (with a workaround). I'll have a fix in a minute...

@camicortes can you redownload from Github and try again?
 
Last edited by d0k3,

dark_samus3

Well-Known Member
Member
Joined
May 30, 2015
Messages
2,372
Trophies
0
XP
2,042
Country
United States
You shouldn't need to run it as admin (bat files / cmd) don't usually like that...

And @dark_samus3 if you're going to help someone, help everyone by posting it here instead of PM's. :P (unless it can't be said out here in the open i guess :) )

It was more of a I'll have you test a fix real quick and then post it for public knowledge after I know it works
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Sicklyboy @ Sicklyboy: *teleports behind you* "Nothing personnel, kiddo"