mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-04 13:45:28 +00:00
Compare commits
111 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
610078b47c | ||
|
|
ff450a9bcf | ||
|
|
6661c48428 | ||
|
|
f2a07fc088 | ||
|
|
e34ea5faca | ||
|
|
11ed09caf2 | ||
|
|
f5615d7713 | ||
|
|
2df4144f23 | ||
|
|
5f5dc7d0de | ||
|
|
d505707dee | ||
|
|
5e7342477a | ||
|
|
35b1bb817e | ||
|
|
73d7c5790e | ||
|
|
d81be84f58 | ||
|
|
d6920bc1e2 | ||
|
|
68d4eeef27 | ||
|
|
92c29610df | ||
|
|
24eddda72c | ||
|
|
3257b59b27 | ||
|
|
10c95f86b1 | ||
|
|
269e01b7bf | ||
|
|
84f8a3e780 | ||
|
|
fe74f1de82 | ||
|
|
7b604a8bda | ||
|
|
cde1a8931a | ||
|
|
33c9da7cfe | ||
|
|
944b0ce91b | ||
|
|
6f388102ee | ||
|
|
677f66f98d | ||
|
|
8ff205843d | ||
|
|
a781fffb39 | ||
|
|
f3267f7fcf | ||
|
|
103ffc70bd | ||
|
|
f9b4e262f2 | ||
|
|
69f8d8cfdd | ||
|
|
be69c52cfe | ||
|
|
6fdbdd9f09 | ||
|
|
e638b7b38a | ||
|
|
750a43290c | ||
|
|
cdc9171615 | ||
|
|
21451c5294 | ||
|
|
dea35ca158 | ||
|
|
7d96e7b333 | ||
|
|
4f493626cb | ||
|
|
03a2dff668 | ||
|
|
0d213274b5 | ||
|
|
80d3b8d8bb | ||
|
|
e788ad9287 | ||
|
|
c70b5f6ec8 | ||
|
|
6b7ad781b7 | ||
|
|
9d60a4d1ec | ||
|
|
ec091ada95 | ||
|
|
c2547295bf | ||
|
|
58707feb72 | ||
|
|
7efe622990 | ||
|
|
fee4e482cf | ||
|
|
33b498cd39 | ||
|
|
8570237fb3 | ||
|
|
8b10a7c3ea | ||
|
|
0a3f83b15e | ||
|
|
f7a25c7d2d | ||
|
|
f092a4d2ea | ||
|
|
027864aaa6 | ||
|
|
8bcf81fbbd | ||
|
|
8c0a8f6856 | ||
|
|
254d2877b5 | ||
|
|
f71919f8f7 | ||
|
|
50bece6ac4 | ||
|
|
3141e1f020 | ||
|
|
0a131c502e | ||
|
|
6db0d27bf8 | ||
|
|
366e6ae171 | ||
|
|
1ed0fe7dd3 | ||
|
|
dbd2175446 | ||
|
|
1a997679a9 | ||
|
|
477356bd77 | ||
|
|
bf5899d9fd | ||
|
|
1565efd097 | ||
|
|
1dd9022407 | ||
|
|
ff2b27c6d0 | ||
|
|
a6b494841f | ||
|
|
0aff061781 | ||
|
|
c73d558ca4 | ||
|
|
f80de3a941 | ||
|
|
ca51733aa2 | ||
|
|
bfb4499005 | ||
|
|
2984d3f5e5 | ||
|
|
4eff18bf3a | ||
|
|
eeeac97553 | ||
|
|
62475f725a | ||
|
|
575c1a7bd7 | ||
|
|
eb03470625 | ||
|
|
b1aa2fc73a | ||
|
|
cd21c76c97 | ||
|
|
9e205ddf2a | ||
|
|
07a183955b | ||
|
|
b49c6e96fd | ||
|
|
148cfed141 | ||
|
|
cebbe6a1e8 | ||
|
|
558e23a9cd | ||
|
|
d7c37f6e0a | ||
|
|
c05090db8c | ||
|
|
fa19304a6d | ||
|
|
ec4962a3c9 | ||
|
|
7122aa44a1 | ||
|
|
cf62be365c | ||
|
|
9cc2f99334 | ||
|
|
d9d9f23af9 | ||
|
|
c29354f054 | ||
|
|
7738630952 | ||
|
|
c945ca4fe3 |
@@ -1,4 +1,4 @@
|
||||
name: Nuget Pack
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -16,25 +16,22 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
8.0.x
|
||||
9.0.x
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: 'BinaryObjectScanner/bin/Release/*.nupkg'
|
||||
- name: Run publish script
|
||||
run: ./publish-nix.sh -d
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: 'BinaryObjectScanner/bin/Release/*.nupkg'
|
||||
artifacts: "*.nupkg,*.snupkg,*.zip"
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
55
.github/workflows/build_programs.yml
vendored
55
.github/workflows/build_programs.yml
vendored
@@ -1,55 +0,0 @@
|
||||
name: Build Programs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
project: [ExtractionTool, ProtectionScan]
|
||||
runtime: [win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64]
|
||||
framework: [net9.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net9.0]
|
||||
conf: [Debug] #[Release, Debug]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Build
|
||||
run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8') || startsWith(matrix.framework, 'net9')) && '-p:PublishSingleFile=true' || ''}}
|
||||
|
||||
- name: Archive build
|
||||
run: |
|
||||
cd ${{ matrix.project }}/bin/Debug/${{ matrix.framework }}/${{ matrix.runtime }}/publish/
|
||||
zip -r ${{ github.workspace }}/${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip ./
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}
|
||||
path: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
replacesArtifacts: True
|
||||
tag: "rolling"
|
||||
updateOnlyUnreleased: True
|
||||
10
.github/workflows/check_pr.yml
vendored
10
.github/workflows/check_pr.yml
vendored
@@ -11,7 +11,13 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
8.0.x
|
||||
9.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
run: dotnet build
|
||||
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
|
||||
28
BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj
Normal file
28
BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj
Normal file
@@ -0,0 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BinaryObjectScanner\BinaryObjectScanner.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="SabreTools.Serialization" Version="1.8.6" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
50
BinaryObjectScanner.Test/Data/StaticChecksTests.cs
Normal file
50
BinaryObjectScanner.Test/Data/StaticChecksTests.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using BinaryObjectScanner.Data;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Data
|
||||
{
|
||||
public class StaticChecksTests
|
||||
{
|
||||
[Fact]
|
||||
public void ContentCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.ContentCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LinearExecutableCheckClasses_Empty()
|
||||
{
|
||||
var actual = StaticChecks.LinearExecutableCheckClasses;
|
||||
Assert.Empty(actual); // No implementations exist yet
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MSDOSExecutableCheckClasses_Empty()
|
||||
{
|
||||
var actual = StaticChecks.MSDOSExecutableCheckClasses;
|
||||
Assert.Empty(actual); // No implementations exist yet
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NewExecutableCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.NewExecutableCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PathCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.PathCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PortableExecutableCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.PortableExecutableCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
332
BinaryObjectScanner.Test/ExtensionsTests.cs
Normal file
332
BinaryObjectScanner.Test/ExtensionsTests.cs
Normal file
@@ -0,0 +1,332 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test
|
||||
{
|
||||
public class ExtensionsTests
|
||||
{
|
||||
#region FileSize
|
||||
|
||||
[Fact]
|
||||
public void FileSize_Null_Invalid()
|
||||
{
|
||||
string? filename = null;
|
||||
long actual = filename.FileSize();
|
||||
Assert.Equal(-1, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FileSize_Empty_Invalid()
|
||||
{
|
||||
string? filename = string.Empty;
|
||||
long actual = filename.FileSize();
|
||||
Assert.Equal(-1, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FileSize_Invalid_Invalid()
|
||||
{
|
||||
string? filename = "INVALID";
|
||||
long actual = filename.FileSize();
|
||||
Assert.Equal(-1, actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IterateWithAction
|
||||
|
||||
[Fact]
|
||||
public void IterateWithAction_EmptyEnumerable_Success()
|
||||
{
|
||||
List<string> set = new List<string>();
|
||||
Action<string> action = (s) => s.ToLowerInvariant();
|
||||
|
||||
set.IterateWithAction(action);
|
||||
Assert.Empty(set);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IterateWithAction_EmptyAction_Success()
|
||||
{
|
||||
List<string> set = ["a", "b", "c"];
|
||||
Action<string> action = (s) => { };
|
||||
|
||||
set.IterateWithAction(action);
|
||||
Assert.Equal(3, set.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IterateWithAction_Valid_Success()
|
||||
{
|
||||
List<string> set = ["a", "b", "c"];
|
||||
List<string> actual = new List<string>();
|
||||
|
||||
Action<string> action = (s) =>
|
||||
{
|
||||
lock (actual)
|
||||
{
|
||||
actual.Add(s.ToUpperInvariant());
|
||||
}
|
||||
};
|
||||
|
||||
set.IterateWithAction(action);
|
||||
Assert.Equal(3, set.Count);
|
||||
Assert.Equal(3, actual.Count);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OptionalContains
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_NullStringNoComparison_False()
|
||||
{
|
||||
string? str = null;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_NullStringComparison_False()
|
||||
{
|
||||
string? str = null;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_EmptyStringNoComparison_False()
|
||||
{
|
||||
string? str = string.Empty;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_EmptyStringComparison_False()
|
||||
{
|
||||
string? str = string.Empty;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_NoMatchNoComparison_False()
|
||||
{
|
||||
string? str = "postfix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_NoMatchComparison_False()
|
||||
{
|
||||
string? str = "postfix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_MatchesNoComparison_True()
|
||||
{
|
||||
string? str = "prefix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix);
|
||||
Assert.True(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalContains_MatchesComparison_True()
|
||||
{
|
||||
string? str = "prefix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalContains(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.True(actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OptionalEquals
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_NullStringNoComparison_False()
|
||||
{
|
||||
string? str = null;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_NullStringComparison_False()
|
||||
{
|
||||
string? str = null;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_EmptyStringNoComparison_False()
|
||||
{
|
||||
string? str = string.Empty;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_EmptyStringComparison_False()
|
||||
{
|
||||
string? str = string.Empty;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_NoMatchNoComparison_False()
|
||||
{
|
||||
string? str = "postfix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_NoMatchComparison_False()
|
||||
{
|
||||
string? str = "postfix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_MatchesNoComparison_True()
|
||||
{
|
||||
string? str = "prefix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix);
|
||||
Assert.True(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalEquals_MatchesComparison_True()
|
||||
{
|
||||
string? str = "prefix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalEquals(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.True(actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OptionalStartsWith
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_NullStringNoComparison_False()
|
||||
{
|
||||
string? str = null;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_NullStringComparison_False()
|
||||
{
|
||||
string? str = null;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_EmptyStringNoComparison_False()
|
||||
{
|
||||
string? str = string.Empty;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_EmptyStringComparison_False()
|
||||
{
|
||||
string? str = string.Empty;
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_NoMatchNoComparison_False()
|
||||
{
|
||||
string? str = "postfix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_NoMatchComparison_False()
|
||||
{
|
||||
string? str = "postfix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_MatchesNoComparison_True()
|
||||
{
|
||||
string? str = "prefix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix);
|
||||
Assert.True(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OptionalStartsWith_MatchesComparison_True()
|
||||
{
|
||||
string? str = "prefix";
|
||||
string prefix = "prefix";
|
||||
|
||||
bool actual = str.OptionalStartsWith(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.True(actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
124
BinaryObjectScanner.Test/FactoryTests.cs
Normal file
124
BinaryObjectScanner.Test/FactoryTests.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Interfaces;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test
|
||||
{
|
||||
public class FactoryTests
|
||||
{
|
||||
#region CreateDetectable
|
||||
|
||||
private static readonly List<WrapperType> _detectableTypes =
|
||||
[
|
||||
WrapperType.AACSMediaKeyBlock,
|
||||
WrapperType.BDPlusSVM,
|
||||
//WrapperType.CIA,
|
||||
WrapperType.Executable,
|
||||
WrapperType.LDSCRYPT,
|
||||
//WrapperType.N3DS,
|
||||
//WrapperType.Nitro,
|
||||
WrapperType.PlayJAudioFile,
|
||||
WrapperType.RealArcadeInstaller,
|
||||
WrapperType.RealArcadeMezzanine,
|
||||
WrapperType.SFFS,
|
||||
WrapperType.Textfile,
|
||||
];
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(GenerateIDetectableTestData))]
|
||||
public void CreateDetectableTests(WrapperType type, bool expectNull)
|
||||
{
|
||||
IDetectable? actual = Factory.CreateDetectable(type);
|
||||
|
||||
if (expectNull)
|
||||
Assert.Null(actual);
|
||||
else
|
||||
Assert.NotNull(actual);
|
||||
}
|
||||
|
||||
public static List<object?[]> GenerateIDetectableTestData()
|
||||
{
|
||||
var testData = new List<object?[]>() { new object?[] { null, true } };
|
||||
foreach (WrapperType type in Enum.GetValues(typeof(WrapperType)))
|
||||
{
|
||||
if (_detectableTypes.Contains(type))
|
||||
testData.Add([type, false]);
|
||||
else
|
||||
testData.Add([type, true]);
|
||||
}
|
||||
|
||||
return testData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CreateExtractable
|
||||
|
||||
private static readonly List<WrapperType> _extractableTypes =
|
||||
[
|
||||
WrapperType.BFPK,
|
||||
WrapperType.BSP,
|
||||
WrapperType.BZip2,
|
||||
WrapperType.CFB,
|
||||
//WrapperType.CIA,
|
||||
//WrapperType.Executable,
|
||||
WrapperType.GCF,
|
||||
WrapperType.GZIP,
|
||||
WrapperType.InstallShieldArchiveV3,
|
||||
WrapperType.InstallShieldCAB,
|
||||
WrapperType.LZKWAJ,
|
||||
WrapperType.LZQBasic,
|
||||
WrapperType.LZSZDD,
|
||||
WrapperType.MicrosoftCAB,
|
||||
WrapperType.MoPaQ,
|
||||
//WrapperType.N3DS,
|
||||
//WrapperType.NCF,
|
||||
//WrapperType.Nitro,
|
||||
WrapperType.PAK,
|
||||
WrapperType.PFF,
|
||||
WrapperType.PKZIP,
|
||||
//WrapperType.PlayJAudioFile,
|
||||
//WrapperType.Quantum,
|
||||
WrapperType.RAR,
|
||||
WrapperType.SevenZip,
|
||||
WrapperType.SFFS,
|
||||
WrapperType.SGA,
|
||||
WrapperType.TapeArchive,
|
||||
WrapperType.VBSP,
|
||||
WrapperType.VPK,
|
||||
WrapperType.WAD,
|
||||
WrapperType.XZ,
|
||||
WrapperType.XZP,
|
||||
];
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(GenerateIExtractableTestData))]
|
||||
public void CreateExtractableTests(WrapperType type, bool expectNull)
|
||||
{
|
||||
IExtractable? actual = Factory.CreateExtractable(type);
|
||||
|
||||
if (expectNull)
|
||||
Assert.Null(actual);
|
||||
else
|
||||
Assert.NotNull(actual);
|
||||
}
|
||||
|
||||
public static List<object?[]> GenerateIExtractableTestData()
|
||||
{
|
||||
var testData = new List<object?[]>();
|
||||
foreach (WrapperType type in Enum.GetValues(typeof(WrapperType)))
|
||||
{
|
||||
if (_extractableTypes.Contains(type))
|
||||
testData.Add([type, false]);
|
||||
else
|
||||
testData.Add([type, true]);
|
||||
}
|
||||
|
||||
return testData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
31
BinaryObjectScanner.Test/FileType/AACSMediaKeyBlockTests.cs
Normal file
31
BinaryObjectScanner.Test/FileType/AACSMediaKeyBlockTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class AACSMediaKeyBlockTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new AACSMediaKeyBlock();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new AACSMediaKeyBlock();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
BinaryObjectScanner.Test/FileType/BDPlusSVMTests.cs
Normal file
31
BinaryObjectScanner.Test/FileType/BDPlusSVMTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class BDPlusSVMTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new BDPlusSVM();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new BDPlusSVM();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
68
BinaryObjectScanner.Test/FileType/BFPKTests.cs
Normal file
68
BinaryObjectScanner.Test/FileType/BFPKTests.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class BFPKTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BFPK();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BFPK();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BFPK();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractAll_EmptyModel_False()
|
||||
{
|
||||
var model = new SabreTools.Models.BFPK.Archive();
|
||||
var data = new MemoryStream();
|
||||
var item = new SabreTools.Serialization.Wrappers.BFPK(model, data);
|
||||
string outputDirectory = string.Empty;
|
||||
|
||||
bool actual = BFPK.ExtractAll(item, outputDirectory);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyModel_False()
|
||||
{
|
||||
var model = new SabreTools.Models.BFPK.Archive();
|
||||
var data = new MemoryStream();
|
||||
var item = new SabreTools.Serialization.Wrappers.BFPK(model, data);
|
||||
string outputDirectory = string.Empty;
|
||||
|
||||
bool actual = BFPK.ExtractFile(item, 0, outputDirectory);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/BSPTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/BSPTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class BSPTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BSP();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BSP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BSP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/BZip2Tests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/BZip2Tests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class BZip2Tests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BZip2();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BZip2();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new BZip2();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/CFBTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/CFBTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class CFBTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new CFB();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new CFB();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new CFB();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
43
BinaryObjectScanner.Test/FileType/ExecutableTests.cs
Normal file
43
BinaryObjectScanner.Test/FileType/ExecutableTests.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class ExecutableTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new Executable();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new Executable();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectDict_EmptyStream_Empty()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
Func<string, ProtectionDictionary>? getProtections = null;
|
||||
var detectable = new Executable();
|
||||
|
||||
ProtectionDictionary actual = detectable.DetectDict(stream, file, getProtections, includeDebug: false);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/GCFTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/GCFTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class GCFTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new GCF();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new GCF();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new GCF();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/GZIPTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/GZIPTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class GZIPTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new GZIP();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new GZIP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new GZIP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class InstallShieldArchiveV3Tests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new InstallShieldArchiveV3();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new InstallShieldArchiveV3();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new InstallShieldArchiveV3();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/InstallShieldCABTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/InstallShieldCABTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class InstallShieldCABTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new InstallShieldCAB();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new InstallShieldCAB();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new InstallShieldCAB();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs
Normal file
31
BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class LDSCRYPTTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new LDSCRYPT();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new LDSCRYPT();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
44
BinaryObjectScanner.Test/FileType/LZKWAJTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/LZKWAJTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class LZKWAJTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZKWAJ();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZKWAJ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZKWAJ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/LZQBasicTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/LZQBasicTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class LZQBasicTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZQBasic();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZQBasic();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZQBasic();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/LZSZDDTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/LZSZDDTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class LZSZDDTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZSZDD();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZSZDD();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new LZSZDD();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/MPQTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/MPQTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class MPQTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MPQ();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MPQ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MPQ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/MicrosoftCABTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/MicrosoftCABTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class MicrosoftCABTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MicrosoftCAB();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MicrosoftCAB();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MicrosoftCAB();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/PAKTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/PAKTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class PAKTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PAK();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PAK();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PAK();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/PFFTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/PFFTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class PFFTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PFF();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PFF();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PFF();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
79
BinaryObjectScanner.Test/FileType/PKZIPTests.cs
Normal file
79
BinaryObjectScanner.Test/FileType/PKZIPTests.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class PKZIPTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PKZIP();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_LookForHeader_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PKZIP();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PKZIP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_LookForHeader_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PKZIP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PKZIP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_LookForHeader_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new PKZIP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
BinaryObjectScanner.Test/FileType/PLJTests.cs
Normal file
31
BinaryObjectScanner.Test/FileType/PLJTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class PLJTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new PLJ();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new PLJ();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
68
BinaryObjectScanner.Test/FileType/QuantumTests.cs
Normal file
68
BinaryObjectScanner.Test/FileType/QuantumTests.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class QuantumTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new Quantum();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new Quantum();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new Quantum();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractAll_EmptyModel_False()
|
||||
{
|
||||
var model = new SabreTools.Models.Quantum.Archive();
|
||||
var data = new MemoryStream();
|
||||
var item = new SabreTools.Serialization.Wrappers.Quantum(model, data);
|
||||
string outputDirectory = string.Empty;
|
||||
|
||||
bool actual = Quantum.ExtractAll(item, outputDirectory);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyModel_False()
|
||||
{
|
||||
var model = new SabreTools.Models.Quantum.Archive();
|
||||
var data = new MemoryStream();
|
||||
var item = new SabreTools.Serialization.Wrappers.Quantum(model, data);
|
||||
string outputDirectory = string.Empty;
|
||||
|
||||
bool actual = Quantum.ExtractFile(item, 0, outputDirectory);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
79
BinaryObjectScanner.Test/FileType/RARTests.cs
Normal file
79
BinaryObjectScanner.Test/FileType/RARTests.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class RARTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new RAR();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_LookForHeader_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new RAR();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new RAR();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_LookForHeader_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new RAR();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new RAR();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_LookForHeader_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new RAR();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class RealArcadeInstallerTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeInstaller();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeInstaller();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class RealArcadeMezzanineTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeMezzanine();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeMezzanine();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
65
BinaryObjectScanner.Test/FileType/SFFSTests.cs
Normal file
65
BinaryObjectScanner.Test/FileType/SFFSTests.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class SFFSTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new SFFS();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new SFFS();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SFFS();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SFFS();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SFFS();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/SGATests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/SGATests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class SGATests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SGA();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SGA();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SGA();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
79
BinaryObjectScanner.Test/FileType/SevenZipTests.cs
Normal file
79
BinaryObjectScanner.Test/FileType/SevenZipTests.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class SevenZipTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SevenZip();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_LookForHeader_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SevenZip();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SevenZip();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_LookForHeader_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SevenZip();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SevenZip();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_LookForHeader_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new SevenZip();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
46
BinaryObjectScanner.Test/FileType/TapeArchiveTests.cs
Normal file
46
BinaryObjectScanner.Test/FileType/TapeArchiveTests.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class TapeArchiveTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new TapeArchive();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new TapeArchive();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_True()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new TapeArchive();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
|
||||
// Unexpected result -- Empty file recognized as valid in SharpCompress
|
||||
Assert.True(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
BinaryObjectScanner.Test/FileType/TextfileTests.cs
Normal file
31
BinaryObjectScanner.Test/FileType/TextfileTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class TextfileTests
|
||||
{
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new Textfile();
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new Textfile();
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
44
BinaryObjectScanner.Test/FileType/VBSPTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/VBSPTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class VBSPTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new VBSP();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new VBSP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new VBSP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/VPKTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/VPKTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class VPKTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new VPK();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new VPK();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new VPK();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/WAD3Tests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/WAD3Tests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class WAD3Tests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new WAD3();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new WAD3();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new WAD3();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/XZPTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/XZPTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class XZPTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new XZP();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new XZP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new XZP();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/FileType/XZTests.cs
Normal file
44
BinaryObjectScanner.Test/FileType/XZTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class XZTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new XZ();
|
||||
|
||||
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Null_False()
|
||||
{
|
||||
Stream? stream = null;
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new XZ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractStream_Empty_False()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new XZ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/GameEngine/RenderWareTests.cs
Normal file
22
BinaryObjectScanner.Test/GameEngine/RenderWareTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.GameEngine;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.GameEngine
|
||||
{
|
||||
public class RenderWareTests
|
||||
{
|
||||
[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 RenderWare();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/ASPackTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/ASPackTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/AdvancedInstallerTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/AdvancedInstallerTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/AutoPlayMediaStudioTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/AutoPlayMediaStudioTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/CExeTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/CExeTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/DotFuscatorTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/DotFuscatorTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/DotNetReactorTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/DotNetReactorTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
47
BinaryObjectScanner.Test/Packer/EXEStealthTests.cs
Normal file
47
BinaryObjectScanner.Test/Packer/EXEStealthTests.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Packer;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Packer
|
||||
{
|
||||
public class EXEStealthTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckContentsTest()
|
||||
{
|
||||
string file = "filename";
|
||||
byte[] fileContent = [0x01, 0x02, 0x03, 0x04];
|
||||
|
||||
var checker = new EXEStealth();
|
||||
string? actual = checker.CheckContents(file, fileContent, includeDebug: true);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/EmbeddedArchiveTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/EmbeddedArchiveTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/EmbeddedExecutableTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/EmbeddedExecutableTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/GenteeInstallerTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/GenteeInstallerTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/HyperTechCrackProofTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/HyperTechCrackProofTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
63
BinaryObjectScanner.Test/Packer/InnoSetupTests.cs
Normal file
63
BinaryObjectScanner.Test/Packer/InnoSetupTests.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Packer;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Packer
|
||||
{
|
||||
public class InnoSetupTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
|
||||
var checker = new InnoSetup();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[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 ExtractNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
string outputDir = string.Empty;
|
||||
|
||||
var checker = new InnoSetup();
|
||||
bool actual = checker.Extract(file, nex, outputDir, includeDebug: false);
|
||||
Assert.False(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/InstallAnywhereTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/InstallAnywhereTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/InstallerVISETests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/InstallerVISETests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/MicrosoftCABSFXTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/MicrosoftCABSFXTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/NSISTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/NSISTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/NeoLiteTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/NeoLiteTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/PECompactTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/PECompactTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/PEtiteTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/PEtiteTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/SetupFactoryTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/SetupFactoryTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/SevenZipSFXTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/SevenZipSFXTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/ShrinkerTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/ShrinkerTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/UPXTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/UPXTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Packer/WinRARSFXTests.cs
Normal file
36
BinaryObjectScanner.Test/Packer/WinRARSFXTests.cs
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
63
BinaryObjectScanner.Test/Packer/WinZipSFXTests.cs
Normal file
63
BinaryObjectScanner.Test/Packer/WinZipSFXTests.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Packer;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Packer
|
||||
{
|
||||
public class WinZipSFXTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
|
||||
var checker = new WinZipSFX();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[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 ExtractNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
string outputDir = string.Empty;
|
||||
|
||||
var checker = new WinZipSFX();
|
||||
bool actual = checker.Extract(file, nex, outputDir, includeDebug: false);
|
||||
Assert.False(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
63
BinaryObjectScanner.Test/Packer/WiseInstallerTests.cs
Normal file
63
BinaryObjectScanner.Test/Packer/WiseInstallerTests.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Packer;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Packer
|
||||
{
|
||||
public class WiseInstallerTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
|
||||
var checker = new WiseInstaller();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[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 ExtractNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
string outputDir = string.Empty;
|
||||
|
||||
var checker = new WiseInstaller();
|
||||
bool actual = checker.Extract(file, nex, outputDir, includeDebug: false);
|
||||
Assert.False(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
BinaryObjectScanner.Test/Protection/ActiveMARKTests.cs
Normal file
33
BinaryObjectScanner.Test/Protection/ActiveMARKTests.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class ActiveMARKTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckContentsTest()
|
||||
{
|
||||
string file = "filename";
|
||||
byte[] fileContent = [0x01, 0x02, 0x03, 0x04];
|
||||
|
||||
var checker = new ActiveMARK();
|
||||
string? actual = checker.CheckContents(file, fileContent, includeDebug: true);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[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 ActiveMARK();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/AegiSoftTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/AegiSoftTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class AegiSoftTests
|
||||
{
|
||||
[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 AegiSoft();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new AegiSoft();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new AegiSoft();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
BinaryObjectScanner.Test/Protection/AlphaDVDTests.cs
Normal file
30
BinaryObjectScanner.Test/Protection/AlphaDVDTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class AlphaDVDTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new AlphaDVD();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new AlphaDVD();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Protection/AlphaROMTests.cs
Normal file
22
BinaryObjectScanner.Test/Protection/AlphaROMTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class AlphaROMTests
|
||||
{
|
||||
[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 AlphaROM();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
BinaryObjectScanner.Test/Protection/ArmadilloTests.cs
Normal file
36
BinaryObjectScanner.Test/Protection/ArmadilloTests.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class ArmadilloTests
|
||||
{
|
||||
[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 Armadillo();
|
||||
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 Armadillo();
|
||||
bool actual = checker.Extract(file, pex, outputDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
BinaryObjectScanner.Test/Protection/BitpoolTests.cs
Normal file
30
BinaryObjectScanner.Test/Protection/BitpoolTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class BitpoolTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new Bitpool();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new Bitpool();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/ByteShieldTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/ByteShieldTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class ByteShieldTests
|
||||
{
|
||||
[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 ByteShield();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new ByteShield();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new ByteShield();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Protection/CDCheckTests.cs
Normal file
22
BinaryObjectScanner.Test/Protection/CDCheckTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDCheckTests
|
||||
{
|
||||
[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 CDCheck();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
68
BinaryObjectScanner.Test/Protection/CDDVDCopsTests.cs
Normal file
68
BinaryObjectScanner.Test/Protection/CDDVDCopsTests.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDDVDCopsTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckContentsTest()
|
||||
{
|
||||
string file = "filename";
|
||||
byte[] fileContent = [0x01, 0x02, 0x03, 0x04];
|
||||
|
||||
var checker = new CDDVDCops();
|
||||
string? actual = checker.CheckContents(file, fileContent, includeDebug: true);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
|
||||
var checker = new CDDVDCops();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[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 CDDVDCops();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CDDVDCops();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CDDVDCops();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/CDGuardTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/CDGuardTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDGuardTests
|
||||
{
|
||||
[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 CDGuard();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CDGuard();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CDGuard();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Protection/CDKeyTests.cs
Normal file
22
BinaryObjectScanner.Test/Protection/CDKeyTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDKeyTests
|
||||
{
|
||||
[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 CDKey();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/CDLockTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/CDLockTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDLockTests
|
||||
{
|
||||
[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 CDLock();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CDLock();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CDLock();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
BinaryObjectScanner.Test/Protection/CDProtectorTests.cs
Normal file
30
BinaryObjectScanner.Test/Protection/CDProtectorTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDProtectorTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CDProtector();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CDProtector();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Protection/CDSHiELDSETests.cs
Normal file
22
BinaryObjectScanner.Test/Protection/CDSHiELDSETests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDSHiELDSETests
|
||||
{
|
||||
[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 CDSHiELDSE();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
BinaryObjectScanner.Test/Protection/CDXTests.cs
Normal file
30
BinaryObjectScanner.Test/Protection/CDXTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CDXTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CDX();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CDX();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
BinaryObjectScanner.Test/Protection/CactusDataShieldTests.cs
Normal file
19
BinaryObjectScanner.Test/Protection/CactusDataShieldTests.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CactusDataShieldTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckContentsTest()
|
||||
{
|
||||
string file = "filename";
|
||||
byte[] fileContent = [0x01, 0x02, 0x03, 0x04];
|
||||
|
||||
var checker = new CactusDataShield();
|
||||
string? actual = checker.CheckContents(file, fileContent, includeDebug: true);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/CenegaProtectDVDTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/CenegaProtectDVDTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CenegaProtectDVDTests
|
||||
{
|
||||
[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 CenegaProtectDVD();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CenegaProtectDVD();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CenegaProtectDVD();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/ChannelwareTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/ChannelwareTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class ChannelwareTests
|
||||
{
|
||||
[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 Channelware();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new Channelware();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new Channelware();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class ChosenBytesCodeLockTests
|
||||
{
|
||||
[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 ChosenBytesCodeLock();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new ChosenBytesCodeLock();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new ChosenBytesCodeLock();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/CopyKillerTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/CopyKillerTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CopyKillerTests
|
||||
{
|
||||
[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 CopyKiller();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CopyKiller();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CopyKiller();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Protection/CopyLokTests.cs
Normal file
22
BinaryObjectScanner.Test/Protection/CopyLokTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CopyLokTests
|
||||
{
|
||||
[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 CopyLok();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/CopyXTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/CopyXTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CopyXTests
|
||||
{
|
||||
[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 CopyX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CopyX();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CopyX();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/CrypKeyTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/CrypKeyTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CrypKeyTests
|
||||
{
|
||||
[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 CrypKey();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new CrypKey();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new CrypKey();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Protection/CuckoTests.cs
Normal file
22
BinaryObjectScanner.Test/Protection/CuckoTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class CuckoTests
|
||||
{
|
||||
[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 Cucko();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
BinaryObjectScanner.Test/Protection/DVDCryptTests.cs
Normal file
30
BinaryObjectScanner.Test/Protection/DVDCryptTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class DVDCryptTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new DVDCrypt();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new DVDCrypt();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
BinaryObjectScanner.Test/Protection/DVDMoviePROTECTTests.cs
Normal file
30
BinaryObjectScanner.Test/Protection/DVDMoviePROTECTTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class DVDMoviePROTECTTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new DVDMoviePROTECT();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new DVDMoviePROTECT();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/DenuvoTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/DenuvoTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class DenuvoTests
|
||||
{
|
||||
[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 Denuvo();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new Denuvo();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new Denuvo();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/DigiGuardTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/DigiGuardTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class DigiGuardTests
|
||||
{
|
||||
[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 DigiGuard();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new DigiGuard();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new DigiGuard();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class DinamicMultimediaTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new DinamicMultimedia();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new DinamicMultimedia();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
BinaryObjectScanner.Test/Protection/DiscGuardTests.cs
Normal file
44
BinaryObjectScanner.Test/Protection/DiscGuardTests.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Protection;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Protection
|
||||
{
|
||||
public class DiscGuardTests
|
||||
{
|
||||
[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 DiscGuard();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckDirectoryPathTest()
|
||||
{
|
||||
string path = "path";
|
||||
List<string> files = [];
|
||||
|
||||
var checker = new DiscGuard();
|
||||
List<string> actual = checker.CheckDirectoryPath(path, files);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFilePathTest()
|
||||
{
|
||||
string path = "path";
|
||||
|
||||
var checker = new DiscGuard();
|
||||
string? actual = checker.CheckFilePath(path);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user