[Testing needed] Add support for decrypting gamecart saves#963
Open
ZeroSkill1 wants to merge 6 commits intod0k3:masterfrom
Open
[Testing needed] Add support for decrypting gamecart saves#963ZeroSkill1 wants to merge 6 commits intod0k3:masterfrom
ZeroSkill1 wants to merge 6 commits intod0k3:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for decrypting and reading the inner DISA save image stored on gamecarts.
For gamecarts using SPI flash for save data, this also processes the underlying wear leveling layer (that is, the blockmap and journal) and reconstructs the save image accordingly.
All possible crypto methods should be supported (but not all have been tested yet, see below).
Currently, this feature only provides read access to the decrypted save data. (would be half of what #726 is asking for)
The decrypted save image is provided as an additional file in the gamecart (
C:) drive, as{title_id}_v{version}.dec.sav. For carts using wear leveling, the decrypted save image will be smaller than the raw version by exactly one flash sector (4 KiB) due to the wear leveling blockmap and journal being stored in it. For CARD2 carts both versions will be equal in size because those carts do not implement wear leveling.In addition, these changes have been made to the gamecart code:
.txtfile of the gamecart drive for 3DS cartridgesExample (Super Mario 3D Land):
More testing is required as I do not personally have all possible types of cartridges. Here are the ones I have tested:
Test build available here.
Feel free to share test results. Working means you can mount the DISA image and see plaintext save data (or visible
DISA,DIFI,DPFS, andIVFCmagic in the hex editor). Please include the.txtfile GodMode9 generates in the gamecart drive when doing so. If something doesn't work right, please also provide thencsd.binof your cartridge (can be extracted from the .3ds file by mounting it - only the last 0x100 bytes of the whole 0x200 bytes are necessary in this case).The following cart types need testing (checked entries mean these have been tested to be working by other users):