From bf5899d9fde9154dd22220f1f395f649edffe4ef Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 2 Dec 2024 01:50:40 -0500 Subject: [PATCH] Add packer tests --- .../Packer/ASPackTests.cs | 36 +++++++++++++++++++ .../Packer/AdvancedInstallerTests.cs | 36 +++++++++++++++++++ .../Packer/AutoPlayMediaStudioTests.cs | 36 +++++++++++++++++++ BinaryObjectScanner.Test/Packer/CExeTests.cs | 36 +++++++++++++++++++ .../Packer/DotFuscatorTests.cs | 36 +++++++++++++++++++ .../Packer/DotNetReactorTests.cs | 36 +++++++++++++++++++ .../Packer/EXEStealthTests.cs | 36 +++++++++++++++++++ .../Packer/EmbeddedArchiveTests.cs | 36 +++++++++++++++++++ .../Packer/EmbeddedExecutableTests.cs | 36 +++++++++++++++++++ .../Packer/GenteeInstallerTests.cs | 36 +++++++++++++++++++ .../Packer/HyperTechCrackProofTests.cs | 36 +++++++++++++++++++ .../Packer/InnoSetupTests.cs | 36 +++++++++++++++++++ .../Packer/InstallAnywhereTests.cs | 36 +++++++++++++++++++ .../Packer/InstallerVISETests.cs | 36 +++++++++++++++++++ .../Packer/IntelInstallationFrameworkTests.cs | 36 +++++++++++++++++++ .../Packer/MicrosoftCABSFXTests.cs | 36 +++++++++++++++++++ BinaryObjectScanner.Test/Packer/NSISTests.cs | 36 +++++++++++++++++++ .../Packer/NeoLiteTests.cs | 36 +++++++++++++++++++ .../Packer/PECompactTests.cs | 36 +++++++++++++++++++ .../Packer/PetiteTests.cs | 36 +++++++++++++++++++ .../Packer/SetupFactoryTests.cs | 36 +++++++++++++++++++ .../Packer/SevenZipSFXTests.cs | 36 +++++++++++++++++++ .../Packer/ShrinkerTests.cs | 36 +++++++++++++++++++ BinaryObjectScanner.Test/Packer/UPXTests.cs | 36 +++++++++++++++++++ .../Packer/WinRARSFXTests.cs | 36 +++++++++++++++++++ .../Packer/WinZipSFXTests.cs | 36 +++++++++++++++++++ .../Packer/WiseInstallerTests.cs | 36 +++++++++++++++++++ 27 files changed, 972 insertions(+) create mode 100644 BinaryObjectScanner.Test/Packer/ASPackTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/AdvancedInstallerTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/AutoPlayMediaStudioTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/CExeTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/DotFuscatorTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/DotNetReactorTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/EXEStealthTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/EmbeddedArchiveTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/EmbeddedExecutableTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/GenteeInstallerTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/HyperTechCrackProofTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/InnoSetupTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/InstallAnywhereTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/InstallerVISETests.cs create mode 100644 BinaryObjectScanner.Test/Packer/IntelInstallationFrameworkTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/MicrosoftCABSFXTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/NSISTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/NeoLiteTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/PECompactTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/PetiteTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/SetupFactoryTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/SevenZipSFXTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/ShrinkerTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/UPXTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/WinRARSFXTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/WinZipSFXTests.cs create mode 100644 BinaryObjectScanner.Test/Packer/WiseInstallerTests.cs diff --git a/BinaryObjectScanner.Test/Packer/ASPackTests.cs b/BinaryObjectScanner.Test/Packer/ASPackTests.cs new file mode 100644 index 00000000..530569eb --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/ASPackTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class ASPackTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new ASPack(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new ASPack(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/AdvancedInstallerTests.cs b/BinaryObjectScanner.Test/Packer/AdvancedInstallerTests.cs new file mode 100644 index 00000000..f3e496b9 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/AdvancedInstallerTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class AdvancedInstallerTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new AdvancedInstaller(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new AdvancedInstaller(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/AutoPlayMediaStudioTests.cs b/BinaryObjectScanner.Test/Packer/AutoPlayMediaStudioTests.cs new file mode 100644 index 00000000..54ae6b53 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/AutoPlayMediaStudioTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class AutoPlayMediaStudioTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new AutoPlayMediaStudio(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new AutoPlayMediaStudio(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/CExeTests.cs b/BinaryObjectScanner.Test/Packer/CExeTests.cs new file mode 100644 index 00000000..978fcc77 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/CExeTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class CExeTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new CExe(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new CExe(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/DotFuscatorTests.cs b/BinaryObjectScanner.Test/Packer/DotFuscatorTests.cs new file mode 100644 index 00000000..fbd3f21d --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/DotFuscatorTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class DotFuscatorTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new DotFuscator(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new DotFuscator(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/DotNetReactorTests.cs b/BinaryObjectScanner.Test/Packer/DotNetReactorTests.cs new file mode 100644 index 00000000..d6331ba7 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/DotNetReactorTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class DotNetReactorTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new DotNetReactor(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new DotNetReactor(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/EXEStealthTests.cs b/BinaryObjectScanner.Test/Packer/EXEStealthTests.cs new file mode 100644 index 00000000..6834c570 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/EXEStealthTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class EXEStealthTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new EXEStealth(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new EXEStealth(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/EmbeddedArchiveTests.cs b/BinaryObjectScanner.Test/Packer/EmbeddedArchiveTests.cs new file mode 100644 index 00000000..9cc6c441 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/EmbeddedArchiveTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class EmbeddedArchiveTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new EmbeddedArchive(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new EmbeddedArchive(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/EmbeddedExecutableTests.cs b/BinaryObjectScanner.Test/Packer/EmbeddedExecutableTests.cs new file mode 100644 index 00000000..30ed4701 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/EmbeddedExecutableTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class EmbeddedExecutableTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new EmbeddedExecutable(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new EmbeddedExecutable(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/GenteeInstallerTests.cs b/BinaryObjectScanner.Test/Packer/GenteeInstallerTests.cs new file mode 100644 index 00000000..c43d3859 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/GenteeInstallerTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class GenteeInstallerTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new GenteeInstaller(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new GenteeInstaller(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/HyperTechCrackProofTests.cs b/BinaryObjectScanner.Test/Packer/HyperTechCrackProofTests.cs new file mode 100644 index 00000000..d3ccea37 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/HyperTechCrackProofTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class HyperTechCrackProofTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new HyperTechCrackProof(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new HyperTechCrackProof(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/InnoSetupTests.cs b/BinaryObjectScanner.Test/Packer/InnoSetupTests.cs new file mode 100644 index 00000000..5842e3fe --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/InnoSetupTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class InnoSetupTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new InnoSetup(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new InnoSetup(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/InstallAnywhereTests.cs b/BinaryObjectScanner.Test/Packer/InstallAnywhereTests.cs new file mode 100644 index 00000000..11b50e7c --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/InstallAnywhereTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class InstallAnywhereTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new InstallAnywhere(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new InstallAnywhere(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/InstallerVISETests.cs b/BinaryObjectScanner.Test/Packer/InstallerVISETests.cs new file mode 100644 index 00000000..e1a1d579 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/InstallerVISETests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class InstallerVISETests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new InstallerVISE(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new InstallerVISE(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/IntelInstallationFrameworkTests.cs b/BinaryObjectScanner.Test/Packer/IntelInstallationFrameworkTests.cs new file mode 100644 index 00000000..7d5c3822 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/IntelInstallationFrameworkTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class IntelInstallationFrameworkTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new IntelInstallationFramework(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new IntelInstallationFramework(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/MicrosoftCABSFXTests.cs b/BinaryObjectScanner.Test/Packer/MicrosoftCABSFXTests.cs new file mode 100644 index 00000000..98548316 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/MicrosoftCABSFXTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class MicrosoftCABSFXTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new MicrosoftCABSFX(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new MicrosoftCABSFX(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/NSISTests.cs b/BinaryObjectScanner.Test/Packer/NSISTests.cs new file mode 100644 index 00000000..1675967b --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/NSISTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class NSISTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new NSIS(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new NSIS(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/NeoLiteTests.cs b/BinaryObjectScanner.Test/Packer/NeoLiteTests.cs new file mode 100644 index 00000000..ea524ba6 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/NeoLiteTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class NeoLiteTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new NeoLite(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new NeoLite(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/PECompactTests.cs b/BinaryObjectScanner.Test/Packer/PECompactTests.cs new file mode 100644 index 00000000..4ccdb38a --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/PECompactTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class PECompactTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new PECompact(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new PECompact(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/PetiteTests.cs b/BinaryObjectScanner.Test/Packer/PetiteTests.cs new file mode 100644 index 00000000..6acf7dc0 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/PetiteTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class PetiteTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new PEtite(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new PEtite(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/SetupFactoryTests.cs b/BinaryObjectScanner.Test/Packer/SetupFactoryTests.cs new file mode 100644 index 00000000..f413163d --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/SetupFactoryTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class SetupFactoryTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new SetupFactory(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new SetupFactory(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/SevenZipSFXTests.cs b/BinaryObjectScanner.Test/Packer/SevenZipSFXTests.cs new file mode 100644 index 00000000..81298db9 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/SevenZipSFXTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class SevenZipSFXTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new SevenZipSFX(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new SevenZipSFX(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/ShrinkerTests.cs b/BinaryObjectScanner.Test/Packer/ShrinkerTests.cs new file mode 100644 index 00000000..98ecc9dd --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/ShrinkerTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class ShrinkerTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new Shrinker(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new Shrinker(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/UPXTests.cs b/BinaryObjectScanner.Test/Packer/UPXTests.cs new file mode 100644 index 00000000..ed654638 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/UPXTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class UPXTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new UPX(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new UPX(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/WinRARSFXTests.cs b/BinaryObjectScanner.Test/Packer/WinRARSFXTests.cs new file mode 100644 index 00000000..2987a9c0 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/WinRARSFXTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class WinRARSFXTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new WinRARSFX(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new WinRARSFX(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/WinZipSFXTests.cs b/BinaryObjectScanner.Test/Packer/WinZipSFXTests.cs new file mode 100644 index 00000000..c33f10c0 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/WinZipSFXTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class WinZipSFXTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new WinZipSFX(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new WinZipSFX(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file diff --git a/BinaryObjectScanner.Test/Packer/WiseInstallerTests.cs b/BinaryObjectScanner.Test/Packer/WiseInstallerTests.cs new file mode 100644 index 00000000..8c5a7666 --- /dev/null +++ b/BinaryObjectScanner.Test/Packer/WiseInstallerTests.cs @@ -0,0 +1,36 @@ +using System.IO; +using BinaryObjectScanner.Packer; +using Xunit; + +namespace BinaryObjectScanner.Test.Packer +{ + public class WiseInstallerTests + { + [Fact] + public void CheckPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + + var checker = new WiseInstaller(); + string? actual = checker.CheckExecutable(file, pex, includeDebug: false); + Assert.Null(actual); + } + + [Fact] + public void ExtractPortableExecutableTest() + { + string file = "filename"; + SabreTools.Models.PortableExecutable.Executable model = new(); + Stream source = new MemoryStream(); + SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source); + string outputDir = string.Empty; + + var checker = new WiseInstaller(); + bool actual = checker.Extract(file, pex, outputDir, includeDebug: false); + Assert.False(actual); + } + } +} \ No newline at end of file