mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Update libMPQ to latest revision (304)
--HG-- branch : trunk
This commit is contained in:
1
externals/libmpq/libmpq/common.c
vendored
1
externals/libmpq/libmpq/common.c
vendored
@@ -20,7 +20,6 @@
|
||||
|
||||
/* generic includes. */
|
||||
#include <ctype.h>
|
||||
#include <dirent.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
2
externals/libmpq/libmpq/mpq-internal.h
vendored
2
externals/libmpq/libmpq/mpq-internal.h
vendored
@@ -44,7 +44,7 @@
|
||||
#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_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 LIBMPQ_HASH_FREE 0xFFFFFFFF /* hash table entry is empty and has always been empty. */
|
||||
|
||||
9
externals/libmpq/libmpq/mpq.c
vendored
9
externals/libmpq/libmpq/mpq.c
vendored
@@ -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. */
|
||||
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. */
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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) {
|
||||
/* check if the archive is protected some way, sometimes the file appears not to be encrypted, but it is.
|
||||
* 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. */
|
||||
mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags |= LIBMPQ_FLAG_ENCRYPTED;
|
||||
|
||||
Reference in New Issue
Block a user