aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascReadFile.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-07-13 00:12:42 +0200
committerShauren <shauren.trinity@gmail.com>2023-07-13 00:12:42 +0200
commit26f37152cca6be50a0b716a4969245c6f9197121 (patch)
tree318baecf0c9c74a46047626bdd8da61bcd164d97 /dep/CascLib/src/CascReadFile.cpp
parentb6a0fa3518ad920946c60bb205277e8104fd1cf0 (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@a27d2b3b9ccb326768e57b4cc7c49d15a0da9e0c
Closes #29102 Closes #29132
Diffstat (limited to 'dep/CascLib/src/CascReadFile.cpp')
-rw-r--r--dep/CascLib/src/CascReadFile.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/dep/CascLib/src/CascReadFile.cpp b/dep/CascLib/src/CascReadFile.cpp
index 3fd173b9bde..c2a209bb307 100644
--- a/dep/CascLib/src/CascReadFile.cpp
+++ b/dep/CascLib/src/CascReadFile.cpp
@@ -173,13 +173,16 @@ static DWORD ParseBlteHeader(PCASC_FILE_SPAN pFileSpan, PCASC_CKEY_ENTRY pCKeyEn
CASCLIB_UNUSED(HeaderOffset);
// On files within storage segments ("data.###"), there is BLTE_ENCODED_HEADER
- // On local files, there is just PBLTE_HEADER
+ // On local files, there is just BLTE_HEADER
if(ConvertBytesToInteger_4_LE(pBlteHeader->Signature) != BLTE_HEADER_SIGNATURE)
{
// There must be at least some bytes
if(cbEncodedBuffer < FIELD_OFFSET(BLTE_ENCODED_HEADER, MustBe0F))
return ERROR_BAD_FORMAT;
- if(pEncodedHeader->EncodedSize != pCKeyEntry->EncodedSize)
+
+ // Note that some newer WoW builds have the entire encoded part zeroed
+ // Tested on WoW retail 50401, file DBFilesClient\\LoreTextPublic.db2
+ if(pEncodedHeader->EncodedSize != 0 && pEncodedHeader->EncodedSize != pCKeyEntry->EncodedSize)
return ERROR_BAD_FORMAT;
#ifdef CASCLIB_DEBUG
@@ -1039,7 +1042,7 @@ bool WINAPI CascSetFileFlags(HANDLE hFile, DWORD dwOpenFlags)
}
// Set "overcome encrypted" flag. Will apply on next CascReadFile
- hf->bOvercomeEncrypted = (dwOpenFlags & CASC_OVERCOME_ENCRYPTED) != 0;
+ hf->bOvercomeEncrypted = (dwOpenFlags & CASC_OVERCOME_ENCRYPTED) ? true : false;
return true;
}