namespace SabreTools.Data.Models.MoPaQ { /// /// MoPaQ archive header /// /// public sealed class ArchiveHeader { #region V1 Properties /// /// The MPQ archive signature /// public string Signature { get; set; } = string.Empty; /// /// Size of the archive header /// public uint HeaderSize { get; set; } /// /// Size of MPQ archive /// /// /// This field is deprecated in the Burning Crusade MoPaQ format, and the size of the archive /// is calculated as the size from the beginning of the archive to the end of the hash table, /// block table, or extended block table (whichever is largest). /// public uint ArchiveSize { get; set; } /// /// 0 = Format 1 (up to The Burning Crusade) /// 1 = Format 2 (The Burning Crusade and newer) /// 2 = Format 3 (WoW - Cataclysm beta or newer) /// 3 = Format 4 (WoW - Cataclysm beta or newer) /// public FormatVersion FormatVersion { get; set; } /// /// Power of two exponent specifying the number of 512-byte disk sectors in each logical sector /// in the archive. The size of each logical sector in the archive is 512 * 2 ^ BlockSize. /// public ushort BlockSize { get; set; } /// /// Offset to the beginning of the hash table, relative to the beginning of the archive. /// public uint HashTablePosition { get; set; } /// /// Offset to the beginning of the block table, relative to the beginning of the archive. /// public uint BlockTablePosition { get; set; } /// /// Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for /// the original MoPaQ format, or less than 2^20 for the Burning Crusade format. /// public uint HashTableSize { get; set; } /// /// Number of entries in the block table /// public uint BlockTableSize { get; set; } #endregion #region V2 Properties /// /// Offset to the beginning of array of 16-bit high parts of file offsets. /// public ulong HiBlockTablePosition { get; set; } /// /// High 16 bits of the hash table offset for large archives. /// public ushort HashTablePositionHi { get; set; } /// /// High 16 bits of the block table offset for large archives. /// public ushort BlockTablePositionHi { get; set; } #endregion #region V3 Properties /// /// 64-bit version of the archive size /// public ulong ArchiveSizeLong { get; set; } /// /// 64-bit position of the BET table /// public ulong BetTablePosition { get; set; } /// /// 64-bit position of the HET table /// public ulong HetTablePosition { get; set; } #endregion #region V4 Properties /// /// Compressed size of the hash table /// public ulong HashTableSizeLong { get; set; } /// /// Compressed size of the block table /// public ulong BlockTableSizeLong { get; set; } /// /// Compressed size of the hi-block table /// public ulong HiBlockTableSize { get; set; } /// /// Compressed size of the HET block /// public ulong HetTableSize { get; set; } /// /// Compressed size of the BET block /// public ulong BetTableSize { get; set; } /// /// Size of raw data chunk to calculate MD5. /// /// MD5 of each data chunk follows the raw file data. public uint RawChunkSize { get; set; } /// /// MD5 of the block table before decryption /// /// 0x10 bytes public byte[] BlockTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the hash table before decryption /// /// 0x10 bytes public byte[] HashTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the hi-block table /// /// 0x10 bytes public byte[] HiBlockTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the BET table before decryption /// /// 0x10 bytes public byte[] BetTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the HET table before decryption /// /// 0x10 bytes public byte[] HetTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the MPQ header from signature to (including) HetTableMD5 /// /// 0x10 bytes public byte[] MpqHeaderMD5 { get; set; } = new byte[0x10]; #endregion } }