d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.12k stars 191 forks source link

Feature Request - Reverse-LZSS Decompress exefs/.code to code.bin #98

Closed shane-tw closed 7 years ago

shane-tw commented 7 years ago

Adding this as an option to the context menu would be nice, as it'd mean not having to run

ctrtool -t lzss --lzssout=code.bin .code

in ctrtool afterwards.

d0k3 commented 7 years ago

Agreed, this would be a good addition.

phijor commented 7 years ago

Maybe this could be added in the form of a virtual file when mounting a NCCH-container? Code compression isn't a property of the .code contained in the exefs, rather it's enabled by a flag in the exheader of a NCCH. So instead of

romfs/
...
exefs/
|- .code
|- banner
`- icon

wouldn't it be possible to have something along the lines of

romfs/
...
exefs/
|- .code      (<- this is the uncompressed arm11 code)
|- .code.lzss
|- banner
`- icon

?

AnalogMan151 commented 7 years ago

I'd like to contribute my interest into this as well. It would be useful for extracting DSP1 firmware via script without the need for special homebrew.

d0k3 commented 7 years ago

Just as a note - good sample code for decrypting the code is found here: https://github.com/zoogie/DSP1/blob/master/source/main.c

Thanks, @AnalogMan151

TheCyberQuake commented 7 years ago

With that I would love if we had a way to simply dump dspfirm.cdc from one of the drives that already exist rather than manually using other script commands to find and pull dspfirm from home menu or mset.

d0k3 commented 7 years ago

Added in https://github.com/d0k3/GodMode9/commit/a6a15eb70d66e3c96bbc164598f9482bb545b3f9