aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2025-04-24 11:43:27 +0200
committerLadislav Zezula <zezula@volny.cz>2025-04-24 11:43:27 +0200
commita50eaacb1309f4c1e11bf63a20cef3499a47b6ca (patch)
tree59420d75aeaa4febd22f3d85dd01c74dd9365826 /src
parentc9620d7824e58bdc79a0fde09003ec047b1af3f6 (diff)
Fixed bug in verifying signatures on MPQs version 2
Diffstat (limited to 'src')
-rw-r--r--src/SBaseFileTable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp
index d2d5bc3..e4ce6f6 100644
--- a/src/SBaseFileTable.cpp
+++ b/src/SBaseFileTable.cpp
@@ -586,6 +586,9 @@ DWORD ConvertMpqHeaderToFormat4(
pHeader->BlockTableSize64 = (pHeader->dwBlockTableSize * sizeof(TMPQBlock));
BlockTablePos64 = MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos);
+ // Supply the 64-bit archive size for signature verification
+ pHeader->ArchiveSize64 = pHeader->dwArchiveSize;
+
// We require the block table to follow hash table
if(BlockTablePos64 >= HashTablePos64)
{
@@ -600,7 +603,6 @@ DWORD ConvertMpqHeaderToFormat4(
}
else
{
- pHeader->ArchiveSize64 = pHeader->dwArchiveSize;
ha->dwFlags |= MPQ_FLAG_MALFORMED;
}