From e765fb6c0bd935d267d17fc0e4ed557220a63e44 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 8 Mar 2022 22:33:39 -0800 Subject: [PATCH] Simplify PSX Anti-Modchip a little --- BurnOutSharp/ProtectionType/PSXAntiModchip.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs index 9bc32fb6..5e9ddbd2 100644 --- a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs +++ b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs @@ -6,11 +6,14 @@ namespace BurnOutSharp.ProtectionType { public class PSXAntiModchip : IContentCheck { + // TODO: Figure out PSX binary header so this can be checked explicitly. + // For now, this means that the CheckContents check is redundant for external + // use through other programs /// - private List GetContentMatchSets() + public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) { // TODO: Detect Red Hand protection - return new List + var contentMatchSets = new List { // SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690 new ContentMatchSet(new byte?[] @@ -41,15 +44,8 @@ namespace BurnOutSharp.ProtectionType 0x30, 0x59, 0x30, 0x02 }, "PlayStation Anti-modchip (Japanese)"), }; - } - // TODO: Figure out PSX binary header so this can be checked explicitly. - // For now, this means that the CheckContents check is redundant for external - // use through other programs - /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) - { - return MatchUtil.GetFirstMatch(file, fileContent, GetContentMatchSets(), includeDebug); + return MatchUtil.GetFirstMatch(file, fileContent, contentMatchSets, includeDebug); } } }