From 4efbf54edfc50ed7356f062f9f3b51347a146d34 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 9 Dec 2022 15:04:14 -0800 Subject: [PATCH] Convert C-Dilla to string finding --- .../ProtectionType/Macrovision.CDilla.cs | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs b/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs index 8b874e49..c3726188 100644 --- a/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs +++ b/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs @@ -134,23 +134,13 @@ namespace BurnOutSharp.ProtectionType if (resource.Any()) return $"C-Dilla License Management System"; - // 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 - { - // SOFTWARE\C-Dilla\RTS - // Found in "DJMixStation\DJMixStation.exe" in IA item "ejay_nestle_trial". - new ContentMatchSet(new byte?[] { - 0x53, 0x4F, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, - 0x5C, 0x43, 0x2D, 0x44, 0x69, 0x6C, 0x6C, 0x61, - 0x5C, 0x52, 0x54, 0x53 }, "C-Dilla License Management System"), - }; - - string match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug); - if (!string.IsNullOrWhiteSpace(match)) - return match; + // Found in "DJMixStation\DJMixStation.exe" in IA item "ejay_nestle_trial". + if (strs.Any(s => s.Contains("SOFTWARE\\C-Dilla\\RTS"))) + return "C-Dilla License Management System"; } // Check for CDSHARE/DISAG_SH sections