From 138e822d859fd9ff9d79e1ce16823992ad43aec4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 9 Jun 2019 21:14:42 +0200 Subject: Dep/CascLib: Update to ladislav-zezula/CascLib@03a3bcaed285ab0d8ff0845a65ffe7d1fa653960 --- dep/CascLib/src/CascReadFile.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dep/CascLib/src/CascReadFile.cpp') diff --git a/dep/CascLib/src/CascReadFile.cpp b/dep/CascLib/src/CascReadFile.cpp index 2720d6d5adb..2f444d0d80f 100644 --- a/dep/CascLib/src/CascReadFile.cpp +++ b/dep/CascLib/src/CascReadFile.cpp @@ -791,6 +791,16 @@ bool WINAPI CascReadFile(HANDLE hFile, void * pvBuffer, DWORD dwBytesToRead, PDW pbEncodedFrame, pFrame->EncodedSize, (DWORD)(pFrame - hf->pFrames)); + + // Some people find it handy to extract data from partially encrypted file, + // even at the cost producing files that are corrupt. + // We overcome missing decryption key by zeroing the encrypted portions + if(nError == ERROR_FILE_ENCRYPTED && hf->bOvercomeEncrypted) + { + memset(pbDecodedFrame, 0, pFrame->ContentSize); + nError = ERROR_SUCCESS; + } + if (nError == ERROR_SUCCESS) { // Mark the frame as loaded -- cgit v1.2.3