Update libMPQ to latest revision (304)
--HG-- branch : trunk
This commit is contained in:
Vendored
-1
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
/* generic includes. */
|
/* generic includes. */
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@
|
|||||||
#define LIBMPQ_FLAG_COMPRESS_MULTI 0x00000200 /* multiple compressions. */
|
#define LIBMPQ_FLAG_COMPRESS_MULTI 0x00000200 /* multiple compressions. */
|
||||||
#define LIBMPQ_FLAG_COMPRESS_NONE 0x00000300 /* no compression (no blizzard flag used by myself). */
|
#define LIBMPQ_FLAG_COMPRESS_NONE 0x00000300 /* no compression (no blizzard flag used by myself). */
|
||||||
#define LIBMPQ_FLAG_SINGLE 0x01000000 /* file is stored in one single sector, first seen in world of warcraft. */
|
#define LIBMPQ_FLAG_SINGLE 0x01000000 /* file is stored in one single sector, first seen in world of warcraft. */
|
||||||
#define LIBMPQ_FLAG_EXTRA 0x04000000 /* compressed block offset table has one extra entry. */
|
#define LIBMPQ_FLAG_CRC 0x04000000 /* compressed block offset table has CRC checksum. */
|
||||||
|
|
||||||
/* define generic hash values. */
|
/* define generic hash values. */
|
||||||
#define LIBMPQ_HASH_FREE 0xFFFFFFFF /* hash table entry is empty and has always been empty. */
|
#define LIBMPQ_HASH_FREE 0xFFFFFFFF /* hash table entry is empty and has always been empty. */
|
||||||
|
|||||||
Vendored
+6
-3
@@ -609,7 +609,7 @@ int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_numb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if data has one extra entry. */
|
/* check if data has one extra entry. */
|
||||||
if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_EXTRA) != 0) {
|
if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_CRC) != 0) {
|
||||||
|
|
||||||
/* add one uint32_t. */
|
/* add one uint32_t. */
|
||||||
packed_size += sizeof(uint32_t);
|
packed_size += sizeof(uint32_t);
|
||||||
@@ -654,8 +654,11 @@ int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_numb
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if the archive is protected some way, sometimes the file appears not to be encrypted, but it is. */
|
/* check if the archive is protected some way, sometimes the file appears not to be encrypted, but it is.
|
||||||
if (mpq_archive->mpq_file[file_number]->packed_offset[0] != rb) {
|
* a special case are files with an additional sector but LIBMPQ_FLAG_CRC not set. we don't want to handle
|
||||||
|
* them as encrypted. */
|
||||||
|
if (mpq_archive->mpq_file[file_number]->packed_offset[0] != rb &&
|
||||||
|
mpq_archive->mpq_file[file_number]->packed_offset[0] != rb + 4) {
|
||||||
|
|
||||||
/* file is encrypted. */
|
/* file is encrypted. */
|
||||||
mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags |= LIBMPQ_FLAG_ENCRYPTED;
|
mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags |= LIBMPQ_FLAG_ENCRYPTED;
|
||||||
|
|||||||
Reference in New Issue
Block a user