d0k3 / Decrypt9WIP

Multipurpose content dumper and decryptor for the Nintendo 3DS
GNU General Public License v2.0
404 stars 59 forks source link

Fix TWL dump filenames; add versions to CTR dump filenames and some other fixes. #144

Closed GerbilSoft closed 7 years ago

GerbilSoft commented 7 years ago

This PR fixes TWL dump filenames. When product version was added, a maximum field width wasn't specified, so the unitcode ends up getting appended, and that confuses some of the FatFS code.

Some additional changes:

d0k3 commented 7 years ago

Two things: (1) don't change the NcsdHeader struct like that. The NCSD header is 0x200 bytes, simply enlarging it is bound to lead to problems later on. And yes, I know I had a typo there. (2) I found no resources on the version number being there. At least it is not on 3dbrew. Do you have any more info?

EDIT: just to clarify this - I don't think the version being @0x312 is wrong. I did, however, check 3 cart dumps and just found zeroes there, so I need at least one resource to back this offset

GerbilSoft commented 7 years ago

I reverted the NcsdHeader change. Version number is now accessed with a (u8*) cast.

@einstein95 gave me the information for the version number a while back so I could add support in https://github.com/GerbilSoft/rom-properties . I've compared it to the version number on the back of the cartridge (7th digit) and it matches each one I have, including Smash Rev.05 and Sonic Generations Rev.01.

d0k3 commented 7 years ago

Well... you put the typo back in :). The last last "reserved" in that struct has to be 0x30 byte, not 0x40 byte as 3dbrew says. Can you just make this little change? I'll take this pr then.

GerbilSoft commented 7 years ago

Fixed the field.