From 3806b383c9d9de5882a663fc89d9bfac31296445 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 9 Dec 2022 21:40:25 -0800 Subject: [PATCH] Convert SmartE to string finding --- BurnOutSharp/ProtectionType/SmartE.cs | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/BurnOutSharp/ProtectionType/SmartE.cs b/BurnOutSharp/ProtectionType/SmartE.cs index 87ffef53..6f6a950d 100644 --- a/BurnOutSharp/ProtectionType/SmartE.cs +++ b/BurnOutSharp/ProtectionType/SmartE.cs @@ -1,6 +1,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; +using System.Linq; using BurnOutSharp.Interfaces; using BurnOutSharp.Matching; using BurnOutSharp.Wrappers; @@ -17,24 +18,12 @@ namespace BurnOutSharp.ProtectionType if (sections == null) return null; - // Get the last section - var lastSetionData = pex.GetSectionData(sections.Length - 1); - if (lastSetionData != null) + // Get the last section strings, if they exist + List strs = pex.GetSectionStrings(sections.Length - 1); + if (strs != null) { - var matchers = new List - { - // BITARTS - new ContentMatchSet( - new ContentMatch( - new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }, - start: 18319, - end: 18320), - "SmartE"), - }; - - string match = MatchUtil.GetFirstMatch(file, lastSetionData, matchers, includeDebug); - if (!string.IsNullOrWhiteSpace(match)) - return match; + if (strs.Any(s => s.Contains("BITARTS"))) + return "SmartE"; } return null;