mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-18 23:05:11 +00:00
Safer opening of CABs
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user