aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascReadFile.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-06-09 21:14:42 +0200
committerShauren <shauren.trinity@gmail.com>2019-06-09 21:14:42 +0200
commit138e822d859fd9ff9d79e1ce16823992ad43aec4 (patch)
treef1e22a1afbaa3457e6169146f350c91b9493f926 /dep/CascLib/src/CascReadFile.cpp
parentc4f11447546836844ade509991b4219c88ebaaa3 (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@03a3bcaed285ab0d8ff0845a65ffe7d1fa653960
Diffstat (limited to 'dep/CascLib/src/CascReadFile.cpp')
-rw-r--r--dep/CascLib/src/CascReadFile.cpp10
1 files changed, 10 insertions, 0 deletions
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