namespace SabreTools.Data.Models.WIA { /// /// WIA / RVZ second header (0xDC bytes). /// Immediately follows WiaHeader1 in the file. /// All multi-byte fields are big-endian on disk; the reader converts to host order. /// public sealed class WiaHeader2 { /// /// Disc type: 1 = GameCube, 2 = Wii /// /// Big-endian public WiaDiscType DiscType { get; set; } /// /// Compression algorithm applied to group data /// /// Big-endian public WiaRvzCompressionType CompressionType { get; set; } /// /// Informational compression level used when writing (1-9) /// /// Big-endian public int CompressionLevel { get; set; } /// /// Group / chunk size in bytes. /// WIA requires exactly 2 MiB; RVZ accepts powers of 2 between 32 KiB and 2 MiB. /// /// Big-endian public uint ChunkSize { get; set; } /// /// First 0x80 bytes of the disc image (unencrypted disc header) /// /// 0x80 bytes public byte[] DiscHeader { get; set; } = new byte[0x80]; /// /// Number of PartitionEntry structures that follow the raw-data entries /// /// Big-endian public uint NumberOfPartitionEntries { get; set; } /// /// Size of each PartitionEntry in bytes /// /// Big-endian public uint PartitionEntrySize { get; set; } /// /// File offset of the PartitionEntry array /// /// Big-endian public ulong PartitionEntriesOffset { get; set; } /// /// SHA-1 hash of all PartitionEntry data /// /// 20 bytes public byte[] PartitionEntriesHash { get; set; } = new byte[20]; /// /// Number of RawDataEntry structures /// /// Big-endian public uint NumberOfRawDataEntries { get; set; } /// /// File offset of the RawDataEntry array /// /// Big-endian public ulong RawDataEntriesOffset { get; set; } /// /// Total size in bytes of all RawDataEntry structures /// /// Big-endian public uint RawDataEntriesSize { get; set; } /// /// Number of group entries (WiaGroupEntry or RvzGroupEntry) /// /// Big-endian public uint NumberOfGroupEntries { get; set; } /// /// File offset of the group-entry array /// /// Big-endian public ulong GroupEntriesOffset { get; set; } /// /// Total size in bytes of all group entries /// /// Big-endian public uint GroupEntriesSize { get; set; } /// /// Number of valid bytes in /// public byte CompressorDataSize { get; set; } /// /// Algorithm-specific compressor parameters (up to 7 bytes). /// LZMA: 5-byte prop block. LZMA2: 1-byte dict-size code. Others: unused. /// /// 7 bytes public byte[] CompressorData { get; set; } = new byte[7]; } }