From 7cfa9649e43bb2a45ed398b06e25ec675f4e7797 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 26 Feb 2021 01:26:49 -0800 Subject: [PATCH] Add IContentCheck interface --- BurnOutSharp/FileType/Executable.cs | 88 +++++++++---------- BurnOutSharp/IContentCheck.cs | 14 +++ BurnOutSharp/PackerType/Armadillo.cs | 5 +- BurnOutSharp/PackerType/EXEStealth.cs | 5 +- BurnOutSharp/PackerType/NSIS.cs | 5 +- BurnOutSharp/PackerType/PECompact.cs | 5 +- BurnOutSharp/PackerType/UPX.cs | 5 +- BurnOutSharp/PackerType/dotFuscator.cs | 5 +- BurnOutSharp/ProtectionType/ActiveMARK.cs | 5 +- BurnOutSharp/ProtectionType/AlphaROM.cs | 5 +- BurnOutSharp/ProtectionType/CDCheck.cs | 5 +- BurnOutSharp/ProtectionType/CDCops.cs | 5 +- BurnOutSharp/ProtectionType/CDLock.cs | 5 +- BurnOutSharp/ProtectionType/CDSHiELDSE.cs | 5 +- .../ProtectionType/CactusDataShield.cs | 5 +- .../ProtectionType/CengaProtectDVD.cs | 5 +- BurnOutSharp/ProtectionType/CodeLock.cs | 5 +- BurnOutSharp/ProtectionType/CopyKiller.cs | 5 +- BurnOutSharp/ProtectionType/DVDCops.cs | 5 +- BurnOutSharp/ProtectionType/ElectronicArts.cs | 5 +- BurnOutSharp/ProtectionType/GFWL.cs | 5 +- BurnOutSharp/ProtectionType/ImpulseReactor.cs | 5 +- BurnOutSharp/ProtectionType/InnoSetup.cs | 5 +- BurnOutSharp/ProtectionType/Intenium.cs | 5 +- BurnOutSharp/ProtectionType/JoWooDXProt.cs | 5 +- BurnOutSharp/ProtectionType/KeyLock.cs | 5 +- BurnOutSharp/ProtectionType/LaserLock.cs | 5 +- BurnOutSharp/ProtectionType/MediaMaxCD3.cs | 5 +- BurnOutSharp/ProtectionType/Origin.cs | 5 +- BurnOutSharp/ProtectionType/PSXAntiModchip.cs | 9 +- BurnOutSharp/ProtectionType/ProtectDisc.cs | 5 +- BurnOutSharp/ProtectionType/RingPROTECH.cs | 5 +- BurnOutSharp/ProtectionType/SVKProtector.cs | 5 +- BurnOutSharp/ProtectionType/SafeDisc.cs | 5 +- BurnOutSharp/ProtectionType/SafeLock.cs | 5 +- BurnOutSharp/ProtectionType/SecuROM.cs | 5 +- BurnOutSharp/ProtectionType/SmartE.cs | 5 +- BurnOutSharp/ProtectionType/SolidShield.cs | 5 +- BurnOutSharp/ProtectionType/StarForce.cs | 5 +- BurnOutSharp/ProtectionType/Sysiphus.cs | 5 +- BurnOutSharp/ProtectionType/Tages.cs | 5 +- BurnOutSharp/ProtectionType/ThreePLock.cs | 5 +- .../ProtectionType/ThreeTwoOneStudios.cs | 5 +- .../ProtectionType/VOBProtectCDDVD.cs | 5 +- BurnOutSharp/ProtectionType/WTMCDProtect.cs | 5 +- BurnOutSharp/ProtectionType/XCP.cs | 5 +- .../ProtectionType/XtremeProtector.cs | 5 +- 47 files changed, 195 insertions(+), 136 deletions(-) create mode 100644 BurnOutSharp/IContentCheck.cs diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index 26f5e340..b330732f 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -62,177 +62,177 @@ namespace BurnOutSharp.FileType #region Protections // 3PLock - protection = ThreePLock.CheckContents(fileContent, scanner.IncludePosition); + protection = new ThreePLock().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // 321Studios Online Activation - protection = ThreeTwoOneStudios.CheckContents(fileContent, scanner.IncludePosition); + protection = new ThreeTwoOneStudios().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // ActiveMARK - protection = ActiveMARK.CheckContents(fileContent, scanner.IncludePosition); + protection = new ActiveMARK().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Alpha-ROM - protection = AlphaROM.CheckContents(fileContent, scanner.IncludePosition); + protection = new AlphaROM().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Cactus Data Shield - protection = CactusDataShield.CheckContents(fileContent, scanner.IncludePosition); + protection = new CactusDataShield().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // CD-Cops - protection = CDCops.CheckContents(fileContent, scanner.IncludePosition); + protection = new CDCops().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // CD-Lock - protection = CDLock.CheckContents(fileContent, scanner.IncludePosition); + protection = new CDLock().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // CDSHiELD SE - protection = CDSHiELDSE.CheckContents(fileContent, scanner.IncludePosition); + protection = new CDSHiELDSE().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // CD Check - protection = CDCheck.CheckContents(fileContent, scanner.IncludePosition); + protection = new CDCheck().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Cenega ProtectDVD - protection = CengaProtectDVD.CheckContents(fileContent, scanner.IncludePosition); + protection = new CengaProtectDVD().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Code Lock - protection = CodeLock.CheckContents(fileContent, scanner.IncludePosition); + protection = new CodeLock().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // CopyKiller - protection = CopyKiller.CheckContents(fileContent, scanner.IncludePosition); + protection = new CopyKiller().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // DVD-Cops - protection = DVDCops.CheckContents(fileContent, scanner.IncludePosition); + protection = new DVDCops().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // EA Protections - protection = ElectronicArts.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new ElectronicArts().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Games for Windows - Live - protection = GFWL.CheckContents(fileContent, scanner.IncludePosition); + protection = new GFWL().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Impulse Reactor - protection = ImpulseReactor.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new ImpulseReactor().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Inno Setup - protection = InnoSetup.CheckContents(fileContent, scanner.IncludePosition); + protection = new InnoSetup().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // INTENIUM Trial & Buy Protection - protection = Intenium.CheckContents(fileContent, scanner.IncludePosition); + protection = new Intenium().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // JoWooD X-Prot - protection = JoWooDXProt.CheckContents(fileContent, scanner.IncludePosition); + protection = new JoWooDXProt().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Key-Lock (Dongle) - protection = KeyLock.CheckContents(fileContent, scanner.IncludePosition); + protection = new KeyLock().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // LaserLock - protection = LaserLock.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new LaserLock().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // MediaMax CD-3 - protection = MediaMaxCD3.CheckContents(fileContent, scanner.IncludePosition); + protection = new MediaMaxCD3().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Origin - protection = Origin.CheckContents(fileContent, scanner.IncludePosition); + protection = new Origin().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // ProtectDisc - protection = ProtectDisc.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new ProtectDisc().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Ring PROTECH - protection = RingPROTECH.CheckContents(fileContent, scanner.IncludePosition); + protection = new RingPROTECH().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // SafeDisc / SafeCast - protection = SafeDisc.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new SafeDisc().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // SafeLock - protection = SafeLock.CheckContents(fileContent, scanner.IncludePosition); + protection = new SafeLock().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // SecuROM - protection = SecuROM.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new SecuROM().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // SmartE - protection = SmartE.CheckContents(fileContent, scanner.IncludePosition); + protection = new SmartE().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // SolidShield - protection = SolidShield.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new SolidShield().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // StarForce - protection = StarForce.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new StarForce().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // SVK Protector - protection = SVKProtector.CheckContents(fileContent, scanner.IncludePosition); + protection = new SVKProtector().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Sysiphus / Sysiphus DVD - protection = Sysiphus.CheckContents(fileContent, scanner.IncludePosition); + protection = new Sysiphus().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // TAGES - protection = Tages.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new Tages().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // VOB ProtectCD/DVD - protection = VOBProtectCDDVD.CheckContents(file, fileContent, scanner.IncludePosition); + protection = new VOBProtectCDDVD().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); @@ -242,17 +242,17 @@ namespace BurnOutSharp.FileType Utilities.AppendToDictionary(protections, subProtections); // WTM CD Protect - protection = WTMCDProtect.CheckContents(fileContent, scanner.IncludePosition); + protection = new WTMCDProtect().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // XCP 1/2 - protection = XCP.CheckContents(fileContent, scanner.IncludePosition); + protection = new XCP().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // Xtreme-Protector - protection = XtremeProtector.CheckContents(fileContent, scanner.IncludePosition); + protection = new XtremeProtector().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); @@ -264,32 +264,32 @@ namespace BurnOutSharp.FileType if (scanner.ScanPackers) { // Armadillo - protection = Armadillo.CheckContents(fileContent, scanner.IncludePosition); + protection = new Armadillo().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // dotFuscator - protection = dotFuscator.CheckContents(fileContent, scanner.IncludePosition); + protection = new dotFuscator().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // EXE Stealth - protection = EXEStealth.CheckContents(fileContent, scanner.IncludePosition); + protection = new EXEStealth().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // NSIS - protection = NSIS.CheckContents(fileContent, scanner.IncludePosition); + protection = new NSIS().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // PE Compact - protection = PECompact.CheckContents(fileContent, scanner.IncludePosition); + protection = new PECompact().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); // UPX - protection = UPX.CheckContents(fileContent, scanner.IncludePosition); + protection = new UPX().CheckContents(file, fileContent, scanner.IncludePosition); if (!string.IsNullOrWhiteSpace(protection)) Utilities.AppendToDictionary(protections, file, protection); } diff --git a/BurnOutSharp/IContentCheck.cs b/BurnOutSharp/IContentCheck.cs new file mode 100644 index 00000000..d0f1de03 --- /dev/null +++ b/BurnOutSharp/IContentCheck.cs @@ -0,0 +1,14 @@ +namespace BurnOutSharp +{ + public interface IContentCheck + { + /// + /// Check a path for protections based on file contents + /// + /// File to check for protection indicators + /// Byte array representing the file contents + /// True to include positional data, false otherwise + /// String containing any protections found in the file + string CheckContents(string file, byte[] fileContent, bool includePosition); + } +} diff --git a/BurnOutSharp/PackerType/Armadillo.cs b/BurnOutSharp/PackerType/Armadillo.cs index d3ffe032..33f3033f 100644 --- a/BurnOutSharp/PackerType/Armadillo.cs +++ b/BurnOutSharp/PackerType/Armadillo.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.PackerType { - public class Armadillo + public class Armadillo : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // ".nicode" + (char)0x00 byte[] check = new byte[] { 0x2E, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0x00 }; diff --git a/BurnOutSharp/PackerType/EXEStealth.cs b/BurnOutSharp/PackerType/EXEStealth.cs index a3460963..7eaadd44 100644 --- a/BurnOutSharp/PackerType/EXEStealth.cs +++ b/BurnOutSharp/PackerType/EXEStealth.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.PackerType { - public class EXEStealth + public class EXEStealth : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "??[[__[[_" + (char)0x00 + "{{" + (char)0x0 + (char)0x00 + "{{" + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x0 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + "?;??;??" byte[] check = new byte[] { 0x3F, 0x3F, 0x5B, 0x5B, 0x5F, 0x5F, 0x5B, 0x5B, 0x5F, 0x00, 0x7B, 0x7B, 0x00, 0x00, 0x7B, 0x7B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x3B, 0x3F, 0x3F, 0x3B, 0x3F, 0x3F }; diff --git a/BurnOutSharp/PackerType/NSIS.cs b/BurnOutSharp/PackerType/NSIS.cs index 6c3cbe92..6595e1fe 100644 --- a/BurnOutSharp/PackerType/NSIS.cs +++ b/BurnOutSharp/PackerType/NSIS.cs @@ -4,9 +4,10 @@ using System.Text; namespace BurnOutSharp.PackerType { - public class NSIS + public class NSIS : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // Nullsoft Install System byte[] check = new byte[] { 0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d }; diff --git a/BurnOutSharp/PackerType/PECompact.cs b/BurnOutSharp/PackerType/PECompact.cs index 16a12edc..dbb56978 100644 --- a/BurnOutSharp/PackerType/PECompact.cs +++ b/BurnOutSharp/PackerType/PECompact.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.PackerType { - public class PECompact + public class PECompact : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "PEC2" byte[] check = new byte[] { 0x50, 0x45, 0x43, 0x32 }; diff --git a/BurnOutSharp/PackerType/UPX.cs b/BurnOutSharp/PackerType/UPX.cs index daefe8cf..86b53bba 100644 --- a/BurnOutSharp/PackerType/UPX.cs +++ b/BurnOutSharp/PackerType/UPX.cs @@ -2,9 +2,10 @@ using System.Text; namespace BurnOutSharp.PackerType { - public class UPX + public class UPX : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // UPX! byte[] check = new byte[] { 0x55, 0x50, 0x58, 0x21 }; diff --git a/BurnOutSharp/PackerType/dotFuscator.cs b/BurnOutSharp/PackerType/dotFuscator.cs index d28820e9..dcb28a34 100644 --- a/BurnOutSharp/PackerType/dotFuscator.cs +++ b/BurnOutSharp/PackerType/dotFuscator.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.PackerType { - public class dotFuscator + public class dotFuscator : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "DotfuscatorAttribute" byte[] check = new byte[] { 0x44, 0x6F, 0x74, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x6F, 0x72, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65 }; diff --git a/BurnOutSharp/ProtectionType/ActiveMARK.cs b/BurnOutSharp/ProtectionType/ActiveMARK.cs index d25e940c..c014adf8 100644 --- a/BurnOutSharp/ProtectionType/ActiveMARK.cs +++ b/BurnOutSharp/ProtectionType/ActiveMARK.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class ActiveMARK + public class ActiveMARK : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "TMSAMVOF" byte[] check = new byte[] { 0x54, 0x4D, 0x53, 0x41, 0x4D, 0x56, 0x4F, 0x46 }; diff --git a/BurnOutSharp/ProtectionType/AlphaROM.cs b/BurnOutSharp/ProtectionType/AlphaROM.cs index 428622a9..e3a619e0 100644 --- a/BurnOutSharp/ProtectionType/AlphaROM.cs +++ b/BurnOutSharp/ProtectionType/AlphaROM.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class AlphaROM + public class AlphaROM : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "SETTEC" byte[] check = new byte[] { 0x53, 0x45, 0x54, 0x54, 0x45, 0x43 }; diff --git a/BurnOutSharp/ProtectionType/CDCheck.cs b/BurnOutSharp/ProtectionType/CDCheck.cs index 0439a1be..11967952 100644 --- a/BurnOutSharp/ProtectionType/CDCheck.cs +++ b/BurnOutSharp/ProtectionType/CDCheck.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class CDCheck + public class CDCheck : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // MGS CDCheck byte[] check = new byte[] { 0x4D, 0x47, 0x53, 0x20, 0x43, 0x44, 0x43, 0x68, 0x65, 0x63, 0x6B }; diff --git a/BurnOutSharp/ProtectionType/CDCops.cs b/BurnOutSharp/ProtectionType/CDCops.cs index 227c7301..3f30e8aa 100644 --- a/BurnOutSharp/ProtectionType/CDCops.cs +++ b/BurnOutSharp/ProtectionType/CDCops.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class CDCops : IPathCheck + public class CDCops : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "CD-Cops, ver. " byte[] check = new byte[] { 0x43, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C, 0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20 }; diff --git a/BurnOutSharp/ProtectionType/CDLock.cs b/BurnOutSharp/ProtectionType/CDLock.cs index bac25f1c..c7607981 100644 --- a/BurnOutSharp/ProtectionType/CDLock.cs +++ b/BurnOutSharp/ProtectionType/CDLock.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class CDLock : IPathCheck + public class CDLock : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "2" + (char)0xF2 + (char)0x02 + (char)0x82 + (char)0xC3 + (char)0xBC + (char)0x0B + "$" + (char)0x99 + (char)0xAD + "'C" + (char)0xE4 + (char)0x9D + "st" + (char)0x99 + (char)0xFA + "2$" + (char)0x9D + ")4" + (char)0xFF + "t" byte[] check = new byte[] { 0x32, 0xF2, 0x02, 0x82, 0xC3, 0xBC, 0x0B, 0x24, 0x99, 0xAD, 0x27, 0x43, 0xE4, 0x9D, 0x73, 0x74, 0x99, 0xFA, 0x32, 0x24, 0x9D, 0x29, 0x34, 0xFF, 0x74 }; diff --git a/BurnOutSharp/ProtectionType/CDSHiELDSE.cs b/BurnOutSharp/ProtectionType/CDSHiELDSE.cs index f1244e97..8b413db5 100644 --- a/BurnOutSharp/ProtectionType/CDSHiELDSE.cs +++ b/BurnOutSharp/ProtectionType/CDSHiELDSE.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class CDSHiELDSE + public class CDSHiELDSE : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "~0017.tmp" byte[] check = new byte[] { 0x7E, 0x30, 0x30, 0x31, 0x37, 0x2E, 0x74, 0x6D, 0x70 }; diff --git a/BurnOutSharp/ProtectionType/CactusDataShield.cs b/BurnOutSharp/ProtectionType/CactusDataShield.cs index fa5f7f60..39cf4fb7 100644 --- a/BurnOutSharp/ProtectionType/CactusDataShield.cs +++ b/BurnOutSharp/ProtectionType/CactusDataShield.cs @@ -6,9 +6,10 @@ using System.Text; namespace BurnOutSharp.ProtectionType { - public class CactusDataShield : IPathCheck + public class CactusDataShield : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // DATA.CDS byte[] check = new byte[] { 0x44, 0x41, 0x54, 0x41, 0x2E, 0x43, 0x44, 0x53 }; diff --git a/BurnOutSharp/ProtectionType/CengaProtectDVD.cs b/BurnOutSharp/ProtectionType/CengaProtectDVD.cs index f4c9be7a..ef904a26 100644 --- a/BurnOutSharp/ProtectionType/CengaProtectDVD.cs +++ b/BurnOutSharp/ProtectionType/CengaProtectDVD.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class CengaProtectDVD + public class CengaProtectDVD : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // ".cenega" byte[] check = new byte[] { 0x2E, 0x63, 0x65, 0x6E, 0x65, 0x67, 0x61 }; diff --git a/BurnOutSharp/ProtectionType/CodeLock.cs b/BurnOutSharp/ProtectionType/CodeLock.cs index 041588a0..1a805e35 100644 --- a/BurnOutSharp/ProtectionType/CodeLock.cs +++ b/BurnOutSharp/ProtectionType/CodeLock.cs @@ -1,9 +1,10 @@ namespace BurnOutSharp.ProtectionType { - public class CodeLock + public class CodeLock : IContentCheck { // TODO: Verify if these are OR or AND - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "icd1" + (char)0x00 byte[] check = new byte[] { 0x69, 0x63, 0x64, 0x31, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/CopyKiller.cs b/BurnOutSharp/ProtectionType/CopyKiller.cs index e481275e..cbfd574e 100644 --- a/BurnOutSharp/ProtectionType/CopyKiller.cs +++ b/BurnOutSharp/ProtectionType/CopyKiller.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class CopyKiller : IPathCheck + public class CopyKiller : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "Tom Commander" byte[] check = new byte[] { 0x54, 0x6F, 0x6D, 0x20, 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x65, 0x72 }; diff --git a/BurnOutSharp/ProtectionType/DVDCops.cs b/BurnOutSharp/ProtectionType/DVDCops.cs index a4e20e93..a4782654 100644 --- a/BurnOutSharp/ProtectionType/DVDCops.cs +++ b/BurnOutSharp/ProtectionType/DVDCops.cs @@ -3,9 +3,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class DVDCops + public class DVDCops : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "DVD-Cops, ver. " byte[] check = new byte[] { 0x44, 0x56, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C, 0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20 }; diff --git a/BurnOutSharp/ProtectionType/ElectronicArts.cs b/BurnOutSharp/ProtectionType/ElectronicArts.cs index 360556c4..acc892f8 100644 --- a/BurnOutSharp/ProtectionType/ElectronicArts.cs +++ b/BurnOutSharp/ProtectionType/ElectronicArts.cs @@ -1,12 +1,13 @@ namespace BurnOutSharp.ProtectionType { - public class ElectronicArts + public class ElectronicArts : IContentCheck { // TODO: Verify this doesn't over-match // TODO: Do more research into the Cucko protection: // - Reference to `EASTL` and `EAStdC` are standard for EA products and does not indicate Cucko by itself // - There's little information outside of PiD detection that actually knows about Cucko - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // EASTL // byte[] check = new byte[] { 0x45, 0x41, 0x53, 0x54, 0x4C }; diff --git a/BurnOutSharp/ProtectionType/GFWL.cs b/BurnOutSharp/ProtectionType/GFWL.cs index fe7047e9..b3a14da0 100644 --- a/BurnOutSharp/ProtectionType/GFWL.cs +++ b/BurnOutSharp/ProtectionType/GFWL.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class GFWL : IPathCheck + public class GFWL : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "xlive.dll" byte[] check = new byte[] { 0x78, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x64, 0x6C, 0x6C }; diff --git a/BurnOutSharp/ProtectionType/ImpulseReactor.cs b/BurnOutSharp/ProtectionType/ImpulseReactor.cs index fc9c77bf..886e4a83 100644 --- a/BurnOutSharp/ProtectionType/ImpulseReactor.cs +++ b/BurnOutSharp/ProtectionType/ImpulseReactor.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class ImpulseReactor : IPathCheck + public class ImpulseReactor : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "CVPInitializeClient" byte[] check = new byte[] { 0x43, 0x56, 0x50, 0x49, 0x6E, 0x69, 0x74, 0x69, 0x61, 0x6C, 0x69, 0x7A, 0x65, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74 }; diff --git a/BurnOutSharp/ProtectionType/InnoSetup.cs b/BurnOutSharp/ProtectionType/InnoSetup.cs index 489eec4b..c225c7a5 100644 --- a/BurnOutSharp/ProtectionType/InnoSetup.cs +++ b/BurnOutSharp/ProtectionType/InnoSetup.cs @@ -3,11 +3,12 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class InnoSetup + public class InnoSetup : IContentCheck { // TOOO: Add Inno Setup extraction // https://github.com/dscharrer/InnoExtract - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "Inno" byte[] check = new byte[] { 0x49, 0x6E, 0x6E, 0x6F }; diff --git a/BurnOutSharp/ProtectionType/Intenium.cs b/BurnOutSharp/ProtectionType/Intenium.cs index 9cfdc840..e90772f2 100644 --- a/BurnOutSharp/ProtectionType/Intenium.cs +++ b/BurnOutSharp/ProtectionType/Intenium.cs @@ -1,6 +1,6 @@ namespace BurnOutSharp.ProtectionType { - public class Intenium + public class Intenium : IContentCheck { /* * Possible strings for finding INTENIUM Trial & Buy Protection @@ -18,7 +18,8 @@ * - NO NESTED PRMS SUPPORTED - 4E 4F 20 4E 45 53 54 45 44 20 50 52 4D 53 20 53 55 50 50 4F 52 54 45 44 */ - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // Trial + (char)0x00 + P byte[] check = new byte[] { 0x54, 0x72, 0x69, 0x61, 0x6C, 0x00, 0x50 }; diff --git a/BurnOutSharp/ProtectionType/JoWooDXProt.cs b/BurnOutSharp/ProtectionType/JoWooDXProt.cs index 6c91e346..8aba374d 100644 --- a/BurnOutSharp/ProtectionType/JoWooDXProt.cs +++ b/BurnOutSharp/ProtectionType/JoWooDXProt.cs @@ -3,9 +3,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class JoWooDXProt + public class JoWooDXProt : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // ".ext " byte[] check = new byte[] { 0x2E, 0x65, 0x78, 0x74, 0x20, 0x20, 0x20, 0x20 }; diff --git a/BurnOutSharp/ProtectionType/KeyLock.cs b/BurnOutSharp/ProtectionType/KeyLock.cs index 3beeac19..860d6ef4 100644 --- a/BurnOutSharp/ProtectionType/KeyLock.cs +++ b/BurnOutSharp/ProtectionType/KeyLock.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class KeyLock + public class KeyLock : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "KEY-LOCK COMMAND" byte[] check = new byte[] { 0x4B, 0x45, 0x59, 0x2D, 0x4C, 0x4F, 0x43, 0x4B, 0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x41, 0x4E, 0x44 }; diff --git a/BurnOutSharp/ProtectionType/LaserLock.cs b/BurnOutSharp/ProtectionType/LaserLock.cs index 54a83389..c9f73141 100644 --- a/BurnOutSharp/ProtectionType/LaserLock.cs +++ b/BurnOutSharp/ProtectionType/LaserLock.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class LaserLock : IPathCheck + public class LaserLock : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "Packed by SPEEnc V2 Asterios Parlamentas.PE" byte[] check = new byte[] { 0x50, 0x61, 0x63, 0x6B, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x53, 0x50, 0x45, 0x45, 0x6E, 0x63, 0x20, 0x56, 0x32, 0x20, 0x41, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6F, 0x73, 0x20, 0x50, 0x61, 0x72, 0x6C, 0x61, 0x6D, 0x65, 0x6E, 0x74, 0x61, 0x73, 0x2E, 0x50, 0x45 }; diff --git a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs index 40a579b6..5bcff905 100644 --- a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs +++ b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class MediaMaxCD3 : IPathCheck + public class MediaMaxCD3 : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // Cd3Ctl byte[] check = new byte[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C }; diff --git a/BurnOutSharp/ProtectionType/Origin.cs b/BurnOutSharp/ProtectionType/Origin.cs index eea72593..80ff40b3 100644 --- a/BurnOutSharp/ProtectionType/Origin.cs +++ b/BurnOutSharp/ProtectionType/Origin.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class Origin : IPathCheck + public class Origin : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // O + (char)0x00 + r + (char)0x00 + i + (char)0x00 + g + (char)0x00 + i + (char)0x00 + n + (char)0x00 + S + (char)0x00 + e + (char)0x00 + t + (char)0x00 + u + (char)0x00 + p + (char)0x00 + . + (char)0x00 + e + (char)0x00 + x + (char)0x00 + e + (char)0x00 byte[] check = new byte[] { 0x4F, 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x53, 0x00, 0x65, 0x00, 0x74, 0x00, 0x75, 0x00, 0x70, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs index 82e7190c..07e857db 100644 --- a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs +++ b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs @@ -1,20 +1,21 @@ namespace BurnOutSharp.ProtectionType { - public class PSXAntiModchip + public class PSXAntiModchip : IContentCheck { // TODO: Figure out PSX binary header so this can be checked explicitly // TODO: Detect Red Hand protection - public static string CheckContents(byte[] fileContent) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // " SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690" byte[] check = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x4F, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x54, 0x45, 0x52, 0x4D, 0x49, 0x4E, 0x41, 0x54, 0x45, 0x44, 0x5C, 0x6E, 0x43, 0x4F, 0x4E, 0x53, 0x4F, 0x4C, 0x45, 0x20, 0x4D, 0x41, 0x59, 0x20, 0x48, 0x41, 0x56, 0x45, 0x20, 0x42, 0x45, 0x45, 0x4E, 0x20, 0x4D, 0x4F, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5C, 0x6E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x41, 0x4C, 0x4C, 0x20, 0x31, 0x2D, 0x38, 0x38, 0x38, 0x2D, 0x37, 0x38, 0x30, 0x2D, 0x37, 0x36, 0x39, 0x30 }; if (fileContent.Contains(check, out int position)) - return $"PlayStation Anti-modchip (English) (Index {position})"; + return $"PlayStation Anti-modchip (English)" + (includePosition ? $"(Index {position})" : string.Empty); // "強制終了しました。\n本体が改造されている\nおそれがあります。" check = new byte[] { 0x5F, 0x37, 0x52, 0x36, 0x7D, 0x42, 0x4E, 0x86, 0x30, 0x57, 0x30, 0x7E, 0x30, 0x57, 0x30, 0x5F, 0x30, 0x02, 0x5C, 0x6E, 0x67, 0x2C, 0x4F, 0x53, 0x30, 0x4C, 0x65, 0x39, 0x90, 0x20, 0x30, 0x55, 0x30, 0x8C, 0x30, 0x66, 0x30, 0x44, 0x30, 0x8B, 0x5C, 0x6E, 0x30, 0x4A, 0x30, 0x5D, 0x30, 0x8C, 0x30, 0x4C, 0x30, 0x42, 0x30, 0x8A, 0x30, 0x7E, 0x30, 0x59, 0x30, 0x02 }; if (fileContent.Contains(check, out position)) - return $"PlayStation Anti-modchip (Japanese) (Index {position})"; + return $"PlayStation Anti-modchip (Japanese)" + (includePosition ? $"(Index {position})" : string.Empty); return null; } diff --git a/BurnOutSharp/ProtectionType/ProtectDisc.cs b/BurnOutSharp/ProtectionType/ProtectDisc.cs index 5008745c..28fc9ad6 100644 --- a/BurnOutSharp/ProtectionType/ProtectDisc.cs +++ b/BurnOutSharp/ProtectionType/ProtectDisc.cs @@ -6,9 +6,10 @@ using System.Threading; namespace BurnOutSharp.ProtectionType { - public class ProtectDisc + public class ProtectDisc : IContentCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "HúMETINF" byte[] check = new byte[] { 0x48, 0xFA, 0x4D, 0x45, 0x54, 0x49, 0x4E, 0x46 }; diff --git a/BurnOutSharp/ProtectionType/RingPROTECH.cs b/BurnOutSharp/ProtectionType/RingPROTECH.cs index a80494bf..a998d95b 100644 --- a/BurnOutSharp/ProtectionType/RingPROTECH.cs +++ b/BurnOutSharp/ProtectionType/RingPROTECH.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class RingPROTECH + public class RingPROTECH : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // (char)0x00 + "Allocator" + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 byte[] check = new byte[] { 0x00, 0x41, 0x6C, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/SVKProtector.cs b/BurnOutSharp/ProtectionType/SVKProtector.cs index df689d43..361199cb 100644 --- a/BurnOutSharp/ProtectionType/SVKProtector.cs +++ b/BurnOutSharp/ProtectionType/SVKProtector.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class SVKProtector + public class SVKProtector : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "?SVKP" + (char)0x00 + (char)0x00 byte[] check = new byte[] { 0x3F, 0x53, 0x56, 0x4B, 0x50, 0x00, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/SafeDisc.cs b/BurnOutSharp/ProtectionType/SafeDisc.cs index 86626200..249f0e1f 100644 --- a/BurnOutSharp/ProtectionType/SafeDisc.cs +++ b/BurnOutSharp/ProtectionType/SafeDisc.cs @@ -7,9 +7,10 @@ using System.Text; namespace BurnOutSharp.ProtectionType { - public class SafeDisc : IPathCheck + public class SafeDisc : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "BoG_ *90.0&!! Yy>" byte[] check = new byte[] { 0x42, 0x6F, 0x47, 0x5F, 0x20, 0x2A, 0x39, 0x30, 0x2E, 0x30, 0x26, 0x21, 0x21, 0x20, 0x20, 0x59, 0x79, 0x3E }; diff --git a/BurnOutSharp/ProtectionType/SafeLock.cs b/BurnOutSharp/ProtectionType/SafeLock.cs index 30994205..571b13a0 100644 --- a/BurnOutSharp/ProtectionType/SafeLock.cs +++ b/BurnOutSharp/ProtectionType/SafeLock.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class SafeLock : IPathCheck + public class SafeLock : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "SafeLock" byte[] check = new byte[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B }; diff --git a/BurnOutSharp/ProtectionType/SecuROM.cs b/BurnOutSharp/ProtectionType/SecuROM.cs index a0186f04..73e9b1eb 100644 --- a/BurnOutSharp/ProtectionType/SecuROM.cs +++ b/BurnOutSharp/ProtectionType/SecuROM.cs @@ -6,9 +6,10 @@ using System.Text; namespace BurnOutSharp.ProtectionType { - public class SecuROM : IPathCheck + public class SecuROM : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "AddD" + (char)0x03 + (char)0x00 + (char)0x00 + (char)0x00) byte[] check = new byte[] { 0x41, 0x64, 0x64, 0x44, 0x03, 0x00, 0x00, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/SmartE.cs b/BurnOutSharp/ProtectionType/SmartE.cs index cda97c81..7c5c44f7 100644 --- a/BurnOutSharp/ProtectionType/SmartE.cs +++ b/BurnOutSharp/ProtectionType/SmartE.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class SmartE : IPathCheck + public class SmartE : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // BITARTS byte[] check = new byte[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }; diff --git a/BurnOutSharp/ProtectionType/SolidShield.cs b/BurnOutSharp/ProtectionType/SolidShield.cs index ea7c0015..6c1144bf 100644 --- a/BurnOutSharp/ProtectionType/SolidShield.cs +++ b/BurnOutSharp/ProtectionType/SolidShield.cs @@ -6,9 +6,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class SolidShield : IPathCheck + public class SolidShield : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "D" + (char)0x00 + "V" + (char)0x00 + "M" + (char)0x00 + " " + (char)0x00 + "L" + (char)0x00 + "i" + (char)0x00 + "b" + (char)0x00 + "r" + (char)0x00 + "a" + (char)0x00 + "r" + (char)0x00 + "y" byte[] check = new byte[] { 0x44, 0x00, 0x56, 0x00, 0x4D, 0x00, 0x20, 0x00, 0x4C, 0x00, 0x69, 0x00, 0x62, 0x00, 0x72, 0x00, 0x61, 0x00, 0x72, 0x00, 0x79 }; diff --git a/BurnOutSharp/ProtectionType/StarForce.cs b/BurnOutSharp/ProtectionType/StarForce.cs index 8ea45eff..7f79a16b 100644 --- a/BurnOutSharp/ProtectionType/StarForce.cs +++ b/BurnOutSharp/ProtectionType/StarForce.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class StarForce : IPathCheck + public class StarForce : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "(" + (char)0x00 + "c" + (char)0x00 + ")" + (char)0x00 + " " + (char)0x00 + "P" + (char)0x00 + "r" + (char)0x00 + "o" + (char)0x00 + "t" + (char)0x00 + "e" + (char)0x00 + "c" + (char)0x00 + "t" + (char)0x00 + "i" + (char)0x00 + "o" + (char)0x00 + "n" + (char)0x00 + " " + (char)0x00 + "T" + (char)0x00 + "e" + (char)0x00 + "c" + (char)0x00 + "h" + (char)0x00 + "n" + (char)0x00 + "o" + (char)0x00 + "l" + (char)0x00 + "o" + (char)0x00 + "g" + (char)0x00 + "y" + (char)0x00 byte[] check = new byte[] { 0x28, 0x00, 0x63, 0x00, 0x29, 0x00, 0x20, 0x00, 0x50, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x67, 0x00, 0x79, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/Sysiphus.cs b/BurnOutSharp/ProtectionType/Sysiphus.cs index 648179d2..6917d052 100644 --- a/BurnOutSharp/ProtectionType/Sysiphus.cs +++ b/BurnOutSharp/ProtectionType/Sysiphus.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class Sysiphus + public class Sysiphus : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "V SUHPISYSDVD" byte[] check = new byte[] { 0x56, 0x20, 0x53, 0x55, 0x48, 0x50, 0x49, 0x53, 0x59, 0x53, 0x44, 0x56, 0x44 }; diff --git a/BurnOutSharp/ProtectionType/Tages.cs b/BurnOutSharp/ProtectionType/Tages.cs index 8deee7f4..e613c5a6 100644 --- a/BurnOutSharp/ProtectionType/Tages.cs +++ b/BurnOutSharp/ProtectionType/Tages.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class Tages : IPathCheck + public class Tages : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "protected-tages-runtime.exe" byte[] check = new byte[] { 0x70, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x2D, 0x74, 0x61, 0x67, 0x65, 0x73, 0x2D, 0x72, 0x75, 0x6E, 0x74, 0x69, 0x6D, 0x65, 0x2E, 0x65, 0x78, 0x65 }; diff --git a/BurnOutSharp/ProtectionType/ThreePLock.cs b/BurnOutSharp/ProtectionType/ThreePLock.cs index 426a06b0..28dd51b1 100644 --- a/BurnOutSharp/ProtectionType/ThreePLock.cs +++ b/BurnOutSharp/ProtectionType/ThreePLock.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class ThreePLock + public class ThreePLock : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // .ldr byte[] check = new byte[] { 0x2E, 0x6C, 0x64, 0x72 }; diff --git a/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs index b0da2f57..47c2af45 100644 --- a/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs +++ b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class ThreeTwoOneStudios + public class ThreeTwoOneStudios : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // 3 + (char)0x00 + 1 + 2 + (char)0x00 + 1 + (char)0x00 + S + (char)0x00 + t + (char)0x00 + u + (char)0x00 + d + (char)0x00 + i + (char)0x00 + o + (char)0x00 + s + (char)0x00 + + (char)0x00 + A + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + v + (char)0x00 + a + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 byte[] check = new byte[] { 0x33, 0x00, 0x32, 0x00, 0x31, 0x00, 0x53, 0x00, 0x74, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x73, 0x00, 0x20, 0x00, 0x41, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x76, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00 }; diff --git a/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs b/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs index 5d5fb474..7eef2676 100644 --- a/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs +++ b/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs @@ -7,9 +7,10 @@ using System.Threading; namespace BurnOutSharp.ProtectionType { - public class VOBProtectCDDVD : IPathCheck + public class VOBProtectCDDVD : IContentCheck, IPathCheck { - public static string CheckContents(string file, byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "VOB ProtectCD" byte[] check = new byte[] { 0x56, 0x4F, 0x42, 0x20, 0x50, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x43, 0x44 }; diff --git a/BurnOutSharp/ProtectionType/WTMCDProtect.cs b/BurnOutSharp/ProtectionType/WTMCDProtect.cs index d1dc1703..8ec7ce50 100644 --- a/BurnOutSharp/ProtectionType/WTMCDProtect.cs +++ b/BurnOutSharp/ProtectionType/WTMCDProtect.cs @@ -5,9 +5,10 @@ using System.Linq; namespace BurnOutSharp.ProtectionType { - public class WTMCDProtect : IPathCheck + public class WTMCDProtect : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "WTM76545" byte[] check = new byte[] { 0x57, 0x54, 0x4D, 0x37, 0x36, 0x35, 0x34, 0x35 }; diff --git a/BurnOutSharp/ProtectionType/XCP.cs b/BurnOutSharp/ProtectionType/XCP.cs index f8421875..53b7d55d 100644 --- a/BurnOutSharp/ProtectionType/XCP.cs +++ b/BurnOutSharp/ProtectionType/XCP.cs @@ -6,9 +6,10 @@ using BurnOutSharp.FileType; namespace BurnOutSharp.ProtectionType { - public class XCP : IPathCheck + public class XCP : IContentCheck, IPathCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // XCP.DAT byte[] check = new byte[] { 0x58, 0x43, 0x50, 0x2E, 0x44, 0x41, 0x54 }; diff --git a/BurnOutSharp/ProtectionType/XtremeProtector.cs b/BurnOutSharp/ProtectionType/XtremeProtector.cs index 94355171..d348bea6 100644 --- a/BurnOutSharp/ProtectionType/XtremeProtector.cs +++ b/BurnOutSharp/ProtectionType/XtremeProtector.cs @@ -1,8 +1,9 @@ namespace BurnOutSharp.ProtectionType { - public class XtremeProtector + public class XtremeProtector : IContentCheck { - public static string CheckContents(byte[] fileContent, bool includePosition = false) + /// + public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { // "XPROT " byte[] check = new byte[] { 0x58, 0x50, 0x52, 0x4F, 0x54, 0x20, 0x20, 0x20 };