Views: 1,614,699 | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 12-22-24 05:32 AM |
Guest: |
0 users reading Pre-patched: Rebuild a exefs as you like! Then HANS? | 1 bot |
Main - Homebrew discussion - Pre-patched: Rebuild a exefs as you like! Then HANS? | Show post layouts | New reply |
Syphurith |
| ||
Member Normal user Level: 18 Posts: 38/59 EXP: 26209 Next: 3688 Since: 10-26-15 Last post: 3265 days ago Last view: 3215 days ago |
Yeah i've manipulated it and got pre-patched version of Culdprit on my console minutes ago.
If you already know and can do these.. I would thank you for helping others or a simple leave. To have an already patched version of any app, you might need to replace romfs and exefs contents. To repack a romfs is not hard; you can use 3dstool like this: 3dstool -cvtf romfs romfs.bin --romfs-dir romfs Just similar as what you did to it for unpacking:3dstool -xvtf romfs romfs.bin --romfs-dir romfs
The exefs pack/unpack is something similar, but a header is required to rebuild it. This header is indeed the 0x200 bytes from the exefs.bin, so you can ever pass it as arguement. You can play with the packing safely without touching the files. However once you replaced code.bin or something else in the folder, the hashes, offsets and sizes go wrong, even 3dstool itself could pack them into a exefs.bin but not be able to unpack it again. So says, that invalids the exefs.bin. I've written a small tool just for this situation. It would calculate the size and offset and hashes. However the tool doesn't handle the LZ77 compression/decompression, so you would have the code.bin in compressed format to use this tool. Unpack:3dstool -xvtf exefs exefs.bin --exefs-dir exefs --header exefsheader.bin The tool:FixExefsHdr exefsheader.x exefs And you can rebuild it again: 3dstool -cvtf exefs exefs.bin --exefs-dir exefs --header exefsheader.x
And yes you can unpack it with 3dstool or something else to get the uncompressed code.bin.
Then what this could be to HANS? Any CXI unpacked using 3dstool have at the most 6 parts, NCCH Header, ExtHeader, Plain, Logo, Romfs and Exefs, and the first 4 of them is almost contain no content of the game itself. I've heard HANS can redirect the flows of reading Romfs and Exefs to SD, thus some Games get Tranlasted on a newer firmware than 9.2. If that doesn't ask for file size, a pre-patched romfs and exefs may be good news for HANS users. Anyway, that is not hard to rebuild a CXI or CIA. To get a pre-patched CIA you would need more steps. 1.Decrypt both the main CIA and its patch you wanna apply. Just use decrypt9 for this. 2.Unpack all both stuffs. Use ctrtool: ctrtool -i -y --content=c --tmd=tmd TheCIA.cia. 3.Find which the patch would apply on, by checking the titleid, programid, jumpid with ctrtool and those contents. 4.Unpack the target CXI and patch CXI, for example c.0000.00000000, to get all its stuffs. Use 3dstool, not ctrtool. 5.Unpack both exefs.bin, romfs.bin. Then replace the original files using what from patch. 6.Rebuild the exefs.bin and pack romfs.bin back. 7.You would need to Use my MergeExHeader to merge both exheaders in order to update the service table or more. 8.Since the MergeExHeader is original made for injection APP, you would have to at least patch the SaveData Size (original), Jump id(Original), and remaster version(Patch). If you don't know what should patch, and meet a fail, use ctrtool for the info and compare the output, pick what you like and see 3dbrew for tips of finding the offset inside the exheader. 9.Since two CXI have different content types you would have to rebuild the CXI carefully. Do remember use the original NCCH header extracted. You can decide other parts in a order, From where to get the file: Merged/Rebuilt part, Patch part, Original part. 10.You can then use makerom to create the CIA. Notice the order described in TMD! So: makerom -f cia -o a.cia -content 0000.cxi:0:0 -content ori\c.0001.00000002:1:2
Then? You've get the file, and just test it out with your own console!
Thanks for reading my text. I'm not good at english at all. The needed files by me in this thread: MergeExHeader/FixExefsHdr/savedatasizefix You can freely modify/distribute, if someone would like to get those hosted on github and maintain -- Thanks so much! |
Yoshi |
| ||
Member Normal user Level: 11 Posts: 16/18 EXP: 4431 Next: 1554 Since: 10-03-15 Last post: 3316 days ago Last view: 3314 days ago |
Is this better than ctrtool? I'm unable to use ctrtool as it gave me "not compatible" error, dunno why it happens.... plus none has responded my question on reddit yet.
Does it support 32-bit? Getting the same error won't help me getting closer to modding 3ds games |
Syphurith |
| ||
Member Normal user Level: 18 Posts: 39/59 EXP: 26209 Next: 3688 Since: 10-26-15 Last post: 3265 days ago Last view: 3215 days ago |
Posted by Yoshi You could compile it yourself if the executable could not run. BTW 3dstool can be built with VS or CMake. I like to compile those myself to get the edge version, with MSYS2. ctrtool is designed to unpack/pack/modify the NCCH files. Especially for translation. If what you need is unpack/pack CIA, or list the file details you still need to have ctrtool and makerom. Incompatible may due to the toolchain it used to build the tool. VS2013 is without XP support by default. |
Syphurith |
| ||
Member Normal user Level: 18 Posts: 40/59 EXP: 26209 Next: 3688 Since: 10-26-15 Last post: 3265 days ago Last view: 3215 days ago |
Some notes about its limit: Can be used to build a pre-patched game. Can't used to embed DLC into the game.
Actually you can get the DLC CIA itself merged into the game, however it would not be recognized. You would need to keep DLC itself be installed standalone, since that is not in a same type of contents. So you can not use this to avoid the region lock with DLC CIAs. If you need so you can get NTR with locale emulation. However you could properly merge multiple DLC CIAs into one what is exactly much easier. Eh.. Wait. I'm remembered something strange about DLCs. A game merged with DLC could not recognize its included DLC, but if DLC is installed standalone and in the region it would get recognized. Thought of the design of NTR locale emulation plugin. It checks if Title has some plugins connected to trigger the emulation. All emulation plugin for regions differs only in a byte that shows which region it would be. Maybe there is better solution for it to get the region check itself removed so every time game query for its DLC, the system would ignore the region and return the values. However this is not easy to be done, and i am sure myself can not do this in at least several years. Well a patched version is already enough for translated contents with HANS now. |
Main - Homebrew discussion - Pre-patched: Rebuild a exefs as you like! Then HANS? | Show post layouts | New reply |
Page rendered in 0.023 seconds. (2048KB of memory used) MySQL - queries: 26, rows: 69/69, time: 0.005 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |