This also fixes#958
Original commits:
* initial work on cart save crypto/wearleveling
* add support for n3ds only save crypto
* use existing crc16 impl for save blockmap
* fix missing aeskey select for card2 save decrypt
* fix old/new cart media being swapped
* fix 1 MiB save chips / blockmap type 2
* move cart save wearleveling/crypto to separate file
* try 2nd wearlevel header on fail + minor fixes
* save_ctr: zero out savectx before reading fallback header
This commit looks a lot bigger than it really is, I noticed a couple spots where with these issues so I ran a regex to find all possible occurrences and switched all that could be, after manually ensuring it was actually correct
Using sizeof on the buffer (as long as the buffer is a char *array*, not a pointer!!) greatly reduces the chance of something having the wrong size because of a later change to the buffer, notably a couple snprintfs were missed in the UTF_BUFFER_BYTESIZE change
Fixes#703 and is only active with `make LARGEDLC=1` and will break compatibility with other titles and CIAs. Thanks @luigoalma for new ticket builder code!
attempting to open a file in a bdri mount for reading only which did not exist but had a valid name would create the file without ever unlocking appropriate write permissions
Except for cia building or loading cia just yet.
Added more checks on ticket content index, mainly due to having effects
in the ticket format itself, and are unknown still.
Ability to determine ticket size.
Verify signature with ticket's proper size.
Changes to use the new Ticket struct with the flexible array member.
This is meant to replace the Prompt I was using previously.
Fun fact: WarioWare DIY seems to have *something* on the SPI bus, as it
returns an ID of 0x000001 consistently. Or am I just glitching the
parallel flash? Or did I get a fake?