aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascReadFile.cpp
diff options
context:
space:
mode:
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