diff --git a/BurnOutSharp/External/libmspack/CAB/_CabinetHeader.cs b/BurnOutSharp/External/libmspack/CAB/_CabinetHeader.cs index 0a7b774d..16917cd1 100644 --- a/BurnOutSharp/External/libmspack/CAB/_CabinetHeader.cs +++ b/BurnOutSharp/External/libmspack/CAB/_CabinetHeader.cs @@ -196,9 +196,9 @@ namespace LibMSPackSharp.CAB return; // Expect less than 60,000, but don't validate - HeaderReserved = BitConverter.ToUInt16(buffer, 0x24); - FolderReserved = buffer[0x26]; - DataReserved = buffer[0x27]; + HeaderReserved = BitConverter.ToUInt16(buffer, 0x00); + FolderReserved = buffer[0x02]; + DataReserved = buffer[0x03]; } } } diff --git a/BurnOutSharp/FileType/MicrosoftCAB.cs b/BurnOutSharp/FileType/MicrosoftCAB.cs index bef765f6..bdb76d74 100644 --- a/BurnOutSharp/FileType/MicrosoftCAB.cs +++ b/BurnOutSharp/FileType/MicrosoftCAB.cs @@ -44,8 +44,15 @@ namespace BurnOutSharp.FileType // Create the decompressor var decompressor = Library.CreateCABDecompressor(null); + // Open the cab file var cabFile = decompressor.Open(file); + if (cabFile == null) + { + if (scanner.IncludeDebug) Console.WriteLine($"Error occurred opening of '{file}': {decompressor.Error}"); + return null; + } + // Loop through the found internal files var sub = cabFile.Files; while (sub != null) {