Understand the `wia_except_list_t` structure in WIA files
masterIn WIA files, each wia_group_t of Wii partition data contains one or more wia_except_list_t structs. These structs describe differences between the hashes of the partition data and the original hashes.
Key details for implementation:
- Quantity: The number of
wia_except_list_tstructs perwia_group_tis calculated aschunk_size / 0x200000. This applies even if the group contains less data than a full chunk. - Capacity: When writing code to read WIA files, assume a single
wia_except_list_tcan handle at least 3328 exceptions (52 * 64). - Compression Behavior:
- PURGE: Structs are stored uncompressed (before the first
wia_segment_t). - BZIP2, LZMA, LZMA2: Structs are compressed along with the rest of the data.
- NONE and PURGE: If the end offset of the last
wia_except_list_tis not divisible by 4, 4-byte alignment padding is inserted. This padding is not used for other compression methods.
- PURGE: Structs are stored uncompressed (before the first
Structure:
u16 n_exceptions: The number ofwia_exception_tstructs.wia_exception_t exception[n_exceptions]: The actual exception data.