Fix crash in SolidShield scanning (fixes #76)

This commit is contained in:
Matt Nadareski
2022-02-10 10:37:57 -08:00
parent 56f009ac56
commit d9d84a01e5
2 changed files with 11 additions and 2 deletions

View File

@@ -343,7 +343,16 @@ namespace BurnOutSharp.ExecutableType.Microsoft
int startingIndex = (int)Math.Max(section.PointerToRawData + offset, 0);
int readLength = (int)Math.Min(section.VirtualSize - offset, content.Length);
return content.ReadBytes(ref startingIndex, readLength);
try
{
return content.ReadBytes(ref startingIndex, readLength);
}
catch
{
// Just absorb errors for now
// TODO: Investigate why and when this would be hit
return null;
}
}
#endregion