From 47b6b6eb4addd82a89d6bcd8fa92f9c0a09a5781 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Fri, 27 May 2016 16:50:50 +0200 Subject: + Support for MPQs that have invalid (and ignored) flags in the block table + Support for MPQs that have malformed block indexes (0x8000xxxx or 0x4000xxxx) --- src/StormLib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/StormLib.h') diff --git a/src/StormLib.h b/src/StormLib.h index 22658bd..c25a1a8 100644 --- a/src/StormLib.h +++ b/src/StormLib.h @@ -218,7 +218,6 @@ extern "C" { #define MPQ_FILE_REPLACEEXISTING 0x80000000 // Replace when the file exist (SFileAddFile) #define MPQ_FILE_COMPRESS_MASK 0x0000FF00 // Mask for a file being compressed -#define MPQ_FILE_EXISTS_MASK 0xF00000FF // These must be either zero or MPQ_FILE_EXISTS #define MPQ_FILE_VALID_FLAGS (MPQ_FILE_IMPLODE | \ MPQ_FILE_COMPRESS | \ @@ -231,6 +230,8 @@ extern "C" { MPQ_FILE_SIGNATURE | \ MPQ_FILE_EXISTS) +#define MPQ_BLOCK_INDEX(bi) ((bi) & 0x0FFFFFFF) // Index mask for block table index + // Compression types for multiple compressions #define MPQ_COMPRESSION_HUFFMANN 0x01 // Huffmann compression (used on WAVE files only) #define MPQ_COMPRESSION_ZLIB 0x02 // ZLIB compression -- cgit v1.2.3