eagleflo / mpyq

Python library for reading MPQ archives.
BSD 2-Clause "Simplified" License
99 stars 23 forks source link

Support MPQ format versions 3 and 4 #20

Open eagleflo opened 11 years ago

eagleflo commented 11 years ago

See #19 for more details.

daynekilheffer commented 11 years ago

I started working on the header parsing in my fork.

From a recent replay of HOTS
MPQ archive header
------------------
magic                          'MPQ\x1a'
header_size                    208
archive_size                   83030
format_version                 3
sector_size_shift              5
hash_table_offset              82582
block_table_offset             82838
hash_table_entries             16
block_table_entries            12
extended_block_table_offset    0
hash_table_offset_high         0
block_table_offset_high        0
archive_size_64                83030
bet_table_position_64          82315
het_table_position_64          82231
hash_table_size_64             256
block_table_size_64            192
hi_block_table_size_64         0
het_table_size_64              68
bet_table_size_64              251
raw_chunk_size                 16384
offset                         1024

MPQ user data header
--------------------
magic                          'MPQ\x1b'
user_data_size                 512
mpq_header_offset              1024
user_data_header_size          60
content                        '...'

I'm not 100% on how to handle the het/bet values yet. I'm pretty sure replay files won't contain much information in those tables, and since SC2 is all I play from Blizzard, I may need example files. Just wanted to give an update.