From 26f37152cca6be50a0b716a4969245c6f9197121 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 13 Jul 2023 00:12:42 +0200 Subject: Dep/CascLib: Update to ladislav-zezula/CascLib@a27d2b3b9ccb326768e57b4cc7c49d15a0da9e0c Closes #29102 Closes #29132 --- dep/CascLib/src/CascReadFile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'dep/CascLib/src/CascReadFile.cpp') 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; } -- cgit v1.2.3