Closed GerbilSoft closed 3 years ago
Okay, this already looks pretty good! It may also fix #457. Will this have any adverse effects on carts that previously worked?
This shouldn't affect other carts that worked before:
I don't think it'll fix dumping TWL dev carts. That requires using the TWL secure init command, but with a different Blowfish key. I did extract the Blowfish key, but I'm not sure if it can be included in GM9 directly, or if there's any way to properly distinguish between retail and dev carts.
Partially merged. The gamecart ID will be added to the filename, thus the additional file is not required. Everything else is included.
We've encountered a few NTR dev cartridges that have TWL-enhanced ROM images flashed to them. These cartridges work fine on a Nintendo DS, and on some 3DS units. Attempting to dump them with GodMode9 (and wooddumper) fails because the ROM header indicates that the cartridge is TWL-enhanced, but the NTR dev cart doesn't support the TWL secure area init command (0x3D), so TWL key exchange fails.
This PR checks the TWL flag in the chip ID. If it's not present, then it won't attempt to use TWL secure area init, even if the TWL flag is set in the ROM header.
We're also using the ROM size value in the chip ID now for the full cartridge size if it's present. If not, it falls back to using the ROM header value.