From 289a55ca21f74e4210e28c92af2a6ecda0f0ab88 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 7 Jul 2022 14:20:31 -0700 Subject: [PATCH] Seek to file header location instead --- BurnOutSharp/FileType/MicrosoftCAB.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BurnOutSharp/FileType/MicrosoftCAB.cs b/BurnOutSharp/FileType/MicrosoftCAB.cs index f76c945e..4c2fc5e9 100644 --- a/BurnOutSharp/FileType/MicrosoftCAB.cs +++ b/BurnOutSharp/FileType/MicrosoftCAB.cs @@ -230,6 +230,7 @@ namespace BurnOutSharp.FileType if (data == null || dataPtr < 0) return null; + int basePtr = dataPtr; MSCABCabinet cabinet = new MSCABCabinet(); // Start with the header @@ -246,8 +247,8 @@ namespace BurnOutSharp.FileType return null; } - // TODO: Should we use cabinet.Header.FilesOffset instead of assuming where the data starts? - // TODO: Should we use the original value of `dataPtr` to create the real offset? + // We need to move to where the file headers are stored + dataPtr = basePtr + (int)cabinet.Header.FilesOffset; // Then retrieve all file headers cabinet.Files = new CFFILE[cabinet.Header.FileCount];