mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-04 13:45:28 +00:00
Compare commits
317 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daa72eb970 | ||
|
|
a42328ef60 | ||
|
|
7f2dd26d9b | ||
|
|
871ac97a3a | ||
|
|
5e11048e18 | ||
|
|
19e696bf15 | ||
|
|
ddf8c393df | ||
|
|
d234549099 | ||
|
|
5899dd99f3 | ||
|
|
f50f9f741d | ||
|
|
09f5b28de7 | ||
|
|
f71a007b35 | ||
|
|
d6a89c8905 | ||
|
|
1b4f363b08 | ||
|
|
8abdaa4218 | ||
|
|
454bfa9f4f | ||
|
|
8534cda9c5 | ||
|
|
b285127cee | ||
|
|
8a6179ea11 | ||
|
|
d07e46c5f7 | ||
|
|
ee5ed5e833 | ||
|
|
7fcdfce152 | ||
|
|
f1d7ee89cb | ||
|
|
1765e4da16 | ||
|
|
2a7455252e | ||
|
|
057ce3c4cc | ||
|
|
7e7d166ed8 | ||
|
|
0872e0ff49 | ||
|
|
c0a590db63 | ||
|
|
50b4eb99e3 | ||
|
|
08a90d52a8 | ||
|
|
d41cd63ad7 | ||
|
|
c12d3fbe15 | ||
|
|
4db1c57830 | ||
|
|
1e1da59ba0 | ||
|
|
4a94c80ec1 | ||
|
|
cb4c4cb3fb | ||
|
|
8008705366 | ||
|
|
20888a22db | ||
|
|
b06512e292 | ||
|
|
18ce24400a | ||
|
|
31d85360e9 | ||
|
|
53c8ec1dcf | ||
|
|
c68f126210 | ||
|
|
03016f3399 | ||
|
|
778064b3a5 | ||
|
|
4ed619ee30 | ||
|
|
df52d08406 | ||
|
|
66d48ed1cd | ||
|
|
79680135b7 | ||
|
|
84b9b46744 | ||
|
|
33e83b9f52 | ||
|
|
57759a3bef | ||
|
|
9caa91736c | ||
|
|
3ffbeddcbe | ||
|
|
6a5afd8d2c | ||
|
|
0afd189fe0 | ||
|
|
cc87d44e3f | ||
|
|
981a5bb7b5 | ||
|
|
4afea551ba | ||
|
|
5f9f21ae14 | ||
|
|
4c4c72fd98 | ||
|
|
821a853975 | ||
|
|
34a3050e27 | ||
|
|
5c1a1364a1 | ||
|
|
d1f1c1f728 | ||
|
|
d969dd691b | ||
|
|
13e4d86135 | ||
|
|
d37b400566 | ||
|
|
da4188a49b | ||
|
|
a85998ebf6 | ||
|
|
bd934c0af3 | ||
|
|
14dae3dd73 | ||
|
|
80cd7dffdb | ||
|
|
a0bbd0be32 | ||
|
|
3bd9eadfe2 | ||
|
|
c537f9dac9 | ||
|
|
64b65b0f59 | ||
|
|
36c858fac1 | ||
|
|
30361a9af7 | ||
|
|
d6708a0cbe | ||
|
|
9639f40e55 | ||
|
|
7fa41ba945 | ||
|
|
e1a659af5f | ||
|
|
bca5ec48d5 | ||
|
|
303fa314e6 | ||
|
|
cbcc11547c | ||
|
|
10286e8380 | ||
|
|
a4ddc014ee | ||
|
|
61d186cae3 | ||
|
|
799489d079 | ||
|
|
9eb74a411c | ||
|
|
f263781250 | ||
|
|
6e7ef785ff | ||
|
|
aef4495168 | ||
|
|
2c0885383e | ||
|
|
04355d851a | ||
|
|
2cc72e2059 | ||
|
|
6f61ee19b1 | ||
|
|
7784e0cfef | ||
|
|
a55e490e73 | ||
|
|
d316edf8d0 | ||
|
|
9af871c0ff | ||
|
|
6cb86512c3 | ||
|
|
d6a3a37d49 | ||
|
|
281e7b419a | ||
|
|
fd6de0d10c | ||
|
|
760434309b | ||
|
|
11034a7a7c | ||
|
|
a76a8d0839 | ||
|
|
de35586f30 | ||
|
|
d29dec3904 | ||
|
|
d8b0588d6e | ||
|
|
5c7ea889be | ||
|
|
846000cb3f | ||
|
|
d1398791f5 | ||
|
|
999c5c473e | ||
|
|
6e334c8770 | ||
|
|
42dd33c8bd | ||
|
|
4420021cbe | ||
|
|
d8049792f1 | ||
|
|
86c4639d52 | ||
|
|
abfcc52fd2 | ||
|
|
06f84db092 | ||
|
|
ef03ca3a03 | ||
|
|
28783c83cf | ||
|
|
e497540bdc | ||
|
|
7b8c006f4d | ||
|
|
4b697c7d20 | ||
|
|
bef5749b5e | ||
|
|
0d371d0f3c | ||
|
|
fa67d370c0 | ||
|
|
a89124883c | ||
|
|
2690536fda | ||
|
|
8e8c43e304 | ||
|
|
edc32af47c | ||
|
|
57685f0682 | ||
|
|
dd7f120ddc | ||
|
|
16ca7e7920 | ||
|
|
397294ac63 | ||
|
|
1afbd2d484 | ||
|
|
7d39a6165e | ||
|
|
785f5cfde1 | ||
|
|
f5b1868eec | ||
|
|
8fedbb8f77 | ||
|
|
9af64f23a5 | ||
|
|
3558ceb890 | ||
|
|
bd1166cbab | ||
|
|
6361398b1b | ||
|
|
e87a0ff8ec | ||
|
|
00db772594 | ||
|
|
8043201be7 | ||
|
|
3a5e7004a3 | ||
|
|
168231cc94 | ||
|
|
a11c7dc9d5 | ||
|
|
038910b744 | ||
|
|
4d85ba2d31 | ||
|
|
46feb3e568 | ||
|
|
821b91a555 | ||
|
|
43b3c72a02 | ||
|
|
e9c1e9b7e7 | ||
|
|
6ea98f5dc4 | ||
|
|
5ef9c4cd8a | ||
|
|
2597575500 | ||
|
|
523e670cc5 | ||
|
|
ed6d3c1f3e | ||
|
|
0efc6aef10 | ||
|
|
b1600ad7d2 | ||
|
|
6904674785 | ||
|
|
6da9e9c931 | ||
|
|
b4a94cf247 | ||
|
|
f81e46670a | ||
|
|
cc7040c3cb | ||
|
|
c70f0d72d2 | ||
|
|
d2ed0a822a | ||
|
|
e21a6e78d7 | ||
|
|
138842318a | ||
|
|
e883f0c7d4 | ||
|
|
03f96238a5 | ||
|
|
60cd67e22e | ||
|
|
c0e82fa021 | ||
|
|
cc826fdc60 | ||
|
|
77ad6e791a | ||
|
|
55e368e23a | ||
|
|
a82d1e729c | ||
|
|
5958dac739 | ||
|
|
29bd888052 | ||
|
|
1b2c62da9a | ||
|
|
c95890aae5 | ||
|
|
58022ec328 | ||
|
|
692da62dee | ||
|
|
91aea728ac | ||
|
|
c408f349fe | ||
|
|
de85426f04 | ||
|
|
43649851ca | ||
|
|
9b49f7c597 | ||
|
|
0f186634f2 | ||
|
|
e24172245e | ||
|
|
5e40c7a37e | ||
|
|
0bf1be23c4 | ||
|
|
06e51247e1 | ||
|
|
251bf9ca6d | ||
|
|
fe5f114290 | ||
|
|
8f2d20dcfa | ||
|
|
8e516f3b6b | ||
|
|
ad449c2e33 | ||
|
|
ddbd396b6b | ||
|
|
b2b9083221 | ||
|
|
d71cb413fd | ||
|
|
8e745db34e | ||
|
|
93a6ab5b19 | ||
|
|
edd990bc89 | ||
|
|
fb1310a5a9 | ||
|
|
a818a8af0a | ||
|
|
589214ea38 | ||
|
|
892fd945bb | ||
|
|
7a72961ee5 | ||
|
|
b745038829 | ||
|
|
58b5b5228a | ||
|
|
0725f4ba0f | ||
|
|
6e0063cd1f | ||
|
|
78373dd620 | ||
|
|
fa74963a75 | ||
|
|
7331f8f576 | ||
|
|
6f4e7138fb | ||
|
|
28b2eaa029 | ||
|
|
0585f0a3cb | ||
|
|
12e8349ab1 | ||
|
|
3c05bece9e | ||
|
|
dc1944b768 | ||
|
|
fd489c5b46 | ||
|
|
7ce4c252e2 | ||
|
|
d54c88a01d | ||
|
|
6a4d5bddeb | ||
|
|
aca01e2058 | ||
|
|
e93bab29fa | ||
|
|
ca87c48cd7 | ||
|
|
0d215d0817 | ||
|
|
d86dbf47b5 | ||
|
|
7cb318ce6d | ||
|
|
18b89543ef | ||
|
|
be50d1343e | ||
|
|
32c9ea7838 | ||
|
|
cf7a68602b | ||
|
|
f2fe2623c6 | ||
|
|
249a17be1f | ||
|
|
dff15ef799 | ||
|
|
c0c94fd78d | ||
|
|
af43748766 | ||
|
|
d28d8b5a2b | ||
|
|
0edc380059 | ||
|
|
2311dd9cc8 | ||
|
|
f87ce49f7e | ||
|
|
928e93a7da | ||
|
|
75517a5f83 | ||
|
|
cfe9825af7 | ||
|
|
1ff1281c8f | ||
|
|
c9194f18ef | ||
|
|
60a3a74862 | ||
|
|
7a96e8cfe3 | ||
|
|
9fee74f2a6 | ||
|
|
63a5a25a17 | ||
|
|
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 |
@@ -1,4 +1,4 @@
|
||||
name: Nuget Pack
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -16,31 +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: Build library
|
||||
run: dotnet build
|
||||
|
||||
- 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
|
||||
7
.github/workflows/check_pr.yml
vendored
7
.github/workflows/check_pr.yml
vendored
@@ -11,10 +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
|
||||
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
run: dotnet test
|
||||
|
||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -1,9 +0,0 @@
|
||||
[submodule "BinaryObjectScanner/_EXTERNAL/stormlibsharp"]
|
||||
path = BinaryObjectScanner/_EXTERNAL/stormlibsharp
|
||||
url = https://github.com/robpaveza/stormlibsharp.git
|
||||
[submodule "BinaryObjectScanner/_EXTERNAL/libmspack4n"]
|
||||
path = BinaryObjectScanner/_EXTERNAL/libmspack4n
|
||||
url = https://github.com/activescott/libmspack4n.git
|
||||
[submodule "BinaryObjectScanner/_EXTERNAL/LessIO"]
|
||||
path = BinaryObjectScanner/_EXTERNAL/LessIO
|
||||
url = https://github.com/activescott/LessIO.git
|
||||
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@@ -15,20 +15,8 @@
|
||||
"cwd": "${workspaceFolder}/ProtectionScan",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Launch (ExtractionTool)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/ExtractionTool/bin/Debug/net9.0/ExtractionTool.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/ExtractionTool",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
"stopAtEntry": false,
|
||||
"justMyCode": false,
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"dotnet.defaultSolution": "BinaryObjectScanner.sln"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
@@ -12,14 +12,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.4">
|
||||
<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.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
<PackageReference Include="SabreTools.Serialization" Version="[2.0.1]" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using BinaryObjectScanner.Data;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test
|
||||
namespace BinaryObjectScanner.Test.Data
|
||||
{
|
||||
public class ScannerTests
|
||||
public class ProtectionDictionaryTests
|
||||
{
|
||||
#region ProcessProtectionString
|
||||
|
||||
@@ -11,7 +12,7 @@ namespace BinaryObjectScanner.Test
|
||||
public void ProcessProtectionString_Null_Empty()
|
||||
{
|
||||
string? protection = null;
|
||||
List<string> actual = Scanner.ProcessProtectionString(protection);
|
||||
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
@@ -19,7 +20,7 @@ namespace BinaryObjectScanner.Test
|
||||
public void ProcessProtectionString_Empty_Empty()
|
||||
{
|
||||
string? protection = string.Empty;
|
||||
List<string> actual = Scanner.ProcessProtectionString(protection);
|
||||
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace BinaryObjectScanner.Test
|
||||
public void ProcessProtectionString_NoIndicator_Single()
|
||||
{
|
||||
string? protection = "item1";
|
||||
List<string> actual = Scanner.ProcessProtectionString(protection);
|
||||
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
||||
Assert.Single(actual);
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace BinaryObjectScanner.Test
|
||||
public void ProcessProtectionString_Indicator_Multiple()
|
||||
{
|
||||
string? protection = "item1;item2";
|
||||
List<string> actual = Scanner.ProcessProtectionString(protection);
|
||||
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
||||
Assert.Equal(2, actual.Count);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace BinaryObjectScanner.Test.Data
|
||||
public void ContentCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.ContentCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
Assert.Equal(6, actual.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -30,21 +30,21 @@ namespace BinaryObjectScanner.Test.Data
|
||||
public void NewExecutableCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.NewExecutableCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
Assert.Equal(7, actual.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PathCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.PathCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
Assert.Equal(68, actual.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PortableExecutableCheckClasses_Populated()
|
||||
{
|
||||
var actual = StaticChecks.PortableExecutableCheckClasses;
|
||||
Assert.NotEmpty(actual);
|
||||
Assert.Equal(105, actual.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test
|
||||
@@ -33,300 +31,5 @@ namespace BinaryObjectScanner.Test
|
||||
}
|
||||
|
||||
#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
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
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.MicrosoftCAB,
|
||||
WrapperType.MicrosoftLZ,
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -6,25 +6,28 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class AACSMediaKeyBlockTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.AACSMediaKeyBlock wrapper
|
||||
= new(new SabreTools.Data.Models.AACS.MediaKeyBlock(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new AACSMediaKeyBlock();
|
||||
var detectable = new AACSMediaKeyBlock(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
public void DetectStream_EmptyStream_DefaultValue()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new AACSMediaKeyBlock();
|
||||
var detectable = new AACSMediaKeyBlock(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
Assert.Equal("AACS (Unknown Version)", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,25 +6,28 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class BDPlusSVMTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.BDPlusSVM wrapper
|
||||
= new(new SabreTools.Data.Models.BDPlus.SVM(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new BDPlusSVM();
|
||||
var detectable = new BDPlusSVM(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
public void DetectStream_EmptyStream_DefaultValue()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new BDPlusSVM();
|
||||
var detectable = new BDPlusSVM(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
Assert.Equal("BD+ 0000-00-00", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class LDSCRYPTTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.LDSCRYPT wrapper
|
||||
= new(new SabreTools.Data.Models.LDSCRYPT.EncryptedFile(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new LDSCRYPT();
|
||||
var detectable = new LDSCRYPT(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
@@ -21,10 +24,10 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new LDSCRYPT();
|
||||
var detectable = new LDSCRYPT(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
Assert.Equal("LDSCRYPT", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
34
BinaryObjectScanner.Test/FileType/LinearExecutableTests.cs
Normal file
34
BinaryObjectScanner.Test/FileType/LinearExecutableTests.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class LinearExecutableTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.LinearExecutable wrapper
|
||||
= new(new SabreTools.Data.Models.LinearExecutable.Executable(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new LinearExecutable(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Empty()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new LinearExecutable(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.NotNull(actual);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
BinaryObjectScanner.Test/FileType/MSDOSTests.cs
Normal file
34
BinaryObjectScanner.Test/FileType/MSDOSTests.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class MSDOSTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.MSDOS wrapper
|
||||
= new(new SabreTools.Data.Models.MSDOS.Executable(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new MSDOS(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Empty()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new MSDOS(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.NotNull(actual);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class MicrosoftLZTests
|
||||
{
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyString_False()
|
||||
{
|
||||
string file = string.Empty;
|
||||
string outDir = string.Empty;
|
||||
var extractable = new MicrosoftLZ();
|
||||
|
||||
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 MicrosoftLZ();
|
||||
|
||||
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 MicrosoftLZ();
|
||||
|
||||
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
BinaryObjectScanner.Test/FileType/NewExecutableTests.cs
Normal file
34
BinaryObjectScanner.Test/FileType/NewExecutableTests.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class NewExecutableTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.NewExecutable wrapper
|
||||
= new(new SabreTools.Data.Models.NewExecutable.Executable(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new NewExecutable(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Empty()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new NewExecutable(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.NotNull(actual);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,25 +6,28 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class PLJTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.PlayJAudioFile wrapper
|
||||
= new(new SabreTools.Data.Models.PlayJ.AudioFile(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new PLJ();
|
||||
var detectable = new PLJ(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Null()
|
||||
public void DetectStream_EmptyStream_DefaultValue()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new PLJ();
|
||||
var detectable = new PLJ(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
Assert.Equal("PlayJ Audio File", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
34
BinaryObjectScanner.Test/FileType/PortableExecutableTests.cs
Normal file
34
BinaryObjectScanner.Test/FileType/PortableExecutableTests.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class PortableExecutableTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.PortableExecutable wrapper
|
||||
= new(new SabreTools.Data.Models.PortableExecutable.Executable(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new PortableExecutable(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DetectStream_EmptyStream_Empty()
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new PortableExecutable(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.NotNull(actual);
|
||||
Assert.Empty(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class RealArcadeInstallerTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.RealArcadeInstaller wrapper
|
||||
= new(new SabreTools.Data.Models.RealArcade.RgsFile(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeInstaller();
|
||||
var detectable = new RealArcadeInstaller(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
@@ -21,10 +24,10 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeInstaller();
|
||||
var detectable = new RealArcadeInstaller(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
Assert.Equal("RealArcade Installer", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class RealArcadeMezzanineTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.RealArcadeMezzanine wrapper
|
||||
= new(new SabreTools.Data.Models.RealArcade.Mezzanine(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeMezzanine();
|
||||
var detectable = new RealArcadeMezzanine(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
@@ -21,10 +24,10 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new RealArcadeMezzanine();
|
||||
var detectable = new RealArcadeMezzanine(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
Assert.Equal("RealArcade Mezzanine", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class SFFSTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.SFFS wrapper
|
||||
= new(new SabreTools.Data.Models.StarForce.FileSystem(), new MemoryStream(new byte[1024]));
|
||||
|
||||
[Fact]
|
||||
public void DetectFile_EmptyString_Null()
|
||||
{
|
||||
string file = string.Empty;
|
||||
var detectable = new SFFS();
|
||||
var detectable = new SFFS(wrapper);
|
||||
|
||||
string? actual = detectable.Detect(file, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
@@ -21,45 +24,10 @@ namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
Stream? stream = new MemoryStream();
|
||||
string file = string.Empty;
|
||||
var detectable = new SFFS();
|
||||
var detectable = new SFFS(wrapper);
|
||||
|
||||
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);
|
||||
Assert.Equal("StarForce Filesystem Container", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractAll_EmptyModel_False()
|
||||
{
|
||||
var model = new SabreTools.Models.SGA.Archive();
|
||||
var data = new MemoryStream();
|
||||
var item = new SabreTools.Serialization.Wrappers.SGA(model, data);
|
||||
string outputDirectory = string.Empty;
|
||||
|
||||
bool actual = SGA.ExtractAll(item, outputDirectory);
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtractFile_EmptyModel_False()
|
||||
{
|
||||
var model = new SabreTools.Models.SGA.Archive();
|
||||
var data = new MemoryStream();
|
||||
var item = new SabreTools.Serialization.Wrappers.SGA(model, data);
|
||||
string outputDirectory = string.Empty;
|
||||
|
||||
bool actual = SGA.ExtractFile(item, 0, outputDirectory);
|
||||
Assert.False(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.GameEngine
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new RenderWare();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new ASPack();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new AdvancedInstaller();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new AutoPlayMediaStudio();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CExe();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Packer/CrunchTests.cs
Normal file
22
BinaryObjectScanner.Test/Packer/CrunchTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Packer;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Packer
|
||||
{
|
||||
public class CrunchTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new Crunch();
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new DotFuscator();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new DotNetReactor();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,27 +21,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new EXEStealth();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
BinaryObjectScanner.Test/Packer/EmbeddedFileTests.cs
Normal file
22
BinaryObjectScanner.Test/Packer/EmbeddedFileTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.Packer;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.Packer
|
||||
{
|
||||
public class EmbeddedFileTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new EmbeddedFile();
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new GenteeInstaller();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new HyperTechCrackProof();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
SabreTools.Data.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.NewExecutable exe = new(model, source);
|
||||
|
||||
var checker = new InnoSetup();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
@@ -23,41 +23,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new InnoSetup();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new InstallAnywhere();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new InstallerVISE();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new IntelInstallationFramework();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new MicrosoftCABSFX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new NSIS();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new NeoLite();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new PECompact();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new PEtite();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new SetupFactory();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new SevenZipSFX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new Shrinker();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new UPX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new WinRARSFX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
SabreTools.Data.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.NewExecutable exe = new(model, source);
|
||||
|
||||
var checker = new WinZipSFX();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
@@ -23,41 +23,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new WinZipSFX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckNewExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.NewExecutable nex = new(model, source);
|
||||
SabreTools.Data.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.NewExecutable exe = new(model, source);
|
||||
|
||||
var checker = new WiseInstaller();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
@@ -23,41 +23,13 @@ namespace BinaryObjectScanner.Test.Packer
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new WiseInstaller();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,12 +21,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new ActiveMARK();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new AegiSoft();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new AlphaROM();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,27 +10,13 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new Armadillo();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new ByteShield();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDCheck();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,27 +7,16 @@ 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);
|
||||
SabreTools.Data.Models.NewExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.NewExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDDVDCops();
|
||||
string? actual = checker.CheckExecutable(file, nex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
@@ -35,12 +24,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDDVDCops();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDGuard();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDKey();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDLock();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CDSHiELDSE();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CenegaProtectDVD();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new Channelware();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new ChosenBytesCodeLock();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CopyKiller();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CopyLok();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CopyX();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new CrypKey();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new Cucko();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new Denuvo();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new DigiGuard();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new DiscGuard();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace BinaryObjectScanner.Test.Protection
|
||||
public void CheckPortableExecutableTest()
|
||||
{
|
||||
string file = "filename";
|
||||
SabreTools.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream();
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable pex = new(model, source);
|
||||
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
||||
Stream source = new MemoryStream(new byte[1024]);
|
||||
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
||||
|
||||
var checker = new EAAntiCheat();
|
||||
string? actual = checker.CheckExecutable(file, pex, includeDebug: false);
|
||||
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
||||
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