From 466689dcbc62ad633a3de16b73bd07a77a6140a6 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 6 Nov 2025 13:43:49 -0500 Subject: [PATCH] Clean up holdover logic --- BinaryObjectScanner/FileType/Executable.cs | 6 ++---- BinaryObjectScanner/FileType/LinearExecutable.cs | 2 +- BinaryObjectScanner/FileType/MSDOS.cs | 2 +- BinaryObjectScanner/FileType/NewExecutable.cs | 2 +- BinaryObjectScanner/FileType/PortableExecutable.cs | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/BinaryObjectScanner/FileType/Executable.cs b/BinaryObjectScanner/FileType/Executable.cs index f549c75a..f56bc064 100644 --- a/BinaryObjectScanner/FileType/Executable.cs +++ b/BinaryObjectScanner/FileType/Executable.cs @@ -74,12 +74,10 @@ namespace BinaryObjectScanner.FileType /// Handle a single file based on all executable check implementations /// /// Name of the source file of the executable, for tracking - /// Executable to scan /// Set of checks to use - /// Scanner for handling recursive protections /// True to include debug data, false otherwise /// Set of protections in file, empty on error - protected IDictionary RunExecutableChecks(string file, T exe, U[] checks, bool includeDebug) + protected IDictionary RunExecutableChecks(string file, U[] checks, bool includeDebug) where U : IExecutableCheck { // Create the output dictionary @@ -89,7 +87,7 @@ namespace BinaryObjectScanner.FileType checks.IterateWithAction(checkClass => { // Get the protection for the class, if possible - var protection = checkClass.CheckExecutable(file, exe, includeDebug); + var protection = checkClass.CheckExecutable(file, _wrapper, includeDebug); if (string.IsNullOrEmpty(protection)) return; diff --git a/BinaryObjectScanner/FileType/LinearExecutable.cs b/BinaryObjectScanner/FileType/LinearExecutable.cs index 3e22d086..d3a3e34c 100644 --- a/BinaryObjectScanner/FileType/LinearExecutable.cs +++ b/BinaryObjectScanner/FileType/LinearExecutable.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.FileType // Standard checks var subProtections - = RunExecutableChecks(file, _wrapper, StaticChecks.LinearExecutableCheckClasses, includeDebug); + = RunExecutableChecks(file, StaticChecks.LinearExecutableCheckClasses, includeDebug); protections.Append(file, subProtections.Values); // If there are no protections diff --git a/BinaryObjectScanner/FileType/MSDOS.cs b/BinaryObjectScanner/FileType/MSDOS.cs index a686dbed..6c2bc314 100644 --- a/BinaryObjectScanner/FileType/MSDOS.cs +++ b/BinaryObjectScanner/FileType/MSDOS.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.FileType // Standard checks var subProtections - = RunExecutableChecks(file, _wrapper, StaticChecks.MSDOSExecutableCheckClasses, includeDebug); + = RunExecutableChecks(file, StaticChecks.MSDOSExecutableCheckClasses, includeDebug); protections.Append(file, subProtections.Values); // If there are no protections diff --git a/BinaryObjectScanner/FileType/NewExecutable.cs b/BinaryObjectScanner/FileType/NewExecutable.cs index 96a38c58..d5f10940 100644 --- a/BinaryObjectScanner/FileType/NewExecutable.cs +++ b/BinaryObjectScanner/FileType/NewExecutable.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.FileType // Standard checks var subProtections - = RunExecutableChecks(file, _wrapper, StaticChecks.NewExecutableCheckClasses, includeDebug); + = RunExecutableChecks(file, StaticChecks.NewExecutableCheckClasses, includeDebug); protections.Append(file, subProtections.Values); // If there are no protections diff --git a/BinaryObjectScanner/FileType/PortableExecutable.cs b/BinaryObjectScanner/FileType/PortableExecutable.cs index bc1d1c80..a2aa3ded 100644 --- a/BinaryObjectScanner/FileType/PortableExecutable.cs +++ b/BinaryObjectScanner/FileType/PortableExecutable.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.FileType // Standard checks var subProtections - = RunExecutableChecks(file, _wrapper, StaticChecks.PortableExecutableCheckClasses, includeDebug); + = RunExecutableChecks(file, StaticChecks.PortableExecutableCheckClasses, includeDebug); protections.Append(file, subProtections.Values); // If there are no protections