If no parameters are specified, the encryption key is changed, but
the format is kept the same. This also applies if the encrpytion key
is specified but the format is not.
If the format is specified but the key is not specified, then only
the format is changed.
Stupid logic errors for wad->wad, wad->bwf, etc. due to hard-to-understand
comparisons instead of using boolean logic.
All of my local tests work now.
TODO: Handle the meta and crl sections better.
This allows conversion of retail BWF to debug and vice-versa.
BWFs are no longer converted to WAD format by default. Specify the
`--format` option to select the format.
TODO:
- BWF->BWF was tested. Need to test BWF->WAD.
- Allow converting just the format without recrypting.
While the actual contents might not be a multiple of 16 bytes, AES
operates in blocks of 16 bytes, so we have to copy the extra unused
bytes in order to decrypt the data properly.
This fixes recryption of various IOSes (including IOS58-64-v6176.wad)
and possibly other WADs.
This fixes issue #7: wadresign: Re-signing an IOS misses the last 8
data bytes, resulting in a broken WAD.
ALIGN() is already defined in FreeBSD's machine/align.h. It takes a
single parameter (byte count) which it aligns to the system's native
register size.
ALIGN_BYTES() takes a byte count and aligns it to the specified value.
Based on rom-properties commit b9bd306bb57bc28fb94a87865db4870403b73e57.
Pokémon Rumble and My Pokémon Ranch both have large footers for some
reason. These might be actual data files instead of build info.
resign-wad.c: Print the footer size, not the TMD size, when printing
an error indicating that the footer size is too big.
TODO: Actually disable writing operations in the UI if the NHCD table is
missing. Currently, the buttons are still enabled, but attempting to do
a write operation will fail with an error message. (Well, error code,
since it doesn't show an actual message yet...)
This is useful for e.g. Super Smash Bros. Brawl, which uses IOS36.
The debug version of IOS36 seems to be MIA, so we can change it to
IOS56 and it basically works, though Apploader will show a warning.
TODO: Detect the IOS mismatch and show an Apploader warning here
when listing bank information.
If we don't set windowTitle, then Qt will use windowFilePath to
automatically prepend the filename portion to the application title.
It will also automatically handle the Mac OS X proxy icon.
(TODO: Adjust our own proxy icon code for this?)
Based on GCN MemCard Recover's version, with some changes from
rom-properties' KDE rp-config.
The scroll area code from mcrecover is kept here because I think that's
needed for certain Windows versions, whereas rom-properties doesn't use
Qt on Windows.
There's no slashes in these relative paths, so we end up trying to
statvfs() a file that doesn't exist, which results in ENOENT.
This is probably a regression from commit 6683d7fbc7.
([librvth] RvtH::extract(): Check free disk space before extracting.)
cert_fakesign_ticket() and cert_realsign_ticket() now take uint8_t* and
size parameters instead of RVL_Ticket*. This allows us to correctly sign
larger tickets.
TODO: librvth, rvthtool: Handle larger tickets. I haven't seen any larger
tickets in disc images yet, though...
The root certificate isn't found on discs or WADs, so that's not a valid
return value here.
This fixes an issue where certain broken WADs with a NULL byte located
before the issuer showed up as signed by "Root". (Should be unknown.)