NEWS: If you want to try this now, check out this post! Keep in mind that you have to compile my Decrypt9 version yourselves to try it. We're still working on streamlining this, and there might even be a GUI later on.
----------------------------------------------------------------------------------------------------
Well, 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.
One solution for that problem is injecting FBI into the H&S app. There's the FBI inject generator by Riku, and rxTools FBI injector uses the exact same files generated by that. Riku's tool uses the TMD to identify the H&S version and selects from a range of "precompiled" FBI inject files. Two problems with that: [1] you can't inject a recent version of FBI and [2] this is not available for N3DS. Add to that [3], it might make sense to inject apps other than FBI over H&S now or in the future.
So, what if we could create valid inject files for any app?
I started this over at 4DSdev.org, and, basically, with a lot of help from @Syphurith, we have already figured out what to do. Check out my post here. The thread is pretty short, so you can also read it completely.
Now, the problem left is - how to streamline the process? Asking GBAtemp members here. it is not simple to do, and the known tools (Makerom/CTRtool/3DStool) won't do the trick - at least not on their own. Any help is appreciated! If you don't know how to do all that stuff, even if you know how to streamline it in part will help.
----------------------------------------------------------------------------------------------------
Well, 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.
One solution for that problem is injecting FBI into the H&S app. There's the FBI inject generator by Riku, and rxTools FBI injector uses the exact same files generated by that. Riku's tool uses the TMD to identify the H&S version and selects from a range of "precompiled" FBI inject files. Two problems with that: [1] you can't inject a recent version of FBI and [2] this is not available for N3DS. Add to that [3], it might make sense to inject apps other than FBI over H&S now or in the future.
So, what if we could create valid inject files for any app?
I started this over at 4DSdev.org, and, basically, with a lot of help from @Syphurith, we have already figured out what to do. Check out my post here. The thread is pretty short, so you can also read it completely.
d0k3 at 4DSdev.org said:Well, I can explain why it is identical with the one from rxTools - that's because rxTools uses Riku's inject files. Also, RomFS is not empty - it contains a dummy file to reach the desired file size (same size as H&S).
The remaining mystery now is the ExHeader - when comparing the proper inject ExHeader with the one gained from the FBI 1.3.8 CIA content 0 ExHeader, this is what is different:
0x000 - Application title ("safe" instead of "FBI", from H&S)
0x00E - Remaster version (has to be same as .app/.tmd number)
0x1C8 - Jump ID (has to be same as ACI program id, see below)
0x200 - Access control info (ACI) program id (taken from H&S)
0x248 - ACI file system access info (FBI + H&S permissions combined)
0x600 - ACI2 program id (taken from H&S)
0x648 - ACI2 file system access info (FBI + H&S permissions combined)
Info taken from 3Dbrew.org. Mystery solved? I think so! We need to try this, though, and coding this won't be simple.
d0k3 at 4DSdev.org said:Continuing from yesterday... The actual NCCH header only has the offsets, sizes and hashes for ExeFS and RomFS modified (which is understandable) + the hash for the ExtHeader.
Now, what do we need to do?
1. Build new (valid, hashes need to be correct) ExeFS with .code from FBI, all other files H&S
2. Build new (valid, hash needs be correct) RomFS with a dummy file (this is so that the resulting app is the exact same size as H&S
3. Create the ExtHeader as I wrote above
4. Adapt the NCCH header from H&S as I wrote above
5. Take plain region & logo region from H&S
6. Adapt the hashes in the H&S .TMD
7. Put all that stuff together
I guess CTRtool & Makerom will be able to do a lot of that stuff, and for the remainder, a small program I'll code will do. I didn't get your fix TMD code to work, though. Any more ideas?
Now, the problem left is - how to streamline the process? Asking GBAtemp members here. it is not simple to do, and the known tools (Makerom/CTRtool/3DStool) won't do the trick - at least not on their own. Any help is appreciated! If you don't know how to do all that stuff, even if you know how to streamline it in part will help.
Last edited by d0k3,