This prints out information for an individual bank.
If the RvtH object only has one bank, it's assumed to be a standalone
disc image instead of an RVT-H HDD image.
c_std_99 was added in CMake 3.8, which is a fairly recent version.
Ubuntu 17.04 has CMake 3.9, but 16.10 has 3.7.2. Hence, we shouldn't
use it in order to remain compatible with at least Ubuntu 16.04 LTS.
This checks the ticket issuer and common key index in order to determine
the encryption key. In addition, if the hash verification and no-crypto
flags are set in the disc header, encryption is assumed to be disabled.
Ticket issuer is still checked to determine the certificate type.
[rvthtool] main.c: Print Wii encryption and signature types.
This error caused Wii DL and GameCube images to be ripped with the wrong
lengths.
This fixes a regression from commit e8bd9535a2.
([librvth] Split RVTH_BankEntry initialization into a separate function.)
This allows us to indicate how many banks are in the RvtH object,
which will let us use the same object for individual discs.
TODO: Detect individual discs vs. RVT-H images using heuristics.
[rvthtool] main.c: Use rvth_get_BankCount() to get the actual number
of banks in the RVT-H disk image instead of hard-coding 8.
This should make it easier to support both RVT-H disk images and
standalone disc images.
TODO: Add a function to open a standalone disc image, and later add
support for CISO and WBFS.
This will allow us to reuse RvtH_BankEntry for standalone disc images.
When opening an RVT-H image, the FILE* pointer will be copied to each
bank entry. This includes "unknown" banks.
TODO: Support opening standalone disc images as if they're an RVT-H
disk image with a single bank.
rvth_open(), rvth_get_BankEntry(): Added an optional parameter to
retrieve the error code. This may either be a negative POSIX error code,
or a positive error code from RvtH_Errors.
rvth_open(): Check the NHCD bank table magic number. If it's incorrect,
fail and return RVTH_ERROR_NHCD_TABLE_MAGIC.
rvth_extract(): If the bank is empty, fail and return RVTH_ERROR_BANK_EMPTY.
Preset the file size using fallocate() if the function is available.
Note that this does not work on Windows. (The fseek will simply write
the blank data as normal data.) I'll have to implement sparse writing
on Windows using low-level file I/O instead.
- win32-msvc.cmake: Fix copy/paste errors from GCN MemCard Recover.
- stdbool.h was added in MSVC 2013, so define the boolean types manually
if it isn't available.
- MSVC 2010 doesn't support C99, so we have to declare variables at the
beginning of blocks.
- main() needs to be __cdecl. (Or, I could remove the /Gz option I added
to rom-properties in order to reduce the binary size a bit, but I'd
rather keep that in.)
This function extracts the specified bank to the specified filename.
A callback may be specified to monitor progress.
main.c: Added a third command line parameter for "bank to extract".
If a third parameter, a bank number (1-8), is specified, that bank will
be extracted to BankX.gcm, where X is the bank number.
TODO: Use getopt() or popt for command line parsing.
This provides a C interface for opening an RVT-H disk image and
retrieving bank information. rvth.c provides a higher-level abstraction
than the raw disk tables (now referred to as NHCD), which makes it
easier to e.g. print disc names and timestamps.
rvth_open() parses the RVT-H bank table and disc headers in order to get
all of the necessary information. It also checks for deleted disc images
and marks them as such.
Deleted images are identified and marked as such. Note that deleted
dual-layer Wii images are currently identified as single-layer, since
we aren't parsing the FST to determine the highest disc address.
This program will allow for managing Nintendo RVT-H Reader devkits,
including dumping existing images and installing new images.
The current version doesn't actually do anything. It's mostly a copy
of the infrastructure from rom-properties, with some changes. In
particular, we're using CMake's TARGET_COMPILE_FEATURES() instead of
manually detecting C99 support.