diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index f6c6de6c..65fb3855 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -146,7 +146,7 @@ namespace BurnOutSharp.FileType bool foundProtection = false; // Check using custom content checks first - string protection = contentCheckClass.CheckNEContents(file, fileContent, scanner.IncludeDebug, nex); + string protection = contentCheckClass.CheckNEContents(file, scanner.IncludeDebug, nex); foundProtection |= !string.IsNullOrWhiteSpace(protection); if (ShouldAddProtection(contentCheckClass, scanner, protection)) Utilities.AppendToDictionary(protections, file, protection); diff --git a/BurnOutSharp/INEContentCheck.cs b/BurnOutSharp/INEContentCheck.cs index 733a4466..d738e3b9 100644 --- a/BurnOutSharp/INEContentCheck.cs +++ b/BurnOutSharp/INEContentCheck.cs @@ -9,10 +9,9 @@ namespace BurnOutSharp /// Check a path for protections based on file contents /// /// File to check for protection indicators - /// Byte array representing the file contents /// True to include debug data, false otherwise /// NewExecutable representing the read-in file /// String containing any protections found in the file - string CheckNEContents(string file, byte[] fileContent, bool includeDebug, NewExecutable nex); + string CheckNEContents(string file, bool includeDebug, NewExecutable nex); } } diff --git a/BurnOutSharp/PackerType/InnoSetup.cs b/BurnOutSharp/PackerType/InnoSetup.cs index 0605e301..ff7ba657 100644 --- a/BurnOutSharp/PackerType/InnoSetup.cs +++ b/BurnOutSharp/PackerType/InnoSetup.cs @@ -16,7 +16,7 @@ namespace BurnOutSharp.PackerType public bool ShouldScan(byte[] magic) => true; /// - public string CheckNEContents(string file, byte[] fileContent, bool includeDebug, NewExecutable nex) + public string CheckNEContents(string file, bool includeDebug, NewExecutable nex) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -26,7 +26,7 @@ namespace BurnOutSharp.PackerType // Check for "Inno" in the reserved words if (stub.Reserved2[4] == 0x6E49 && stub.Reserved2[5] == 0x6F6E) { - string version = GetOldVersion(file, fileContent); + string version = GetOldVersion(file, nex.SourceArray); if (!string.IsNullOrWhiteSpace(version)) return $"Inno Setup {version}"; diff --git a/BurnOutSharp/PackerType/WinZipSFX.cs b/BurnOutSharp/PackerType/WinZipSFX.cs index aa1d7a94..1dc1ca55 100644 --- a/BurnOutSharp/PackerType/WinZipSFX.cs +++ b/BurnOutSharp/PackerType/WinZipSFX.cs @@ -18,7 +18,7 @@ namespace BurnOutSharp.PackerType public bool ShouldScan(byte[] magic) => true; /// - public string CheckNEContents(string file, byte[] fileContent, bool includeDebug, NewExecutable nex) + public string CheckNEContents(string file, bool includeDebug, NewExecutable nex) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -29,7 +29,7 @@ namespace BurnOutSharp.PackerType if (!string.IsNullOrWhiteSpace(version)) return $"WinZip SFX {version}"; - version = GetNEUnknownHeaderVersion(nex, file, fileContent, includeDebug); + version = GetNEUnknownHeaderVersion(nex, file, nex.SourceArray, includeDebug); if (!string.IsNullOrWhiteSpace(version)) return $"WinZip SFX {version}"; diff --git a/BurnOutSharp/PackerType/WiseInstaller.cs b/BurnOutSharp/PackerType/WiseInstaller.cs index 8ba6316b..df7da265 100644 --- a/BurnOutSharp/PackerType/WiseInstaller.cs +++ b/BurnOutSharp/PackerType/WiseInstaller.cs @@ -16,7 +16,7 @@ namespace BurnOutSharp.PackerType public bool ShouldScan(byte[] magic) => true; /// - public string CheckNEContents(string file, byte[] fileContent, bool includeDebug, NewExecutable nex) + public string CheckNEContents(string file, bool includeDebug, NewExecutable nex) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -31,7 +31,7 @@ namespace BurnOutSharp.PackerType new ContentMatchSet(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"), }; - return MatchUtil.GetFirstMatch(file, fileContent, neMatchSets, includeDebug); + return MatchUtil.GetFirstMatch(file, nex.SourceArray, neMatchSets, includeDebug); } /// diff --git a/BurnOutSharp/ProtectionType/CDDVDCops.cs b/BurnOutSharp/ProtectionType/CDDVDCops.cs index ac8c4ba0..67feeb06 100644 --- a/BurnOutSharp/ProtectionType/CDDVDCops.cs +++ b/BurnOutSharp/ProtectionType/CDDVDCops.cs @@ -41,7 +41,7 @@ namespace BurnOutSharp.ProtectionType } /// - public string CheckNEContents(string file, byte[] fileContent, bool includeDebug, NewExecutable nex) + public string CheckNEContents(string file, bool includeDebug, NewExecutable nex) { // Get the DOS stub from the executable, if possible var stub = nex?.DOSStubHeader; @@ -63,7 +63,7 @@ namespace BurnOutSharp.ProtectionType }, GetVersion, "CD-Cops"), }; - return MatchUtil.GetFirstMatch(file, fileContent, neMatchSets, includeDebug); + return MatchUtil.GetFirstMatch(file, nex.SourceArray, neMatchSets, includeDebug); } ///