aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascRootFile_TVFS.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-07-13 14:55:54 +0200
committerShauren <shauren.trinity@gmail.com>2019-07-14 19:20:45 +0200
commit6f7ef6e3f0a3f6db84fcb5442ff1e27767cbe61a (patch)
treecc56cf8b8d078142a86b8014b847d93284844806 /dep/CascLib/src/CascRootFile_TVFS.cpp
parent74a801182a39358d62b596642c82c5f6c6e242e9 (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@b802391cfb9418d5550dc1671f18da1ca1c445d4
Diffstat (limited to 'dep/CascLib/src/CascRootFile_TVFS.cpp')
-rw-r--r--dep/CascLib/src/CascRootFile_TVFS.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/dep/CascLib/src/CascRootFile_TVFS.cpp b/dep/CascLib/src/CascRootFile_TVFS.cpp
index 7ccb376b621..38d32120805 100644
--- a/dep/CascLib/src/CascRootFile_TVFS.cpp
+++ b/dep/CascLib/src/CascRootFile_TVFS.cpp
@@ -114,8 +114,6 @@ typedef struct _TVFS_SPAN_ENTRY
//-----------------------------------------------------------------------------
// Handler definition for TVFS root file
-//static FILE * fp = NULL;
-
// Structure for the root handler
struct TRootHandler_TVFS : public TFileTreeRoot
{
@@ -439,15 +437,11 @@ struct TRootHandler_TVFS : public TFileTreeRoot
TVFS_DIRECTORY_HEADER SubHeader;
TVFS_PATH_TABLE_ENTRY PathEntry;
PCASC_CKEY_ENTRY pCKeyEntry;
- ENCODED_KEY EKey;
LPBYTE pbVfsSpanEntry;
char * szSavePathPtr = PathBuffer.szPtr;
DWORD dwSpanCount = 0;
int nError;
- // Prepare the EKey structure to be filled with zeros
- memset(&EKey, 0, sizeof(ENCODED_KEY));
-
// Parse the file table
while(pbPathTablePtr < pbPathTableEnd)
{
@@ -486,17 +480,17 @@ struct TRootHandler_TVFS : public TFileTreeRoot
pbVfsSpanEntry = CaptureVfsSpanCount(DirHeader, PathEntry.NodeValue, dwSpanCount);
if(pbVfsSpanEntry == NULL)
return ERROR_BAD_FORMAT;
-#ifdef _DEBUG
- // So far we've only saw entries with 1 span.
- // Need to test files with multiple spans. Ignore such files for now.
- if(dwSpanCount != 1)
- __debugbreak();
+
+ // TODO: Need to support multi-span files larger than 4 GB
+ // Example: CoD: Black Ops 4, file "zone/base.xpak" 0x16 spans, over 15 GB size
+ assert(dwSpanCount == 1);
dwSpanCount = 1;
-#endif
+
// Parse all span entries
for(DWORD i = 0; i < dwSpanCount; i++)
{
TVFS_SPAN_ENTRY SpanEntry;
+ ENCODED_KEY EKey = {0};
// Capture the n-th span entry
pbVfsSpanEntry = CaptureVfsSpanEntry(DirHeader, pbVfsSpanEntry, SpanEntry);
@@ -529,12 +523,6 @@ struct TRootHandler_TVFS : public TFileTreeRoot
}
else
{
-// if (fp != NULL)
-// {
-// fwrite(PathBuffer.szBegin, 1, (PathBuffer.szPtr - PathBuffer.szBegin), fp);
-// fprintf(fp, "\n");
-// }
-
// Insert the file to the file tree
if((pCKeyEntry = FindCKeyEntry_EKey(hs, EKey.Value)) != NULL)
{