From 3cfe9138a5ee440cc6d9414d33e3d8f38a87e3aa Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 9 Dec 2022 15:10:23 -0800 Subject: [PATCH] Convert MediaMax CD-3 to string finding --- BurnOutSharp/ProtectionType/MediaMaxCD3.cs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs index ab43e1ed..6d081550 100644 --- a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs +++ b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs @@ -44,23 +44,12 @@ namespace BurnOutSharp.ProtectionType // TODO: Investigate the following dialog item title resource // "This limited production advanced CD is not playable on your computer. It is solely intended for playback on standard CD players." - // Get the .data/DATA section, if it exists - var dataSectionRaw = pex.GetFirstSectionData(".data") ?? pex.GetFirstSectionData("DATA"); - if (dataSectionRaw != null) + // Get the .data/DATA section strings, if they exist + List strs = pex.GetFirstSectionStrings(".data") ?? pex.GetFirstSectionStrings("DATA"); + if (strs != null) { - var matchers = new List - { - // CD3 Launch Error - new ContentMatchSet(new byte?[] - { - 0x43, 0x44, 0x33, 0x20, 0x4C, 0x61, 0x75, 0x6E, - 0x63, 0x68, 0x20, 0x45, 0x72, 0x72, 0x6F, 0x72 - }, "MediaMax CD-3"), - }; - - string match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug); - if (!string.IsNullOrWhiteSpace(match)) - return match; + if (strs.Any(s => s.Contains("CD3 Launch Error"))) + return "MediaMax CD-3"; } // Get the export name table