From 53c90533e30df5eb497fc50ac8d1c21dc74692e4 Mon Sep 17 00:00:00 2001 From: SilasLaspada Date: Wed, 29 Jun 2022 15:30:13 -0600 Subject: [PATCH] Improve ProtectDISC checks (#124) This check is known to be used in at ProtectDISC 6.8. --- BurnOutSharp/ProtectionType/ProtectDisc.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/BurnOutSharp/ProtectionType/ProtectDisc.cs b/BurnOutSharp/ProtectionType/ProtectDisc.cs index 72036f0d..7bf41da1 100644 --- a/BurnOutSharp/ProtectionType/ProtectDisc.cs +++ b/BurnOutSharp/ProtectionType/ProtectDisc.cs @@ -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 + { + // 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) {