This is the header from the MoPaQ or mpq file blizzard entertainment uses.
Code:
00h: char(4) Magic Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
04h: int32 HeaderSize Size of the archive header.
08h: int32 ArchiveSize Size of the whole archive, including the header. Does not include the strong digital signature,
if present. This size is used, among other things, for determining the region to hash in computing
the digital signature. 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).
0Ch: int16 FormatVersion MoPaQ format version. MPQAPI will not open archives where this is negative. Known versions:
0000h Original format. HeaderSize should be 20h, and large archives are not supported.
0001h Burning Crusade format. Header size should be 2Ch, and large archives are supported.
0Eh: int8 SectorSizeShift 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^SectorSizeShift.
Bugs in the Storm library dictate that this should always be 3 (4096 byte sectors).
10h: int32 HashTableOffset Offset to the beginning of the hash table, relative to the beginning of the archive.
14h: int32 BlockTableOffset Offset to the beginning of the block table, relative to the beginning of the archive.
18h: int32 HashTableEntries 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.
1Ch: int32 BlockTableEntries Number of entries in the block table.
Fields only present in the Burning Crusade format and later:
20h: int64 ExtendedBlockTableOffset Offset to the beginning of the extended block table, relative to the beginning of the archive.
28h: int16 HashTableOffsetHigh High 16 bits of the hash table offset for large archives.
2Ah: int16 BlockTableOffsetHigh High 16 bits of the block table offset for large archives.
MPQ files get much larger than 4gb.
I am looking for a similar approach.
Thanks for the valued input.
How would I go about getting the address of the first byte?