From f9f2e0d932b38cbdecb6604fd0f042cea848a4d8 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 1 May 2022 17:17:15 -0700 Subject: [PATCH] Better naming --- BurnOutSharp/FileType/Executable.cs | 10 ++++---- BurnOutSharp/IContentCheck.cs | 11 ++------- ...ContentCheck.cs => INewExecutableCheck.cs} | 5 ++-- ...ntCheck.cs => IPortableExecutableCheck.cs} | 7 +++--- BurnOutSharp/PackerType/AdvancedInstaller.cs | 4 ++-- BurnOutSharp/PackerType/Armadillo.cs | 4 ++-- .../PackerType/AutoPlayMediaStudio.cs | 4 ++-- BurnOutSharp/PackerType/CExe.cs | 4 ++-- BurnOutSharp/PackerType/EXEStealth.cs | 7 +++--- BurnOutSharp/PackerType/GenteeInstaller.cs | 4 ++-- BurnOutSharp/PackerType/InnoSetup.cs | 6 ++--- BurnOutSharp/PackerType/InstallAnywhere.cs | 4 ++-- BurnOutSharp/PackerType/InstallerVISE.cs | 4 ++-- .../PackerType/IntelInstallationFramework.cs | 4 ++-- BurnOutSharp/PackerType/MicrosoftCABSFX.cs | 4 ++-- BurnOutSharp/PackerType/NSIS.cs | 4 ++-- BurnOutSharp/PackerType/PECompact.cs | 4 ++-- BurnOutSharp/PackerType/Petite.cs | 4 ++-- BurnOutSharp/PackerType/SetupFactory.cs | 4 ++-- BurnOutSharp/PackerType/Shrinker.cs | 4 ++-- BurnOutSharp/PackerType/UPX.cs | 4 ++-- BurnOutSharp/PackerType/WinRARSFX.cs | 4 ++-- BurnOutSharp/PackerType/WinZipSFX.cs | 6 ++--- BurnOutSharp/PackerType/WiseInstaller.cs | 6 ++--- BurnOutSharp/PackerType/dotFuscator.cs | 4 ++-- BurnOutSharp/ProtectionType/ActiveMARK.cs | 7 +++--- BurnOutSharp/ProtectionType/AlphaROM.cs | 4 ++-- BurnOutSharp/ProtectionType/CDCheck.cs | 4 ++-- BurnOutSharp/ProtectionType/CDDVDCops.cs | 8 +++---- BurnOutSharp/ProtectionType/CDKey.cs | 4 ++-- BurnOutSharp/ProtectionType/CDLock.cs | 4 ++-- BurnOutSharp/ProtectionType/CDSHiELDSE.cs | 4 ++-- .../ProtectionType/CactusDataShield.cs | 7 +++--- .../ProtectionType/CenegaProtectDVD.cs | 4 ++-- BurnOutSharp/ProtectionType/CodeLock.cs | 7 +++--- BurnOutSharp/ProtectionType/CopyKiller.cs | 4 +--- BurnOutSharp/ProtectionType/ElectronicArts.cs | 4 ++-- BurnOutSharp/ProtectionType/GFWL.cs | 4 ++-- BurnOutSharp/ProtectionType/ImpulseReactor.cs | 4 ++-- BurnOutSharp/ProtectionType/Intenium.cs | 4 ++-- BurnOutSharp/ProtectionType/JoWood.cs | 4 ++-- BurnOutSharp/ProtectionType/Key2AudioXS.cs | 4 ++-- BurnOutSharp/ProtectionType/KeyLock.cs | 4 +--- BurnOutSharp/ProtectionType/LaserLok.cs | 4 ++-- BurnOutSharp/ProtectionType/MediaMaxCD3.cs | 4 ++-- .../ProtectionType/OnlineRegistration.cs | 4 ++-- BurnOutSharp/ProtectionType/Origin.cs | 4 ++-- BurnOutSharp/ProtectionType/PSXAntiModchip.cs | 4 +--- BurnOutSharp/ProtectionType/ProtectDisc.cs | 4 ++-- BurnOutSharp/ProtectionType/RingPROTECH.cs | 4 +--- BurnOutSharp/ProtectionType/SVKP.cs | 4 ++-- BurnOutSharp/ProtectionType/SafeDisc.cs | 4 ++-- BurnOutSharp/ProtectionType/SecuROM.cs | 4 ++-- BurnOutSharp/ProtectionType/SmartE.cs | 4 ++-- BurnOutSharp/ProtectionType/SolidShield.cs | 4 ++-- BurnOutSharp/ProtectionType/StarForce.cs | 4 ++-- BurnOutSharp/ProtectionType/Steam.cs | 4 ++-- BurnOutSharp/ProtectionType/Sysiphus.cs | 4 ++-- BurnOutSharp/ProtectionType/Tages.cs | 4 ++-- BurnOutSharp/ProtectionType/ThreePLock.cs | 4 ++-- .../ProtectionType/ThreeTwoOneStudios.cs | 4 ++-- BurnOutSharp/ProtectionType/Uplay.cs | 4 ++-- BurnOutSharp/ProtectionType/WTMCDProtect.cs | 4 ++-- BurnOutSharp/ProtectionType/XCP.cs | 4 ++-- BurnOutSharp/ScanningClasses.cs | 24 +++++++++---------- 65 files changed, 149 insertions(+), 170 deletions(-) rename BurnOutSharp/{INEContentCheck.cs => INewExecutableCheck.cs} (71%) rename BurnOutSharp/{IPEContentCheck.cs => IPortableExecutableCheck.cs} (70%) diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index ed75bfa5..9eadf942 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -93,7 +93,7 @@ namespace BurnOutSharp.FileType { Parallel.ForEach(ScanningClasses.ContentCheckClasses, contentCheckClass => { - string protection = contentCheckClass.CheckContents(file, fileContent, scanner.IncludeDebug, pex, nex); + string protection = contentCheckClass.CheckContents(file, fileContent, scanner.IncludeDebug); if (ShouldAddProtection(contentCheckClass, scanner.ScanPackers, protection)) Utilities.AppendToDictionary(protections, file, protection); @@ -113,10 +113,10 @@ namespace BurnOutSharp.FileType // If we have a NE executable, iterate through all NE content checks if (nex?.Initialized == true) { - Parallel.ForEach(ScanningClasses.NEContentCheckClasses, contentCheckClass => + Parallel.ForEach(ScanningClasses.NewExecutableCheckClasses, contentCheckClass => { // Check using custom content checks first - string protection = contentCheckClass.CheckNEContents(file, nex, scanner.IncludeDebug); + string protection = contentCheckClass.CheckNewExecutable(file, nex, scanner.IncludeDebug); if (ShouldAddProtection(contentCheckClass, scanner.ScanPackers, protection)) Utilities.AppendToDictionary(protections, file, protection); @@ -136,10 +136,10 @@ namespace BurnOutSharp.FileType // If we have a PE executable, iterate through all PE content checks if (pex?.Initialized == true) { - Parallel.ForEach(ScanningClasses.PEContentCheckClasses, contentCheckClass => + Parallel.ForEach(ScanningClasses.PortableExecutableCheckClasses, contentCheckClass => { // Check using custom content checks first - string protection = contentCheckClass.CheckPEContents(file, pex, scanner.IncludeDebug); + string protection = contentCheckClass.CheckPortableExecutable(file, pex, scanner.IncludeDebug); if (ShouldAddProtection(contentCheckClass, scanner.ScanPackers, protection)) Utilities.AppendToDictionary(protections, file, protection); diff --git a/BurnOutSharp/IContentCheck.cs b/BurnOutSharp/IContentCheck.cs index 53cbb9ca..95071b66 100644 --- a/BurnOutSharp/IContentCheck.cs +++ b/BurnOutSharp/IContentCheck.cs @@ -1,21 +1,14 @@ -using BurnOutSharp.ExecutableType.Microsoft.NE; -using BurnOutSharp.ExecutableType.Microsoft.PE; - -namespace BurnOutSharp +namespace BurnOutSharp { - // TODO: This should either include an override that takes a Stream instead of the byte[] - // TODO: This should be retired in lieu of the I*ContentCheck interfaces internal interface IContentCheck { /// /// Check a path for protections based on file contents /// - /// PortableExecutable representing the read-in file /// File to check for protection indicators /// Byte array representing the file contents /// True to include debug data, false otherwise /// String containing any protections found in the file - /// This still includes PE and NE because this is primarily used for debug testing - string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex); + string CheckContents(string file, byte[] fileContent, bool includeDebug); } } diff --git a/BurnOutSharp/INEContentCheck.cs b/BurnOutSharp/INewExecutableCheck.cs similarity index 71% rename from BurnOutSharp/INEContentCheck.cs rename to BurnOutSharp/INewExecutableCheck.cs index 9ac9ff79..9718fa13 100644 --- a/BurnOutSharp/INEContentCheck.cs +++ b/BurnOutSharp/INewExecutableCheck.cs @@ -2,8 +2,7 @@ namespace BurnOutSharp { - // TODO: This should either include an override that takes a Stream instead of the byte[] - internal interface INEContentCheck + internal interface INewExecutableCheck { /// /// Check a path for protections based on file contents @@ -12,6 +11,6 @@ namespace BurnOutSharp /// NewExecutable representing the read-in file /// True to include debug data, false otherwise /// String containing any protections found in the file - string CheckNEContents(string file, NewExecutable nex, bool includeDebug); + string CheckNewExecutable(string file, NewExecutable nex, bool includeDebug); } } diff --git a/BurnOutSharp/IPEContentCheck.cs b/BurnOutSharp/IPortableExecutableCheck.cs similarity index 70% rename from BurnOutSharp/IPEContentCheck.cs rename to BurnOutSharp/IPortableExecutableCheck.cs index 7c7c666f..e15055e3 100644 --- a/BurnOutSharp/IPEContentCheck.cs +++ b/BurnOutSharp/IPortableExecutableCheck.cs @@ -2,16 +2,15 @@ namespace BurnOutSharp { - // TODO: This should either include an override that takes a Stream instead of the byte[] - internal interface IPEContentCheck + internal interface IPortableExecutableCheck { /// /// Check a path for protections based on file contents /// /// File to check for protection indicators - /// True to include debug data, false otherwise /// PortableExecutable representing the read-in file + /// True to include debug data, false otherwise /// String containing any protections found in the file - string CheckPEContents(string file, PortableExecutable pex, bool includeDebug); + string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug); } } diff --git a/BurnOutSharp/PackerType/AdvancedInstaller.cs b/BurnOutSharp/PackerType/AdvancedInstaller.cs index 17e77689..7945c729 100644 --- a/BurnOutSharp/PackerType/AdvancedInstaller.cs +++ b/BurnOutSharp/PackerType/AdvancedInstaller.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { // TODO: Add extraction and verify that all versions are detected - public class AdvancedInstaller : IPEContentCheck + public class AdvancedInstaller : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/Armadillo.cs b/BurnOutSharp/PackerType/Armadillo.cs index 70705cf0..102841e4 100644 --- a/BurnOutSharp/PackerType/Armadillo.cs +++ b/BurnOutSharp/PackerType/Armadillo.cs @@ -7,10 +7,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { // TODO: Add version checking, if possible - public class Armadillo : IPEContentCheck + public class Armadillo : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/AutoPlayMediaStudio.cs b/BurnOutSharp/PackerType/AutoPlayMediaStudio.cs index a3671b12..d31d1381 100644 --- a/BurnOutSharp/PackerType/AutoPlayMediaStudio.cs +++ b/BurnOutSharp/PackerType/AutoPlayMediaStudio.cs @@ -8,13 +8,13 @@ namespace BurnOutSharp.PackerType { // Created by IndigoRose (creators of Setup Factory), primarily to be used to create autorun menus for various media. // Official website: https://www.autoplay.org/ - public class AutoPlayMediaStudio : IPEContentCheck, IScannable + public class AutoPlayMediaStudio : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/CExe.cs b/BurnOutSharp/PackerType/CExe.cs index f7ffbbd1..1c476bfb 100644 --- a/BurnOutSharp/PackerType/CExe.cs +++ b/BurnOutSharp/PackerType/CExe.cs @@ -8,13 +8,13 @@ namespace BurnOutSharp.PackerType { // The official website for CExe also includes the source code (which does have to be retrieved by the Wayback Machine) // http://www.scottlu.com/Content/CExe.html - public class CExe : IPEContentCheck, IScannable + public class CExe : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var stub = pex?.DOSStubHeader; diff --git a/BurnOutSharp/PackerType/EXEStealth.cs b/BurnOutSharp/PackerType/EXEStealth.cs index 4ffbcf9e..638a8fe5 100644 --- a/BurnOutSharp/PackerType/EXEStealth.cs +++ b/BurnOutSharp/PackerType/EXEStealth.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using BurnOutSharp.ExecutableType.Microsoft.NE; using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; @@ -8,10 +7,10 @@ namespace BurnOutSharp.PackerType // TODO: Figure out how to more granularly determine versions like PiD, // at least for the 2.41 -> 2.75 range // TODO: Detect 3.15 and up (maybe looking for `Metamorphism`) - public class EXEStealth : IContentCheck, IPEContentCheck + public class EXEStealth : IContentCheck, IPortableExecutableCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) @@ -36,7 +35,7 @@ namespace BurnOutSharp.PackerType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/GenteeInstaller.cs b/BurnOutSharp/PackerType/GenteeInstaller.cs index 1a8927f4..cf2f6122 100644 --- a/BurnOutSharp/PackerType/GenteeInstaller.cs +++ b/BurnOutSharp/PackerType/GenteeInstaller.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { // TODO: Add extraction - public class GenteeInstaller : IPEContentCheck + public class GenteeInstaller : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/InnoSetup.cs b/BurnOutSharp/PackerType/InnoSetup.cs index 543d9db9..11501e58 100644 --- a/BurnOutSharp/PackerType/InnoSetup.cs +++ b/BurnOutSharp/PackerType/InnoSetup.cs @@ -10,13 +10,13 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { - public class InnoSetup : INEContentCheck, IPEContentCheck, IScannable + public class InnoSetup : INewExecutableCheck, IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckNEContents(string file, NewExecutable nex, bool includeDebug) + public string CheckNewExecutable(string file, NewExecutable nex, bool includeDebug) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -37,7 +37,7 @@ namespace BurnOutSharp.PackerType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/InstallAnywhere.cs b/BurnOutSharp/PackerType/InstallAnywhere.cs index 51ac29b1..c8a3ed40 100644 --- a/BurnOutSharp/PackerType/InstallAnywhere.cs +++ b/BurnOutSharp/PackerType/InstallAnywhere.cs @@ -6,13 +6,13 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { - public class InstallAnywhere : IPEContentCheck, IScannable + public class InstallAnywhere : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/InstallerVISE.cs b/BurnOutSharp/PackerType/InstallerVISE.cs index d9173db6..2359be45 100644 --- a/BurnOutSharp/PackerType/InstallerVISE.cs +++ b/BurnOutSharp/PackerType/InstallerVISE.cs @@ -6,14 +6,14 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { - public class InstallerVISE : IPEContentCheck, IScannable + public class InstallerVISE : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; //TODO: Add exact version detection for Windows builds, make sure versions before 3.X are detected as well, and detect the Mac builds. /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/IntelInstallationFramework.cs b/BurnOutSharp/PackerType/IntelInstallationFramework.cs index b931282e..12601df8 100644 --- a/BurnOutSharp/PackerType/IntelInstallationFramework.cs +++ b/BurnOutSharp/PackerType/IntelInstallationFramework.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { // TODO: Add extraction, seems to primarily use MSZip compression. - public class IntelInstallationFramework : IPEContentCheck + public class IntelInstallationFramework : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/MicrosoftCABSFX.cs b/BurnOutSharp/PackerType/MicrosoftCABSFX.cs index 41a78956..7bbdc07a 100644 --- a/BurnOutSharp/PackerType/MicrosoftCABSFX.cs +++ b/BurnOutSharp/PackerType/MicrosoftCABSFX.cs @@ -9,13 +9,13 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { // TODO: Add extraction, which should be possible with LibMSPackN, but it refuses to extract due to SFX files lacking the typical CAB identifiers. - public class MicrosoftCABSFX : IPEContentCheck, IScannable + public class MicrosoftCABSFX : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/NSIS.cs b/BurnOutSharp/PackerType/NSIS.cs index 91ebc6b1..cfcb520f 100644 --- a/BurnOutSharp/PackerType/NSIS.cs +++ b/BurnOutSharp/PackerType/NSIS.cs @@ -4,10 +4,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { - public class NSIS : IPEContentCheck + public class NSIS : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/PECompact.cs b/BurnOutSharp/PackerType/PECompact.cs index 17218186..b32e76ae 100644 --- a/BurnOutSharp/PackerType/PECompact.cs +++ b/BurnOutSharp/PackerType/PECompact.cs @@ -3,10 +3,10 @@ namespace BurnOutSharp.PackerType { // TODO: Add extraction and better version detection - public class PECompact : IPEContentCheck + public class PECompact : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/Petite.cs b/BurnOutSharp/PackerType/Petite.cs index 3b84f9e6..188c58ce 100644 --- a/BurnOutSharp/PackerType/Petite.cs +++ b/BurnOutSharp/PackerType/Petite.cs @@ -2,10 +2,10 @@ namespace BurnOutSharp.PackerType { - public class PEtite : IPEContentCheck + public class PEtite : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/SetupFactory.cs b/BurnOutSharp/PackerType/SetupFactory.cs index d1854e14..5e564b69 100644 --- a/BurnOutSharp/PackerType/SetupFactory.cs +++ b/BurnOutSharp/PackerType/SetupFactory.cs @@ -6,13 +6,13 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { - public class SetupFactory : IPEContentCheck, IScannable + public class SetupFactory : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/Shrinker.cs b/BurnOutSharp/PackerType/Shrinker.cs index 3bc4cba6..7f567d68 100644 --- a/BurnOutSharp/PackerType/Shrinker.cs +++ b/BurnOutSharp/PackerType/Shrinker.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { // TODO: Add extraction - public class Shrinker : IPEContentCheck + public class Shrinker : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/UPX.cs b/BurnOutSharp/PackerType/UPX.cs index 123b9e22..2bcb2b3c 100644 --- a/BurnOutSharp/PackerType/UPX.cs +++ b/BurnOutSharp/PackerType/UPX.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { - public class UPX : IPEContentCheck + public class UPX : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/WinRARSFX.cs b/BurnOutSharp/PackerType/WinRARSFX.cs index a663bbd5..481dd32b 100644 --- a/BurnOutSharp/PackerType/WinRARSFX.cs +++ b/BurnOutSharp/PackerType/WinRARSFX.cs @@ -10,13 +10,13 @@ using SharpCompress.Archives.Rar; namespace BurnOutSharp.PackerType { - public class WinRARSFX : IPEContentCheck, IScannable + public class WinRARSFX : IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/WinZipSFX.cs b/BurnOutSharp/PackerType/WinZipSFX.cs index 4607e145..2a55be30 100644 --- a/BurnOutSharp/PackerType/WinZipSFX.cs +++ b/BurnOutSharp/PackerType/WinZipSFX.cs @@ -12,13 +12,13 @@ using SharpCompress.Archives.Zip; namespace BurnOutSharp.PackerType { - public class WinZipSFX : INEContentCheck, IPEContentCheck, IScannable + public class WinZipSFX : INewExecutableCheck, IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckNEContents(string file, NewExecutable nex, bool includeDebug) + public string CheckNewExecutable(string file, NewExecutable nex, bool includeDebug) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -37,7 +37,7 @@ namespace BurnOutSharp.PackerType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/WiseInstaller.cs b/BurnOutSharp/PackerType/WiseInstaller.cs index 4bd0250d..dab675a0 100644 --- a/BurnOutSharp/PackerType/WiseInstaller.cs +++ b/BurnOutSharp/PackerType/WiseInstaller.cs @@ -10,13 +10,13 @@ using Wise = WiseUnpacker.WiseUnpacker; namespace BurnOutSharp.PackerType { - public class WiseInstaller : INEContentCheck, IPEContentCheck, IScannable + public class WiseInstaller : INewExecutableCheck, IPortableExecutableCheck, IScannable { /// public bool ShouldScan(byte[] magic) => true; /// - public string CheckNEContents(string file, NewExecutable nex, bool includeDebug) + public string CheckNewExecutable(string file, NewExecutable nex, bool includeDebug) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -40,7 +40,7 @@ namespace BurnOutSharp.PackerType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/PackerType/dotFuscator.cs b/BurnOutSharp/PackerType/dotFuscator.cs index 7c2e3fb6..57a4f225 100644 --- a/BurnOutSharp/PackerType/dotFuscator.cs +++ b/BurnOutSharp/PackerType/dotFuscator.cs @@ -4,10 +4,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.PackerType { - public class dotFuscator : IPEContentCheck + public class dotFuscator : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/ActiveMARK.cs b/BurnOutSharp/ProtectionType/ActiveMARK.cs index 2a11725b..7369c4c4 100644 --- a/BurnOutSharp/ProtectionType/ActiveMARK.cs +++ b/BurnOutSharp/ProtectionType/ActiveMARK.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using BurnOutSharp.ExecutableType.Microsoft.NE; using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { // TODO: Figure out how to get version numbers - public class ActiveMARK : IContentCheck, IPEContentCheck + public class ActiveMARK : IContentCheck, IPortableExecutableCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) @@ -32,7 +31,7 @@ namespace BurnOutSharp.ProtectionType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/AlphaROM.cs b/BurnOutSharp/ProtectionType/AlphaROM.cs index 1318b69e..1de66526 100644 --- a/BurnOutSharp/ProtectionType/AlphaROM.cs +++ b/BurnOutSharp/ProtectionType/AlphaROM.cs @@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType // - SETTEC0000SETTEC1111 // - SOFTWARE\SETTEC // TODO: Are there version numbers? - public class AlphaROM : IPEContentCheck + public class AlphaROM : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CDCheck.cs b/BurnOutSharp/ProtectionType/CDCheck.cs index d465fda3..1d5c333c 100644 --- a/BurnOutSharp/ProtectionType/CDCheck.cs +++ b/BurnOutSharp/ProtectionType/CDCheck.cs @@ -4,10 +4,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class CDCheck : IPEContentCheck + public class CDCheck : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CDDVDCops.cs b/BurnOutSharp/ProtectionType/CDDVDCops.cs index 595b071b..96970692 100644 --- a/BurnOutSharp/ProtectionType/CDDVDCops.cs +++ b/BurnOutSharp/ProtectionType/CDDVDCops.cs @@ -8,10 +8,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class CDDVDCops : IContentCheck, INEContentCheck, IPEContentCheck, IPathCheck + public class CDDVDCops : IContentCheck, INewExecutableCheck, IPortableExecutableCheck, IPathCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) @@ -41,7 +41,7 @@ namespace BurnOutSharp.ProtectionType } /// - public string CheckNEContents(string file, NewExecutable nex, bool includeDebug) + public string CheckNewExecutable(string file, NewExecutable nex, bool includeDebug) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -72,7 +72,7 @@ namespace BurnOutSharp.ProtectionType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CDKey.cs b/BurnOutSharp/ProtectionType/CDKey.cs index 7f81f1a3..6506c3d8 100644 --- a/BurnOutSharp/ProtectionType/CDKey.cs +++ b/BurnOutSharp/ProtectionType/CDKey.cs @@ -3,10 +3,10 @@ using BurnOutSharp.ExecutableType.Microsoft.PE; namespace BurnOutSharp.ProtectionType { - public class CDKey : IPEContentCheck + public class CDKey : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CDLock.cs b/BurnOutSharp/ProtectionType/CDLock.cs index 8a403c39..7f9e3e71 100644 --- a/BurnOutSharp/ProtectionType/CDLock.cs +++ b/BurnOutSharp/ProtectionType/CDLock.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class CDLock : IPEContentCheck, IPathCheck + public class CDLock : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CDSHiELDSE.cs b/BurnOutSharp/ProtectionType/CDSHiELDSE.cs index 6448b7e8..fe82f424 100644 --- a/BurnOutSharp/ProtectionType/CDSHiELDSE.cs +++ b/BurnOutSharp/ProtectionType/CDSHiELDSE.cs @@ -4,10 +4,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class CDSHiELDSE : IPEContentCheck + public class CDSHiELDSE : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CactusDataShield.cs b/BurnOutSharp/ProtectionType/CactusDataShield.cs index e99ba3aa..0e32a012 100644 --- a/BurnOutSharp/ProtectionType/CactusDataShield.cs +++ b/BurnOutSharp/ProtectionType/CactusDataShield.cs @@ -4,16 +4,15 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using BurnOutSharp.ExecutableType.Microsoft.NE; using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class CactusDataShield : IContentCheck, IPEContentCheck, IPathCheck + public class CactusDataShield : IContentCheck, IPortableExecutableCheck, IPathCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Limit these checks to Mac binaries // TODO: Obtain a sample to find where this string is in a typical executable @@ -36,7 +35,7 @@ namespace BurnOutSharp.ProtectionType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CenegaProtectDVD.cs b/BurnOutSharp/ProtectionType/CenegaProtectDVD.cs index 87fe8f07..31ce9da3 100644 --- a/BurnOutSharp/ProtectionType/CenegaProtectDVD.cs +++ b/BurnOutSharp/ProtectionType/CenegaProtectDVD.cs @@ -2,10 +2,10 @@ namespace BurnOutSharp.ProtectionType { - public class CengaProtectDVD : IPEContentCheck + public class CengaProtectDVD : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CodeLock.cs b/BurnOutSharp/ProtectionType/CodeLock.cs index 3914482e..37128b7d 100644 --- a/BurnOutSharp/ProtectionType/CodeLock.cs +++ b/BurnOutSharp/ProtectionType/CodeLock.cs @@ -1,16 +1,15 @@ using System.Collections.Generic; using System.Linq; -using BurnOutSharp.ExecutableType.Microsoft.NE; using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { // CodeLock / CodeLok / CopyLok - public class CodeLock : IContentCheck, IPEContentCheck + public class CodeLock : IContentCheck, IPortableExecutableCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) @@ -32,7 +31,7 @@ namespace BurnOutSharp.ProtectionType } /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/CopyKiller.cs b/BurnOutSharp/ProtectionType/CopyKiller.cs index 864ff8fd..624ad460 100644 --- a/BurnOutSharp/ProtectionType/CopyKiller.cs +++ b/BurnOutSharp/ProtectionType/CopyKiller.cs @@ -1,7 +1,5 @@ using System.Collections.Concurrent; using System.Collections.Generic; -using BurnOutSharp.ExecutableType.Microsoft.NE; -using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType @@ -9,7 +7,7 @@ namespace BurnOutSharp.ProtectionType public class CopyKiller : IContentCheck, IPathCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) diff --git a/BurnOutSharp/ProtectionType/ElectronicArts.cs b/BurnOutSharp/ProtectionType/ElectronicArts.cs index 9df3412a..7a45482f 100644 --- a/BurnOutSharp/ProtectionType/ElectronicArts.cs +++ b/BurnOutSharp/ProtectionType/ElectronicArts.cs @@ -12,10 +12,10 @@ namespace BurnOutSharp.ProtectionType // - Look into `ccinstall`, `Services/EACOM`, `TSLHost`, `SIGS/UploadThread/exchangeAuthToken`, // `blazeURL`, `psapi.dll`, `DasmX86Dll.dll`, `NVCPL.dll`, `iphlpapi.dll`, `dbghelp.dll`, // `WS2_32.dll`, - public class ElectronicArts : IPEContentCheck + public class ElectronicArts : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/GFWL.cs b/BurnOutSharp/ProtectionType/GFWL.cs index 4afefe08..f00360a5 100644 --- a/BurnOutSharp/ProtectionType/GFWL.cs +++ b/BurnOutSharp/ProtectionType/GFWL.cs @@ -7,10 +7,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { - public class GFWL : IPEContentCheck, IPathCheck + public class GFWL : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/ImpulseReactor.cs b/BurnOutSharp/ProtectionType/ImpulseReactor.cs index 3ab3054a..703834d1 100644 --- a/BurnOutSharp/ProtectionType/ImpulseReactor.cs +++ b/BurnOutSharp/ProtectionType/ImpulseReactor.cs @@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType { // Note that this set of checks also contains "Stardock Product Activation" // This is intentional, as that protection is highly related to Impulse Reactor - public class ImpulseReactor : IPEContentCheck, IPathCheck + public class ImpulseReactor : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Intenium.cs b/BurnOutSharp/ProtectionType/Intenium.cs index 03219668..86f22e49 100644 --- a/BurnOutSharp/ProtectionType/Intenium.cs +++ b/BurnOutSharp/ProtectionType/Intenium.cs @@ -2,7 +2,7 @@ namespace BurnOutSharp.ProtectionType { - public class Intenium : IPEContentCheck + public class Intenium : IPortableExecutableCheck { /* * Possible strings for finding INTENIUM Trial & Buy Protection @@ -21,7 +21,7 @@ namespace BurnOutSharp.ProtectionType */ /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/JoWood.cs b/BurnOutSharp/ProtectionType/JoWood.cs index 24bd7192..cbecd171 100644 --- a/BurnOutSharp/ProtectionType/JoWood.cs +++ b/BurnOutSharp/ProtectionType/JoWood.cs @@ -9,10 +9,10 @@ namespace BurnOutSharp.ProtectionType // Interesting note: the former protection "Xtreme-Protector" was found to be a // subset of the JoWood X-Prot checks, more specifically the XPROT section check // that now outputs a version of v1.4+. - public class JoWood : IPEContentCheck + public class JoWood : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Key2AudioXS.cs b/BurnOutSharp/ProtectionType/Key2AudioXS.cs index 33e403b3..6fb893a3 100644 --- a/BurnOutSharp/ProtectionType/Key2AudioXS.cs +++ b/BurnOutSharp/ProtectionType/Key2AudioXS.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class Key2AudioXS : IPEContentCheck + public class Key2AudioXS : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/KeyLock.cs b/BurnOutSharp/ProtectionType/KeyLock.cs index 639e0f26..93c6311b 100644 --- a/BurnOutSharp/ProtectionType/KeyLock.cs +++ b/BurnOutSharp/ProtectionType/KeyLock.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using BurnOutSharp.ExecutableType.Microsoft.NE; -using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType @@ -8,7 +6,7 @@ namespace BurnOutSharp.ProtectionType public class KeyLock : IContentCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) diff --git a/BurnOutSharp/ProtectionType/LaserLok.cs b/BurnOutSharp/ProtectionType/LaserLok.cs index def2d208..a81bf593 100644 --- a/BurnOutSharp/ProtectionType/LaserLok.cs +++ b/BurnOutSharp/ProtectionType/LaserLok.cs @@ -9,10 +9,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { - public class LaserLok : IPEContentCheck, IPathCheck + public class LaserLok : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // TODO: Additional checks that may or may not be useful with the below // diff --git a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs index 22e65441..73b3c5c5 100644 --- a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs +++ b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class MediaMaxCD3 : IPEContentCheck, IPathCheck + public class MediaMaxCD3 : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/OnlineRegistration.cs b/BurnOutSharp/ProtectionType/OnlineRegistration.cs index ab13d4a5..28ff685d 100644 --- a/BurnOutSharp/ProtectionType/OnlineRegistration.cs +++ b/BurnOutSharp/ProtectionType/OnlineRegistration.cs @@ -4,10 +4,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { - public class OnlineRegistration : IPEContentCheck + public class OnlineRegistration : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Origin.cs b/BurnOutSharp/ProtectionType/Origin.cs index 449355b0..f77398da 100644 --- a/BurnOutSharp/ProtectionType/Origin.cs +++ b/BurnOutSharp/ProtectionType/Origin.cs @@ -6,10 +6,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class Origin : IPEContentCheck, IPathCheck + public class Origin : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs index 354a9b3e..e6c8d1e8 100644 --- a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs +++ b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using BurnOutSharp.ExecutableType.Microsoft.NE; -using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType @@ -11,7 +9,7 @@ namespace BurnOutSharp.ProtectionType // 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) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Detect Red Hand protection var contentMatchSets = new List diff --git a/BurnOutSharp/ProtectionType/ProtectDisc.cs b/BurnOutSharp/ProtectionType/ProtectDisc.cs index 80dbb78b..731c2191 100644 --- a/BurnOutSharp/ProtectionType/ProtectDisc.cs +++ b/BurnOutSharp/ProtectionType/ProtectDisc.cs @@ -8,10 +8,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { // This protection was called VOB ProtectCD / ProtectDVD in versions prior to 6 - public class ProtectDISC : IPEContentCheck + public class ProtectDISC : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/RingPROTECH.cs b/BurnOutSharp/ProtectionType/RingPROTECH.cs index 52770721..9f1ca597 100644 --- a/BurnOutSharp/ProtectionType/RingPROTECH.cs +++ b/BurnOutSharp/ProtectionType/RingPROTECH.cs @@ -1,7 +1,5 @@ using System.Collections.Concurrent; using System.Collections.Generic; -using BurnOutSharp.ExecutableType.Microsoft.NE; -using BurnOutSharp.ExecutableType.Microsoft.PE; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType @@ -10,7 +8,7 @@ namespace BurnOutSharp.ProtectionType public class RingPROTECH : IContentCheck, IPathCheck { /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, NewExecutable nex) + public string CheckContents(string file, byte[] fileContent, bool includeDebug) { // TODO: Obtain a sample to find where this string is in a typical executable if (includeDebug) diff --git a/BurnOutSharp/ProtectionType/SVKP.cs b/BurnOutSharp/ProtectionType/SVKP.cs index 735af871..b77900d5 100644 --- a/BurnOutSharp/ProtectionType/SVKP.cs +++ b/BurnOutSharp/ProtectionType/SVKP.cs @@ -3,10 +3,10 @@ namespace BurnOutSharp.ProtectionType { // TODO: Figure out how versions/version ranges work for this protection - public class SVKProtector : IPEContentCheck + public class SVKProtector : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the image file header from the executable, if possible if (pex?.ImageFileHeader == null) diff --git a/BurnOutSharp/ProtectionType/SafeDisc.cs b/BurnOutSharp/ProtectionType/SafeDisc.cs index 4c78d2d6..42975489 100644 --- a/BurnOutSharp/ProtectionType/SafeDisc.cs +++ b/BurnOutSharp/ProtectionType/SafeDisc.cs @@ -10,10 +10,10 @@ namespace BurnOutSharp.ProtectionType { // TODO: Figure out how to properly distinguish SafeDisc and SafeCast since both use // the same generic BoG_ string. The current combination check doesn't seem consistent - public class SafeDisc : IPEContentCheck, IPathCheck + public class SafeDisc : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/SecuROM.cs b/BurnOutSharp/ProtectionType/SecuROM.cs index 7ef56c49..dbc3b6ab 100644 --- a/BurnOutSharp/ProtectionType/SecuROM.cs +++ b/BurnOutSharp/ProtectionType/SecuROM.cs @@ -10,10 +10,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { // TODO: Investigate SecuROM for Macintosh - public class SecuROM : IPEContentCheck, IPathCheck + public class SecuROM : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/SmartE.cs b/BurnOutSharp/ProtectionType/SmartE.cs index cf574291..45f5bf1f 100644 --- a/BurnOutSharp/ProtectionType/SmartE.cs +++ b/BurnOutSharp/ProtectionType/SmartE.cs @@ -7,10 +7,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class SmartE : IPEContentCheck, IPathCheck + public class SmartE : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/SolidShield.cs b/BurnOutSharp/ProtectionType/SolidShield.cs index 2d235c76..aa7dd9b2 100644 --- a/BurnOutSharp/ProtectionType/SolidShield.cs +++ b/BurnOutSharp/ProtectionType/SolidShield.cs @@ -10,10 +10,10 @@ namespace BurnOutSharp.ProtectionType { // TODO: Not matching all SolidShield Wrapper v1 (See JackKeane) // TODO: Not matching all SolidShield Wrapper v1 (See NFS11) - public class SolidShield : IPEContentCheck, IPathCheck + public class SolidShield : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/StarForce.cs b/BurnOutSharp/ProtectionType/StarForce.cs index 86f3984d..8fb3608e 100644 --- a/BurnOutSharp/ProtectionType/StarForce.cs +++ b/BurnOutSharp/ProtectionType/StarForce.cs @@ -7,10 +7,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { - public class StarForce : IPEContentCheck, IPathCheck + public class StarForce : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Steam.cs b/BurnOutSharp/ProtectionType/Steam.cs index 9df68841..eb96b888 100644 --- a/BurnOutSharp/ProtectionType/Steam.cs +++ b/BurnOutSharp/ProtectionType/Steam.cs @@ -6,10 +6,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { - public class Steam : IPEContentCheck, IPathCheck + public class Steam : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Sysiphus.cs b/BurnOutSharp/ProtectionType/Sysiphus.cs index f211fdf7..0f824c0c 100644 --- a/BurnOutSharp/ProtectionType/Sysiphus.cs +++ b/BurnOutSharp/ProtectionType/Sysiphus.cs @@ -6,10 +6,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class Sysiphus : IPEContentCheck + public class Sysiphus : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Tages.cs b/BurnOutSharp/ProtectionType/Tages.cs index 13e29437..ca328ba1 100644 --- a/BurnOutSharp/ProtectionType/Tages.cs +++ b/BurnOutSharp/ProtectionType/Tages.cs @@ -8,10 +8,10 @@ using BurnOutSharp.Tools; namespace BurnOutSharp.ProtectionType { - public class TAGES : IPEContentCheck, IPathCheck + public class TAGES : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/ThreePLock.cs b/BurnOutSharp/ProtectionType/ThreePLock.cs index 6a2fead5..b99ef401 100644 --- a/BurnOutSharp/ProtectionType/ThreePLock.cs +++ b/BurnOutSharp/ProtectionType/ThreePLock.cs @@ -2,10 +2,10 @@ namespace BurnOutSharp.ProtectionType { - public class ThreePLock : IPEContentCheck + public class ThreePLock : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs index 10b8d8ab..13739169 100644 --- a/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs +++ b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs @@ -2,10 +2,10 @@ namespace BurnOutSharp.ProtectionType { - public class ThreeTwoOneStudios : IPEContentCheck + public class ThreeTwoOneStudios : IPortableExecutableCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/Uplay.cs b/BurnOutSharp/ProtectionType/Uplay.cs index 1d72d6da..a4fda610 100644 --- a/BurnOutSharp/ProtectionType/Uplay.cs +++ b/BurnOutSharp/ProtectionType/Uplay.cs @@ -6,10 +6,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { // Got renamed to Ubisoft Connect / Ubisoft Game Launcher - public class Uplay : IPEContentCheck, IPathCheck + public class Uplay : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/WTMCDProtect.cs b/BurnOutSharp/ProtectionType/WTMCDProtect.cs index ba5d250a..9ba148c6 100644 --- a/BurnOutSharp/ProtectionType/WTMCDProtect.cs +++ b/BurnOutSharp/ProtectionType/WTMCDProtect.cs @@ -5,10 +5,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { - public class WTMCDProtect : IPEContentCheck, IPathCheck + public class WTMCDProtect : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ProtectionType/XCP.cs b/BurnOutSharp/ProtectionType/XCP.cs index 6eb29995..7cadd138 100644 --- a/BurnOutSharp/ProtectionType/XCP.cs +++ b/BurnOutSharp/ProtectionType/XCP.cs @@ -10,10 +10,10 @@ using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { // TODO: Figure out how to use path check framework here - public class XCP : IPEContentCheck, IPathCheck + public class XCP : IPortableExecutableCheck, IPathCheck { /// - public string CheckPEContents(string file, PortableExecutable pex, bool includeDebug) + public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; diff --git a/BurnOutSharp/ScanningClasses.cs b/BurnOutSharp/ScanningClasses.cs index 6738fcee..c246910d 100644 --- a/BurnOutSharp/ScanningClasses.cs +++ b/BurnOutSharp/ScanningClasses.cs @@ -27,16 +27,16 @@ namespace BurnOutSharp } /// - /// Cache for all INEContentCheck types + /// Cache for all INewExecutableCheck types /// - public static IEnumerable NEContentCheckClasses + public static IEnumerable NewExecutableCheckClasses { get { - if (neContentCheckClasses == null) - neContentCheckClasses = InitCheckClasses(); + if (newExecutableCheckClasses == null) + newExecutableCheckClasses = InitCheckClasses(); - return neContentCheckClasses; + return newExecutableCheckClasses; } } @@ -55,16 +55,16 @@ namespace BurnOutSharp } /// - /// Cache for all IPEContentCheck types + /// Cache for all IPortableExecutableCheck types /// - public static IEnumerable PEContentCheckClasses + public static IEnumerable PortableExecutableCheckClasses { get { - if (peContentCheckClasses == null) - peContentCheckClasses = InitCheckClasses(); + if (portableExecutableCheckClasses == null) + portableExecutableCheckClasses = InitCheckClasses(); - return peContentCheckClasses; + return portableExecutableCheckClasses; } } @@ -80,7 +80,7 @@ namespace BurnOutSharp /// /// Cache for all INEContentCheck types /// - private static IEnumerable neContentCheckClasses; + private static IEnumerable newExecutableCheckClasses; /// /// Cache for all IPathCheck types @@ -90,7 +90,7 @@ namespace BurnOutSharp /// /// Cache for all IPEContentCheck types /// - private static IEnumerable peContentCheckClasses; + private static IEnumerable portableExecutableCheckClasses; #endregion