diff --git a/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs b/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs
index 9e541e04..7f2e2e54 100644
--- a/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs
+++ b/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs
@@ -528,6 +528,7 @@ namespace BurnOutSharp.ExecutableType.Microsoft.PE
///
/// Get the raw bytes from a section, if possible
///
+ /// TODO: These can be combined and use SourceArray and SourceStream instead
public byte[] ReadRawSection(Stream stream, string sectionName, bool force = false, bool first = true, int offset = 0)
{
// Special cases for non-forced, non-offset data
@@ -569,6 +570,7 @@ namespace BurnOutSharp.ExecutableType.Microsoft.PE
///
/// Get the raw bytes from a section, if possible
///
+ /// TODO: These can be combined and use SourceArray and SourceStream instead
public byte[] ReadRawSection(byte[] content, string sectionName, bool force = false, bool first = true, int offset = 0)
{
// Special cases for non-forced, non-offset data
diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs
index 65fb3855..31b15888 100644
--- a/BurnOutSharp/FileType/Executable.cs
+++ b/BurnOutSharp/FileType/Executable.cs
@@ -173,7 +173,7 @@ namespace BurnOutSharp.FileType
bool foundProtection = false;
// Check using custom content checks first
- string protection = contentCheckClass.CheckPEContents(file, fileContent, scanner.IncludeDebug, pex);
+ string protection = contentCheckClass.CheckPEContents(file, scanner.IncludeDebug, pex);
foundProtection |= !string.IsNullOrWhiteSpace(protection);
if (ShouldAddProtection(contentCheckClass, scanner, protection))
Utilities.AppendToDictionary(protections, file, protection);
diff --git a/BurnOutSharp/IPEContentCheck.cs b/BurnOutSharp/IPEContentCheck.cs
index 812db3e0..e8680204 100644
--- a/BurnOutSharp/IPEContentCheck.cs
+++ b/BurnOutSharp/IPEContentCheck.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
/// PortableExecutable representing the read-in file
/// String containing any protections found in the file
- string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex);
+ string CheckPEContents(string file, bool includeDebug, PortableExecutable pex);
}
}
diff --git a/BurnOutSharp/PackerType/AdvancedInstaller.cs b/BurnOutSharp/PackerType/AdvancedInstaller.cs
index 98e89df1..5ac76f24 100644
--- a/BurnOutSharp/PackerType/AdvancedInstaller.cs
+++ b/BurnOutSharp/PackerType/AdvancedInstaller.cs
@@ -8,7 +8,7 @@ namespace BurnOutSharp.PackerType
public class AdvancedInstaller : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 0555c780..7f4a2b52 100644
--- a/BurnOutSharp/PackerType/Armadillo.cs
+++ b/BurnOutSharp/PackerType/Armadillo.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.PackerType
public class Armadillo : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -26,7 +26,7 @@ namespace BurnOutSharp.PackerType
foreach (var section in sections.Where(s => s != null && Encoding.ASCII.GetString(s.Name).Trim('\0').EndsWith("1")))
{
string sectionName = Encoding.ASCII.GetString(section.Name).Trim('\0');
- var sectionRaw = pex.ReadRawSection(fileContent, sectionName);
+ var sectionRaw = pex.ReadRawSection(pex.SourceArray, sectionName);
var matchers = new List
{
// ARMDEBUG
diff --git a/BurnOutSharp/PackerType/EXEStealth.cs b/BurnOutSharp/PackerType/EXEStealth.cs
index b7942697..f402c547 100644
--- a/BurnOutSharp/PackerType/EXEStealth.cs
+++ b/BurnOutSharp/PackerType/EXEStealth.cs
@@ -36,7 +36,7 @@ namespace BurnOutSharp.PackerType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 ff7ba657..9460b11e 100644
--- a/BurnOutSharp/PackerType/InnoSetup.cs
+++ b/BurnOutSharp/PackerType/InnoSetup.cs
@@ -37,7 +37,7 @@ namespace BurnOutSharp.PackerType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -71,7 +71,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, pex.SourceArray);
if (!string.IsNullOrWhiteSpace(version))
return $"Inno Setup {version}";
diff --git a/BurnOutSharp/PackerType/InstallAnywhere.cs b/BurnOutSharp/PackerType/InstallAnywhere.cs
index f6f86915..80cd10ac 100644
--- a/BurnOutSharp/PackerType/InstallAnywhere.cs
+++ b/BurnOutSharp/PackerType/InstallAnywhere.cs
@@ -12,7 +12,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 f004e354..39fde3fd 100644
--- a/BurnOutSharp/PackerType/InstallerVISE.cs
+++ b/BurnOutSharp/PackerType/InstallerVISE.cs
@@ -13,7 +13,7 @@ namespace BurnOutSharp.PackerType
//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, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 544919dc..9ad7bae0 100644
--- a/BurnOutSharp/PackerType/IntelInstallationFramework.cs
+++ b/BurnOutSharp/PackerType/IntelInstallationFramework.cs
@@ -8,7 +8,7 @@ namespace BurnOutSharp.PackerType
public class IntelInstallationFramework : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 f88b84d0..45215ba4 100644
--- a/BurnOutSharp/PackerType/MicrosoftCABSFX.cs
+++ b/BurnOutSharp/PackerType/MicrosoftCABSFX.cs
@@ -15,7 +15,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 732c732e..7b78d247 100644
--- a/BurnOutSharp/PackerType/NSIS.cs
+++ b/BurnOutSharp/PackerType/NSIS.cs
@@ -8,7 +8,7 @@ namespace BurnOutSharp.PackerType
public class NSIS : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 5a0efa67..03a5009a 100644
--- a/BurnOutSharp/PackerType/PECompact.cs
+++ b/BurnOutSharp/PackerType/PECompact.cs
@@ -6,7 +6,7 @@ namespace BurnOutSharp.PackerType
public class PECompact : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 a9b92eea..667158f7 100644
--- a/BurnOutSharp/PackerType/Petite.cs
+++ b/BurnOutSharp/PackerType/Petite.cs
@@ -5,7 +5,7 @@ namespace BurnOutSharp.PackerType
public class PEtite : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 de805404..d1c4ae63 100644
--- a/BurnOutSharp/PackerType/SetupFactory.cs
+++ b/BurnOutSharp/PackerType/SetupFactory.cs
@@ -12,7 +12,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 ec7dfa81..fddfb05a 100644
--- a/BurnOutSharp/PackerType/UPX.cs
+++ b/BurnOutSharp/PackerType/UPX.cs
@@ -8,7 +8,7 @@ namespace BurnOutSharp.PackerType
public class UPX : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -28,7 +28,7 @@ namespace BurnOutSharp.PackerType
"UPX"),
};
- return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ return MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
}
// NOS Variant
@@ -44,7 +44,7 @@ namespace BurnOutSharp.PackerType
"UPX (NOS Variant)"),
};
- return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ return MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
}
return null;
diff --git a/BurnOutSharp/PackerType/WinRARSFX.cs b/BurnOutSharp/PackerType/WinRARSFX.cs
index d41da8c4..7ac957a4 100644
--- a/BurnOutSharp/PackerType/WinRARSFX.cs
+++ b/BurnOutSharp/PackerType/WinRARSFX.cs
@@ -16,7 +16,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 1dc1ca55..800413af 100644
--- a/BurnOutSharp/PackerType/WinZipSFX.cs
+++ b/BurnOutSharp/PackerType/WinZipSFX.cs
@@ -37,7 +37,7 @@ namespace BurnOutSharp.PackerType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 df7da265..4ce6b61f 100644
--- a/BurnOutSharp/PackerType/WiseInstaller.cs
+++ b/BurnOutSharp/PackerType/WiseInstaller.cs
@@ -35,7 +35,7 @@ namespace BurnOutSharp.PackerType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 a27f2ecc..3bcc0d41 100644
--- a/BurnOutSharp/PackerType/dotFuscator.cs
+++ b/BurnOutSharp/PackerType/dotFuscator.cs
@@ -7,7 +7,7 @@ namespace BurnOutSharp.PackerType
public class dotFuscator : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 761cb6c6..0fe90585 100644
--- a/BurnOutSharp/ProtectionType/ActiveMARK.cs
+++ b/BurnOutSharp/ProtectionType/ActiveMARK.cs
@@ -32,7 +32,7 @@ namespace BurnOutSharp.ProtectionType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -40,7 +40,7 @@ namespace BurnOutSharp.ProtectionType
return null;
// Get the last .bss section, if it exists
- var bssSectionRaw = pex.ReadRawSection(fileContent, ".bss", first: false);
+ var bssSectionRaw = pex.ReadRawSection(pex.SourceArray, ".bss", first: false);
if (bssSectionRaw != null)
{
var matchers = new List
diff --git a/BurnOutSharp/ProtectionType/AlphaROM.cs b/BurnOutSharp/ProtectionType/AlphaROM.cs
index 83c2f57f..c585675f 100644
--- a/BurnOutSharp/ProtectionType/AlphaROM.cs
+++ b/BurnOutSharp/ProtectionType/AlphaROM.cs
@@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType
public class AlphaROM : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 9ea3eb52..6a256753 100644
--- a/BurnOutSharp/ProtectionType/CDCheck.cs
+++ b/BurnOutSharp/ProtectionType/CDCheck.cs
@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class CDCheck : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 67feeb06..fd0742b8 100644
--- a/BurnOutSharp/ProtectionType/CDDVDCops.cs
+++ b/BurnOutSharp/ProtectionType/CDDVDCops.cs
@@ -67,7 +67,7 @@ namespace BurnOutSharp.ProtectionType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 c8a6b9df..176e5a2f 100644
--- a/BurnOutSharp/ProtectionType/CDKey.cs
+++ b/BurnOutSharp/ProtectionType/CDKey.cs
@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class CDKey : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 9bc0e0f4..f60ffe32 100644
--- a/BurnOutSharp/ProtectionType/CDLock.cs
+++ b/BurnOutSharp/ProtectionType/CDLock.cs
@@ -8,7 +8,7 @@ namespace BurnOutSharp.ProtectionType
public class CDLock : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 b70241a4..1daabd4f 100644
--- a/BurnOutSharp/ProtectionType/CDSHiELDSE.cs
+++ b/BurnOutSharp/ProtectionType/CDSHiELDSE.cs
@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class CDSHiELDSE : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
return null;
// Get the code/CODE section, if it exists
- var codeSectionRaw = pex.ReadRawSection(fileContent, "code", first: true) ?? pex.ReadRawSection(fileContent, "CODE", first: true);
+ var codeSectionRaw = pex.ReadRawSection(pex.SourceArray, "code", first: true) ?? pex.ReadRawSection(pex.SourceArray, "CODE", first: true);
if (codeSectionRaw != null)
{
var matchers = new List
diff --git a/BurnOutSharp/ProtectionType/CactusDataShield.cs b/BurnOutSharp/ProtectionType/CactusDataShield.cs
index 8af6f1ce..8452da6c 100644
--- a/BurnOutSharp/ProtectionType/CactusDataShield.cs
+++ b/BurnOutSharp/ProtectionType/CactusDataShield.cs
@@ -36,7 +36,7 @@ namespace BurnOutSharp.ProtectionType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 9717fa2d..be6a59b9 100644
--- a/BurnOutSharp/ProtectionType/CenegaProtectDVD.cs
+++ b/BurnOutSharp/ProtectionType/CenegaProtectDVD.cs
@@ -5,7 +5,7 @@ namespace BurnOutSharp.ProtectionType
public class CengaProtectDVD : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 294937f7..d680c92b 100644
--- a/BurnOutSharp/ProtectionType/CodeLock.cs
+++ b/BurnOutSharp/ProtectionType/CodeLock.cs
@@ -32,7 +32,7 @@ namespace BurnOutSharp.ProtectionType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
diff --git a/BurnOutSharp/ProtectionType/ElectronicArts.cs b/BurnOutSharp/ProtectionType/ElectronicArts.cs
index 6d259bab..f53d4684 100644
--- a/BurnOutSharp/ProtectionType/ElectronicArts.cs
+++ b/BurnOutSharp/ProtectionType/ElectronicArts.cs
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
public class ElectronicArts : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 4737aecf..7cf87623 100644
--- a/BurnOutSharp/ProtectionType/GFWL.cs
+++ b/BurnOutSharp/ProtectionType/GFWL.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
public class GFWL : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 ea1ce830..f6989195 100644
--- a/BurnOutSharp/ProtectionType/ImpulseReactor.cs
+++ b/BurnOutSharp/ProtectionType/ImpulseReactor.cs
@@ -11,7 +11,7 @@ namespace BurnOutSharp.ProtectionType
public class ImpulseReactor : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 40864bd6..8702e463 100644
--- a/BurnOutSharp/ProtectionType/Intenium.cs
+++ b/BurnOutSharp/ProtectionType/Intenium.cs
@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
*/
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 b359c720..82d3188a 100644
--- a/BurnOutSharp/ProtectionType/JoWood.cs
+++ b/BurnOutSharp/ProtectionType/JoWood.cs
@@ -12,7 +12,7 @@ namespace BurnOutSharp.ProtectionType
public class JoWood : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -24,7 +24,7 @@ namespace BurnOutSharp.ProtectionType
if (extSection)
{
// Get the .dcrtext section, if it exists
- var dcrtextSectionRaw = pex.ReadRawSection(fileContent, ".dcrtext");
+ var dcrtextSectionRaw = pex.ReadRawSection(pex.SourceArray, ".dcrtext");
if (dcrtextSectionRaw != null)
{
var matchers = new List
diff --git a/BurnOutSharp/ProtectionType/Key2AudioXS.cs b/BurnOutSharp/ProtectionType/Key2AudioXS.cs
index 3f404f0c..b1d9aa98 100644
--- a/BurnOutSharp/ProtectionType/Key2AudioXS.cs
+++ b/BurnOutSharp/ProtectionType/Key2AudioXS.cs
@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class Key2AudioXS : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
diff --git a/BurnOutSharp/ProtectionType/LaserLok.cs b/BurnOutSharp/ProtectionType/LaserLok.cs
index e41d878f..fbaddc6e 100644
--- a/BurnOutSharp/ProtectionType/LaserLok.cs
+++ b/BurnOutSharp/ProtectionType/LaserLok.cs
@@ -12,7 +12,7 @@ namespace BurnOutSharp.ProtectionType
public class LaserLok : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 78558047..1912a54d 100644
--- a/BurnOutSharp/ProtectionType/MediaMaxCD3.cs
+++ b/BurnOutSharp/ProtectionType/MediaMaxCD3.cs
@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class MediaMaxCD3 : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 cd550c23..9d5b7ca5 100644
--- a/BurnOutSharp/ProtectionType/OnlineRegistration.cs
+++ b/BurnOutSharp/ProtectionType/OnlineRegistration.cs
@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class OnlineRegistration : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 47f7c49d..c4064e26 100644
--- a/BurnOutSharp/ProtectionType/Origin.cs
+++ b/BurnOutSharp/ProtectionType/Origin.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
public class Origin : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
diff --git a/BurnOutSharp/ProtectionType/ProtectDisc.cs b/BurnOutSharp/ProtectionType/ProtectDisc.cs
index e8e9759d..8d64c2d9 100644
--- a/BurnOutSharp/ProtectionType/ProtectDisc.cs
+++ b/BurnOutSharp/ProtectionType/ProtectDisc.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
public class ProtectDISC : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -31,7 +31,7 @@ namespace BurnOutSharp.ProtectionType
GetVersion6till8, "ProtectDISC"),
};
- string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ string match = MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
@@ -68,7 +68,7 @@ namespace BurnOutSharp.ProtectionType
GetOldVersion, "VOB ProtectCD/DVD"),
};
- string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ string match = MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
@@ -92,7 +92,7 @@ namespace BurnOutSharp.ProtectionType
GetVersion3till6, "VOB ProtectCD/DVD"),
};
- string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ string match = MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
diff --git a/BurnOutSharp/ProtectionType/SafeDisc.cs b/BurnOutSharp/ProtectionType/SafeDisc.cs
index a6a2dc92..66ba0485 100644
--- a/BurnOutSharp/ProtectionType/SafeDisc.cs
+++ b/BurnOutSharp/ProtectionType/SafeDisc.cs
@@ -47,7 +47,7 @@ namespace BurnOutSharp.ProtectionType
};
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -59,22 +59,22 @@ namespace BurnOutSharp.ProtectionType
return $"SafeCast";
// Get the .text section, if it exists
- string match = CheckSectionForProtection(file, fileContent, includeDebug, pex, ".text");
+ string match = CheckSectionForProtection(file, pex.SourceArray, includeDebug, pex, ".text");
if (!string.IsNullOrWhiteSpace(match))
return match;
// Get the .txt2 section, if it exists
- match = CheckSectionForProtection(file, fileContent, includeDebug, pex, ".txt2");
+ match = CheckSectionForProtection(file, pex.SourceArray, includeDebug, pex, ".txt2");
if (!string.IsNullOrWhiteSpace(match))
return match;
// Get the CODE section, if it exists
- match = CheckSectionForProtection(file, fileContent, includeDebug, pex, "CODE");
+ match = CheckSectionForProtection(file, pex.SourceArray, includeDebug, pex, "CODE");
if (!string.IsNullOrWhiteSpace(match))
return match;
// Get the .data section, if it exists
- match = CheckSectionForProtection(file, fileContent, includeDebug, pex, ".data");
+ match = CheckSectionForProtection(file, pex.SourceArray, includeDebug, pex, ".data");
if (!string.IsNullOrWhiteSpace(match))
return match;
@@ -82,7 +82,7 @@ namespace BurnOutSharp.ProtectionType
bool stxt371Section = pex.ContainsSection("stxt371", exact: true);
bool stxt774Section = pex.ContainsSection("stxt774", exact: true);
if (stxt371Section || stxt774Section)
- return $"SafeDisc {Get320to4xVersion(file, fileContent, null)}";
+ return $"SafeDisc {Get320to4xVersion(file, pex.SourceArray, null)}";
return null;
}
diff --git a/BurnOutSharp/ProtectionType/SecuROM.cs b/BurnOutSharp/ProtectionType/SecuROM.cs
index f62dc09b..54052cdf 100644
--- a/BurnOutSharp/ProtectionType/SecuROM.cs
+++ b/BurnOutSharp/ProtectionType/SecuROM.cs
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
public class SecuROM : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType
// Get the .securom section, if it exists
bool securomSection = pex.ContainsSection(".securom", exact: true);
if (securomSection)
- return $"SecuROM {GetV7Version(fileContent)}";
+ return $"SecuROM {GetV7Version(pex.SourceArray)}";
// Search after the last section
var lastSection = sections.LastOrDefault();
@@ -41,7 +41,7 @@ namespace BurnOutSharp.ProtectionType
GetV4Version, "SecuROM"),
};
- string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ string match = MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
@@ -63,7 +63,7 @@ namespace BurnOutSharp.ProtectionType
GetV5Version, "SecuROM"),
};
- string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ string match = MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
diff --git a/BurnOutSharp/ProtectionType/SmartE.cs b/BurnOutSharp/ProtectionType/SmartE.cs
index f265d4d4..5146d092 100644
--- a/BurnOutSharp/ProtectionType/SmartE.cs
+++ b/BurnOutSharp/ProtectionType/SmartE.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
public class SmartE : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -33,7 +33,7 @@ namespace BurnOutSharp.ProtectionType
return match;
// Get the .tls section, if it exists
- var tlsSectionRaw = pex.ReadRawSection(fileContent, ".tls", first: false);
+ var tlsSectionRaw = pex.ReadRawSection(pex.SourceArray, ".tls", first: false);
match = GetMatchForSection(file, tlsSectionRaw, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
diff --git a/BurnOutSharp/ProtectionType/SolidShield.cs b/BurnOutSharp/ProtectionType/SolidShield.cs
index 6e179e80..a5cfd469 100644
--- a/BurnOutSharp/ProtectionType/SolidShield.cs
+++ b/BurnOutSharp/ProtectionType/SolidShield.cs
@@ -13,7 +13,7 @@ namespace BurnOutSharp.ProtectionType
public class SolidShield : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -37,7 +37,7 @@ namespace BurnOutSharp.ProtectionType
return $"SolidShield Activation Manager Module {GetFileVersion(pex)}";
// Get the .init section, if it exists
- var initSectionRaw = pex.ReadRawSection(fileContent, ".init", first: true);
+ var initSectionRaw = pex.ReadRawSection(pex.SourceArray, ".init", first: true);
if (initSectionRaw != null)
{
var matchers = new List
@@ -66,7 +66,7 @@ namespace BurnOutSharp.ProtectionType
var sectionNames = pex.GetSectionNames();
for (int i = (sectionNames.Length >= 2 ? sectionNames.Length - 2 : 0); i < sectionNames.Length; i++)
{
- var nthSectionRaw = pex.ReadRawSection(fileContent, sectionNames[i], first: false);
+ var nthSectionRaw = pex.ReadRawSection(pex.SourceArray, sectionNames[i], first: false);
if (nthSectionRaw != null)
{
var matchers = new List
diff --git a/BurnOutSharp/ProtectionType/StarForce.cs b/BurnOutSharp/ProtectionType/StarForce.cs
index dcdea386..39a21b71 100644
--- a/BurnOutSharp/ProtectionType/StarForce.cs
+++ b/BurnOutSharp/ProtectionType/StarForce.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
public class StarForce : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -53,7 +53,7 @@ namespace BurnOutSharp.ProtectionType
"StarForce 5 [Protected Module]"),
};
- string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
+ string match = MatchUtil.GetFirstMatch(file, pex.SourceArray, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
}
diff --git a/BurnOutSharp/ProtectionType/Steam.cs b/BurnOutSharp/ProtectionType/Steam.cs
index 36739770..c713f7f6 100644
--- a/BurnOutSharp/ProtectionType/Steam.cs
+++ b/BurnOutSharp/ProtectionType/Steam.cs
@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class Steam : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 fbb369ad..08a49668 100644
--- a/BurnOutSharp/ProtectionType/Sysiphus.cs
+++ b/BurnOutSharp/ProtectionType/Sysiphus.cs
@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class Sysiphus : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 2e407590..71de3db5 100644
--- a/BurnOutSharp/ProtectionType/Tages.cs
+++ b/BurnOutSharp/ProtectionType/Tages.cs
@@ -40,7 +40,7 @@ namespace BurnOutSharp.ProtectionType
}
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 e6b20609..d4add68b 100644
--- a/BurnOutSharp/ProtectionType/ThreePLock.cs
+++ b/BurnOutSharp/ProtectionType/ThreePLock.cs
@@ -5,7 +5,7 @@ namespace BurnOutSharp.ProtectionType
public class ThreePLock : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 3b05324a..c61c22ab 100644
--- a/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs
+++ b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs
@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class ThreeTwoOneStudios : IPEContentCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 7b66375c..f43317e7 100644
--- a/BurnOutSharp/ProtectionType/Uplay.cs
+++ b/BurnOutSharp/ProtectionType/Uplay.cs
@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
public class Uplay : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// 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 dc85f108..c84e6e54 100644
--- a/BurnOutSharp/ProtectionType/WTMCDProtect.cs
+++ b/BurnOutSharp/ProtectionType/WTMCDProtect.cs
@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class WTMCDProtect : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
@@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType
return "WTM Protection Viewer";
// Get the CODE section, if it exists
- var codeSectionRaw = pex.ReadRawSection(fileContent, "CODE", first: true);
+ var codeSectionRaw = pex.ReadRawSection(pex.SourceArray, "CODE", first: true);
if (codeSectionRaw != null)
{
var matchers = new List
diff --git a/BurnOutSharp/ProtectionType/XCP.cs b/BurnOutSharp/ProtectionType/XCP.cs
index c4feea03..820e5ad1 100644
--- a/BurnOutSharp/ProtectionType/XCP.cs
+++ b/BurnOutSharp/ProtectionType/XCP.cs
@@ -13,7 +13,7 @@ namespace BurnOutSharp.ProtectionType
public class XCP : IPEContentCheck, IPathCheck
{
///
- public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
+ public string CheckPEContents(string file, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;