Views: 1,610,144 | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 11-24-24 01:11 PM |
Guest: |
Main - Posts by d0k3 |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 41/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Using your stuff/3DStool/CTRtool I've build something that should work. See here:
http://wikisend.com/download/350650/UniversalInjectGen_v0.1.zip Howto: - Put H&S app & tmd into apptmd_hs/ folder (names do not matter) - Put CIA of app to inject into cia_inject/ folder (name does not matter - Run go.bat The only thing missing from this is encryption, but I'm sure we can handle this. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 42/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
... and one thing that popped into my mind right now... if there are multiple .app files, the TMD contains hashes for all .app files. So, not working for N3DS atm. You will need to adapt fixtmd for that.
Posted by Syphurith Great! Please check if the newly created .app has the same size as the H&S app. It should work regardless, but better be safe than sorry! Also, for your source code, I inserted the compile parameters for static executables, just in case you wonder. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 43/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith You need a decrypted H&S app. Forgot to say, sorry. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 44/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith Correct, the file needs to be encrypted for fixTMD. Forgot about that, too :/. Anyways, you can get CTRtool from here: https://github.com/profi200/Project_CTR/releases If required, just compile it anew. And I can't test, I only own a N3DS . |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 45/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith Alright! I'm just looking into the size issue. The v2050 has a a logo region, while the other one has not - that's the only problem I'm seeing so far. The actual problem, though, is that the RomFS created is too small by exactly 4kB. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 46/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith I'll wait until you update fixtmd, alright? in the meantime: http://wikisend.com/download/715352/UniversalInjectGen_v0.2.zip This should fix: * the wildcard issue for CTRtools * the size issue (output size should be correct now) * processing the logo.bin for .apps that have it From what I see this will generate an app identical to Riku's inject files, save for the RomFS. The difference in RomFS is only due to us using a different content for the dummy file, so no problem. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 47/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith That's fantastic news! Will try on N3DS EmuNAND later, too. Also keep in mind that the CIA to inject needs to be deep decrypted (which typical homwbrews are, anyways). |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 48/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith Posted by Syphurith Glad to hear it worked with DevMenu, too! I will streamline a lot of that by adding a new feature to Decrypt9. Decrypt9 can handle the TMD update, decryption and reencryption. And, of course we can generate xorpads for decrypted NCSD/NCCH, using the Python script and real hardware, of course. Or did you mean something else? |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 49/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith I'll try it this evening (my timezone, obviously) and will write about it afterwards. Moving everything to Decrypt9 would be too much, but... o I'll add one feature to extract & decrypt the H&S app from SysNAND o Generating the .app to inject would have to be handled on PC, obviously o And I'll add another feature to encrypt & inject the new app and also adapt the TMD in the process Not super convenient, but convenient enough, I think. Because of the decryption / encryption / xorpad generation, this can't be done without real hardware and Decrypt9 or similar anyways. If you have some ideas how to streamline it differently, that would be very good, too, as I don't want to force people to use Decrypt9. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 50/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith Thanks a ton for pointing that out! But, at 0x1BF in the NCCH header, there is nothing ("reserved area", see here). Did you mean 0x18F? As for the NodeJS version... does that require any additional stuff installed? To be pretty blunt, I'm hoping @Shadowtrance makes that GUI once we have that thing running stable enough . |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 51/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
@Syphurith, compared to my latest Windows .bat script - what is changed in your newest nodeJS script? Is it only the xorpad encryption, or is it more? |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 52/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
I didn't think about the xorpad problem, either. You could make your script generate the ncchinfo.bin on it's own, it's actually pretty easy.
Btw, you already saw it anyways, but everyone keeping an eye on this thread: Posted by d0k3 on GBAtemp.org |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 53/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
I mean this one:
void PowerOff()
{ i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 0); while (true); } On Github, @idgrepthat wrote: Posted by idgrepthat on Github Posted by idgrepthat on Github I think the shutdown functions of CTR Boot Manager and Quick Shutdown are different, because they don't operate on ARM9. Anyways, is there any more infos on the subject? A shutdown function would be pretty convenient, but it is of course not worth the price of messing up your 3DS. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 54/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
As some of you might already know, my own fork of Decrypt9 has options to decrypt NCCH/NCSD and CIAs. The NCCH/NCSD decryptor works fine with commercial CCIs and system apps, however I noticed just yesterday, that this isn't the case for homebrew .3DS files. If I try to decrypt them the same way, I just get broken output. So, what is different about the encryption in those (this is zero key encryption, right?), and how can I detect it? CTRtool and Makerom seem to handle that encryption just fine, but I haven't found the correct place in their source codes yet.
On another, slightly related note... I can decrypt homebrew CIAs just fine, but the content hashes in there seem to be all wrong. Again, there never was any trouble with verifying the hashes for commercial stuff (legit CIAs / custom CIAs from Riku's converter / CIAs built from CDN). Any ideas about that? If you need an example, btw, just check my own CTRXplorer or FBI. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 55/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by plutoo Thanks for your reply! Well, I tried it, and in fact it is now included as a hidden option in Decrypt9. I still find it suspicious, though. With that option, the console turns of so fast and also a big difference to the reboot function, which takes it's time. Don't know if I will keep that in. I'd prefer to do it the same way as f.e. Quick Reboot does it, but I also have no access to CTRUlib functions from Decrypt9. |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 56/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Dazzozo Alright, so with that flag set, a fixed key is used as AES NormalKey for encryption and everything else works as normal? I assume the zero key is all zeroes, and the systemkey is unknown. Because of the all-zeroes key, no actual hardware is needed for de-/encryption, but actual hardware would be required for decrypting with the fixed systemkey. Also, does this work with 7x / seed crypto? (might only make sense in theory) Plus, the thing about the hashes in homebrew CIAs... any ideas? |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 57/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Well, in theory, it should be pretty simple, but take a look at this code (from my Brahma fork):
s32 main (int argc, char **argv) {
The above doesn't work, all that is found in the start parameters is a few correct symbols for the first parameter (the payload), and then garbled stuff. I'm loading it via .XMLs, the same way HANS shortcuts are loaded. I'd just take a look into the HANS source code, but well, that isn't released yet. Any ideas?// Initialize services gfxInitDefault(); gfxSwapBuffers(); consoleInit(GFX_BOTTOM, NULL); if (brahma_init()) { if ((argc > 1) && (argc <= 4)) { char* payload = argv[1]; u32 offset = 0; u32 psize = 0; if (argc > 2) sscanf(argv[2], "%X", &offset); if (argc > 3) sscanf(argv[3], "%X", &psize); printf("[+] Loading %s@%X (size %X)\n", payload, offset, psize); load_arm9_payload(payload, offset, psize); firm_reboot(); printf("[!] Loading failed\n"); (...); |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 58/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Dazzozo Got it, and both of it. For the CIAs the problem was that I did not recognize that Metadata comes at the end of the file structure. Thanks a ton! |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 59/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
Posted by Syphurith I alreay got behind this, just check my Brahma2Loader source code . |
d0k3 |
| ||
Member Normal user Level: 20 Posts: 60/75 EXP: 38211 Next: 4228 Since: 06-04-15 Last post: 3253 days ago Last view: 3001 days ago |
This may sound like somewhat of a noob question, but I haven't found any way to do this yet, without coding it myself. From looking at the source code, I'm pretty sure Makerom would be capable of it, but there is just no method implemented to actually do it.
So, here's what I want to do: o Start with a fully decrypted CCI (made from a comercial cartridge, then decrypted via Decrypt9). Signatures are all bad at this point, of course. o Reencrypt everything (= all contents) with zerokey crypto (already have figured that out, no problem). o Now, also fix the signatures (target "development keys & certs" in makerom) for each and every content. That's the difficult step. => have a fully working (as in manual and all) zerokey encrypted rom for GW I don't even own a Gateway, just doing this for scientific purposes. In essence, what I'd need is a "zerokey signature fixer". Haven't found anything like that yet, though. The fact that this would only be of any use for GW makes it even less probable something like that exists, too. Any ideas? |
Main - Posts by d0k3 |
Page rendered in 0.027 seconds. (2048KB of memory used) MySQL - queries: 22, rows: 99/99, time: 0.005 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |