From 4330cd1aac6aff566d15223bb3f734f222263a6c Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 4 Dec 2022 23:20:22 -0800 Subject: [PATCH] Fix WTM code/CODE section --- BurnOutSharp/ProtectionType/WTMCDProtect.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BurnOutSharp/ProtectionType/WTMCDProtect.cs b/BurnOutSharp/ProtectionType/WTMCDProtect.cs index 92a801af..4150b1d8 100644 --- a/BurnOutSharp/ProtectionType/WTMCDProtect.cs +++ b/BurnOutSharp/ProtectionType/WTMCDProtect.cs @@ -25,8 +25,9 @@ namespace BurnOutSharp.ProtectionType if (!string.IsNullOrEmpty(name) && name.Contains("WTM Copy Protection Viewer")) return "WTM Protection Viewer"; - // Get the CODE section, if it exists - if (pex.ContainsSection("CODE")) + // Get the code/CODE section, if it exists + var codeSectionRaw = pex.GetFirstSectionData("code") ?? pex.GetFirstSectionData("CODE"); + if (codeSectionRaw != null) { var matchers = new List { @@ -38,7 +39,7 @@ namespace BurnOutSharp.ProtectionType }, "WTM CD Protect"), }; - string match = MatchUtil.GetFirstMatch(file, pex.GetFirstSectionData("CODE"), matchers, includeDebug); + string match = MatchUtil.GetFirstMatch(file, codeSectionRaw, matchers, includeDebug); if (!string.IsNullOrWhiteSpace(match)) return match; }