Improve ProtectDISC checks (#124)

This check is known to be used in at ProtectDISC 6.8.
This commit is contained in:
SilasLaspada
2022-06-29 15:30:13 -06:00
committed by GitHub
parent 03bd7bd1f5
commit 53c90533e3

View File

@@ -18,7 +18,7 @@ namespace BurnOutSharp.ProtectionType
if (sections == null)
return null;
// Get the 4th section, if it exists (example names: ACE4)
// Get the 4th section, if it exists (example names: ACE4) (Found in Redump entry 94793)
var fourthSection = sections.Length < 4 ? null : sections[3];
if (fourthSection != null)
{
@@ -37,6 +37,25 @@ namespace BurnOutSharp.ProtectionType
}
}
// Get the 5th section, if it exists (example names: ACE5) (Found in Redump entry 94792)
var fifthSection = sections.Length < 5 ? null : sections[4];
if (fifthSection != null)
{
var fifthSectionData = pex.ReadRawSection(fifthSection.NameString, first: true);
if (fifthSectionData != null)
{
var matchers = new List<ContentMatchSet>
{
// ACE-PCD
new ContentMatchSet(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDISC"),
};
string match = MatchUtil.GetFirstMatch(file, fifthSectionData, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
}
// Get the .data section, if it exists
if (pex.DataSectionRaw != null)
{