diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index 150a96ea..9de41efb 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -248,38 +248,42 @@ namespace BurnOutSharp.FileType #endregion - // These are detected as protections until we can unpack them #region Packers - // Armadillo - protection = Armadillo.CheckContents(fileContent, scanner.IncludePosition); - if (!string.IsNullOrWhiteSpace(protection)) - Utilities.AppendToDictionary(protections, file, protection); + // If we're looking for packers too, run scans + if (scanner.IncludePackers) + { - // dotFuscator - protection = dotFuscator.CheckContents(fileContent, scanner.IncludePosition); - if (!string.IsNullOrWhiteSpace(protection)) - Utilities.AppendToDictionary(protections, file, protection); + // Armadillo + protection = Armadillo.CheckContents(fileContent, scanner.IncludePosition); + if (!string.IsNullOrWhiteSpace(protection)) + Utilities.AppendToDictionary(protections, file, protection); - // EXE Stealth - protection = EXEStealth.CheckContents(fileContent, scanner.IncludePosition); - if (!string.IsNullOrWhiteSpace(protection)) - Utilities.AppendToDictionary(protections, file, protection); + // dotFuscator + protection = dotFuscator.CheckContents(fileContent, scanner.IncludePosition); + if (!string.IsNullOrWhiteSpace(protection)) + Utilities.AppendToDictionary(protections, file, protection); - // NSIS - protection = NSIS.CheckContents(fileContent, scanner.IncludePosition); - if (!string.IsNullOrWhiteSpace(protection)) - Utilities.AppendToDictionary(protections, file, protection); + // EXE Stealth + protection = EXEStealth.CheckContents(fileContent, scanner.IncludePosition); + if (!string.IsNullOrWhiteSpace(protection)) + Utilities.AppendToDictionary(protections, file, protection); - // PE Compact - protection = PECompact.CheckContents(fileContent, scanner.IncludePosition); - if (!string.IsNullOrWhiteSpace(protection)) - Utilities.AppendToDictionary(protections, file, protection); + // NSIS + protection = NSIS.CheckContents(fileContent, scanner.IncludePosition); + if (!string.IsNullOrWhiteSpace(protection)) + Utilities.AppendToDictionary(protections, file, protection); - // UPX - protection = UPX.CheckContents(fileContent, scanner.IncludePosition); - if (!string.IsNullOrWhiteSpace(protection)) - Utilities.AppendToDictionary(protections, file, protection); + // PE Compact + protection = PECompact.CheckContents(fileContent, scanner.IncludePosition); + if (!string.IsNullOrWhiteSpace(protection)) + Utilities.AppendToDictionary(protections, file, protection); + + // UPX + protection = UPX.CheckContents(fileContent, scanner.IncludePosition); + if (!string.IsNullOrWhiteSpace(protection)) + Utilities.AppendToDictionary(protections, file, protection); + } #endregion diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index fb8060f1..f466c09e 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -31,6 +31,11 @@ namespace BurnOutSharp /// public bool ScanArchives { get; set; } = true; + /// + /// Determines if packers are counted as detected protections or not + /// + public bool IncludePackers { get; set; } = false; + /// /// Constructor /// diff --git a/Test/Program.cs b/Test/Program.cs index 57f99fd8..f718eb50 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -19,6 +19,7 @@ namespace Test IncludePosition = true, ScanAllFiles = false, ScanArchives = true, + IncludePackers = true, }; foreach (string arg in args)