* Correct installable address whitelist
blacklist is stored at 0xb088~0xb0bf, which is ulong[14] in
{start(inclusive), end(exclusive)} pair.
one thing to note is that boot9 use inclusive comparing with
blacklist start for both section load address and
section load address + section size (comparing logic is
at 0xa42e~0xa449), so if the firm fits perfectly at the end
of the space right before the blacklisted range,
it'll also be rejected.
* shrink vram drive size to avoid bleeding into blacklisted range
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
* Fixed inability to install a larger ticket when a smaller one is installed
* improved AddBDRIEntry checks, formatting and added define for REPLACE_SIZE_MISMATCH
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!
Since in all cases that LoadCertFromCertDb is called
is always twice, one for sysnand and another for emunand
just make it a single call and quit early when cert found.
At least in the caller perspective.
Also break down some functionalities into separate funcs,
interally calling them on cert.c to avoid too many checks.
And tried to avoid too much repeated code.
- properly performs gpu/backlight reset
- nukes vram so the initrd had to be moved to arm9 memory, and have its size (at least temporarily) limited to 256k
* fix a bug in ReadTicketFromDB that would fail to read tickets that were not a specific size
* fix the endianness of the title IDs outputted by ListBDRIEntryTitleIDs
* improve the speed of ReadBDRIEntry and GetBDRIEntrySize by taking advantage of the hash table
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.