Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using latest NDecrypt for 3DS decryption #11

Open
InternalLoss opened this issue Apr 28, 2023 · 1 comment
Open

Issue using latest NDecrypt for 3DS decryption #11

InternalLoss opened this issue Apr 28, 2023 · 1 comment
Assignees

Comments

@InternalLoss
Copy link

When decrypting a 3DS CCI (cart image) on my Mac using either the latest x64 release or building it directly with dotnet build, I get an incorrect decrypted hash:

❯ ./NDecrypt d -k aes_keys.txt 00040000001A0500_v02.3ds
00040000001A0500_v02.3ds
File recognized as Nintendo 3DS
Encryption Method: Key 0x25
Partition 0 ExeFS: Decrypting: ExHeader
Partition 0 ExeFS: Decrypting: ExeFS Filename Table
Partition 0 ExeFS: Decrypting: 4 / 4 mb... Done!
Partition 0 RomFS: Decrypting: 361 / 361 mb... Done!
Encryption Method: Key 0x2C
Partition 1 ExeFS: No Extended Header... Skipping...
Partition 1 ExeFS: No Data... Skipping...
Partition 1 RomFS: Decrypting: 3 / 3 mb... Done!
Partition 2 Not found... Skipping...
Partition 3 Not found... Skipping...
Partition 4 Not found... Skipping...
Partition 5 Not found... Skipping...
Encryption Method: Key 0x2C
Partition 6 ExeFS: No Extended Header... Skipping...
Partition 6 ExeFS: No Data... Skipping...
Partition 6 RomFS: Decrypting: 10 / 10 mb... Done!
Encryption Method: Key 0x2C
Partition 7 ExeFS: No Extended Header... Skipping...
Partition 7 ExeFS: No Data... Skipping...
Partition 7 RomFS: Decrypting: 39 / 39 mb... Done!
❯ sha256sum 00040000001A0500_v02.3ds
e606b9875e5e864d5ae207e3681c2a9429110ed943136f41ad65850c2f4badc4  00040000001A0500_v02.3ds
❯ sha1sum 00040000001A0500_v02.3ds
877bddfe701edabf07f733ef84b064cccd2d9498  00040000001A0500_v02.3ds

The expected hash (that 3ds_decrypt_v4.py produces) is SHA-1 94aac90f8b9d9c6f69d24c58ca53ecf205d1c248 and SHA-256 7fb81e592307e56f7b2dc85d72a0bc668dca427d3c812737deda2fcac8adde62

However, when re-encrypting using the program, it will issue the correct encrypted hashes.

@mnadareski
Copy link
Contributor

Testing the same cart and subsequent encrypted image, the decrypted file is parsed properly by other third-party tools and emulators. There's a nonzero chance that there's an issue further into the game, but nothing was apparent from the outset.

@mnadareski mnadareski self-assigned this Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants