shijimasoft / cia-unix

Decrypt CIA/3DS roms in UNIX environments (Linux and macOS)
Apache License 2.0
111 stars 14 forks source link

How to reassemble decrypted .ncch partition files back into a .3ds file? #18

Closed udance4ever closed 6 months ago

udance4ever commented 6 months ago

Hi! There’s no discussion tab so apologies for posting this question as an issue.

I have your experimental python3 script working in Batocera Linux in a virtualenv.

giving it an encrypted .3ds file it writes a .Main.ncch, .Manual.ncch, .N3DSUpdateData.ncch and .UpdateData.ncch files which I assume are the extracted partitions.

Do I use another command to reassemble the decrypted partitions into a .3ds file again?

I tried to download makerom but couldn’t make heads or tails of the usage.

ibyrd1 commented 6 months ago

I'm wondering the same thing as @udance4ever . I'm fairly new to ROMs so I'm not sure what these files are or if they are needed for the game to work now.

udance4ever commented 6 months ago

@ibyrd1 welcome to the adventure! 🥾

until we get some input into what .ncch files are - this utility works great in Python 2.7:

https://github.com/b1k/b3DS

I am still hoping to use cia-unix as it is actively being maintained with support for Python3!

shijimasoft commented 6 months ago

Thank you for posting this question. The decrypt.py file is only a module of the cia-unix program, so it was not designed to run independently. To decrypt and recompress a .3ds file, you should run the ./cia-unix command in the same folder where the ROM is located (along with the necessary modules: makerom, ctrtool, and decrypt.py). cia-unix will take care of the whole process and if any dependencies are missing it will ask you to install them (by running the dltools.sh file, make sure it has run permissions with chmod +x dltools.sh)

About the python3 version: it is still in slow development, but thanks to the github community it has made a lot of progress.. The goal is to make all modules native (which is why I'm rewriting the decrypt.py module in rust) so installing dependencies will become much easier in the future.

shijimasoft commented 6 months ago

Can I consider the issue solved ?

shijimasoft commented 6 months ago

I will close the issue, if you have other problems related to that, please write them in this issue pinging me. Thank you :)

udance4ever commented 6 months ago

oh! no problem. yes, consider this issue closed (I will be sure to do this next time a question I ask is answered).

Next I need to decrypt a .3ds file, I will make a point to use the cia-unix command directly. Thank you for the clear explanation & instructions (and pique my curiosity into what makes Rust great! 👀)