mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-31 13:12:59 +00:00
Hide section complexity from content checks
This commit is contained in:
@@ -40,7 +40,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
return null;
|
||||
|
||||
// Get the last .bss section, if it exists
|
||||
var bssSectionRaw = pex.ReadRawSection(pex.SourceArray, ".bss", first: false);
|
||||
var bssSectionRaw = pex.ReadRawSection(".bss", first: false);
|
||||
if (bssSectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
return null;
|
||||
|
||||
// Get the code/CODE section, if it exists
|
||||
var codeSectionRaw = pex.ReadRawSection(pex.SourceArray, "code", first: true) ?? pex.ReadRawSection(pex.SourceArray, "CODE", first: true);
|
||||
var codeSectionRaw = pex.ReadRawSection("code", first: true) ?? pex.ReadRawSection("CODE", first: true);
|
||||
if (codeSectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (extSection)
|
||||
{
|
||||
// Get the .dcrtext section, if it exists
|
||||
var dcrtextSectionRaw = pex.ReadRawSection(pex.SourceArray, ".dcrtext");
|
||||
var dcrtextSectionRaw = pex.ReadRawSection(".dcrtext");
|
||||
if (dcrtextSectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
private string CheckSectionForProtection(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex, string sectionName)
|
||||
{
|
||||
// This subtract is needed because BoG_ starts before the section
|
||||
var sectionRaw = pex.ReadRawSection(fileContent, sectionName, first: true, offset: -64);
|
||||
var sectionRaw = pex.ReadRawSection(sectionName, first: true, offset: -64);
|
||||
if (sectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
return match;
|
||||
|
||||
// Get the .tls section, if it exists
|
||||
var tlsSectionRaw = pex.ReadRawSection(pex.SourceArray, ".tls", first: false);
|
||||
var tlsSectionRaw = pex.ReadRawSection(".tls", first: false);
|
||||
match = GetMatchForSection(file, tlsSectionRaw, includeDebug);
|
||||
if (!string.IsNullOrWhiteSpace(match))
|
||||
return match;
|
||||
|
||||
@@ -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(pex.SourceArray, ".init", first: true);
|
||||
var initSectionRaw = pex.ReadRawSection(".init", first: true);
|
||||
if (initSectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
@@ -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(pex.SourceArray, sectionNames[i], first: false);
|
||||
var nthSectionRaw = pex.ReadRawSection(sectionNames[i], first: false);
|
||||
if (nthSectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
return "WTM Protection Viewer";
|
||||
|
||||
// Get the CODE section, if it exists
|
||||
var codeSectionRaw = pex.ReadRawSection(pex.SourceArray, "CODE", first: true);
|
||||
var codeSectionRaw = pex.ReadRawSection("CODE", first: true);
|
||||
if (codeSectionRaw != null)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
|
||||
Reference in New Issue
Block a user