Skip to content

Commit 08a90d5

Browse files
committed
Update packages
1 parent d41cd63 commit 08a90d5

File tree

99 files changed

+279
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+279
-349
lines changed

BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PrivateAssets>all</PrivateAssets>
1818
</PackageReference>
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
20-
<PackageReference Include="SabreTools.Serialization" Version="1.9.5" />
20+
<PackageReference Include="SabreTools.Serialization" Version="1.9.6" />
2121
<PackageReference Include="xunit" Version="2.9.3" />
2222
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
66
{
77
public class LDSCRYPTTests
88
{
9+
private static readonly SabreTools.Serialization.Wrappers.LDSCRYPT wrapper
10+
= new(new SabreTools.Models.LDSCRYPT.EncryptedFile(), new MemoryStream(new byte[1024]));
11+
912
[Fact]
1013
public void DetectFile_EmptyString_Null()
1114
{
1215
string file = string.Empty;
13-
var detectable = new LDSCRYPT();
16+
var detectable = new LDSCRYPT(wrapper);
1417

1518
string? actual = detectable.Detect(file, includeDebug: false);
1619
Assert.Null(actual);
@@ -21,10 +24,10 @@ public void DetectStream_EmptyStream_Null()
2124
{
2225
Stream? stream = new MemoryStream();
2326
string file = string.Empty;
24-
var detectable = new LDSCRYPT();
27+
var detectable = new LDSCRYPT(wrapper);
2528

2629
string? actual = detectable.Detect(stream, file, includeDebug: false);
27-
Assert.Null(actual);
30+
Assert.Equal("LDSCRYPT", actual);
2831
}
2932
}
3033
}

BinaryObjectScanner.Test/FileType/RealArcadeInstallerTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
66
{
77
public class RealArcadeInstallerTests
88
{
9+
private static readonly SabreTools.Serialization.Wrappers.RealArcadeInstaller wrapper
10+
= new(new SabreTools.Models.RealArcade.RgsFile(), new MemoryStream(new byte[1024]));
11+
912
[Fact]
1013
public void DetectFile_EmptyString_Null()
1114
{
1215
string file = string.Empty;
13-
var detectable = new RealArcadeInstaller();
16+
var detectable = new RealArcadeInstaller(wrapper);
1417

1518
string? actual = detectable.Detect(file, includeDebug: false);
1619
Assert.Null(actual);
@@ -21,10 +24,10 @@ public void DetectStream_EmptyStream_Null()
2124
{
2225
Stream? stream = new MemoryStream();
2326
string file = string.Empty;
24-
var detectable = new RealArcadeInstaller();
27+
var detectable = new RealArcadeInstaller(wrapper);
2528

2629
string? actual = detectable.Detect(stream, file, includeDebug: false);
27-
Assert.Null(actual);
30+
Assert.Equal("RealArcade Installer", actual);
2831
}
2932
}
3033
}

BinaryObjectScanner.Test/FileType/RealArcadeMezzanineTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
66
{
77
public class RealArcadeMezzanineTests
88
{
9+
private static readonly SabreTools.Serialization.Wrappers.RealArcadeMezzanine wrapper
10+
= new(new SabreTools.Models.RealArcade.Mezzanine(), new MemoryStream(new byte[1024]));
11+
912
[Fact]
1013
public void DetectFile_EmptyString_Null()
1114
{
1215
string file = string.Empty;
13-
var detectable = new RealArcadeMezzanine();
16+
var detectable = new RealArcadeMezzanine(wrapper);
1417

1518
string? actual = detectable.Detect(file, includeDebug: false);
1619
Assert.Null(actual);
@@ -21,10 +24,10 @@ public void DetectStream_EmptyStream_Null()
2124
{
2225
Stream? stream = new MemoryStream();
2326
string file = string.Empty;
24-
var detectable = new RealArcadeMezzanine();
27+
var detectable = new RealArcadeMezzanine(wrapper);
2528

2629
string? actual = detectable.Detect(stream, file, includeDebug: false);
27-
Assert.Null(actual);
30+
Assert.Equal("RealArcade Mezzanine", actual);
2831
}
2932
}
3033
}

BinaryObjectScanner.Test/FileType/SFFSTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
66
{
77
public class SFFSTests
88
{
9+
private static readonly SabreTools.Serialization.Wrappers.SFFS wrapper
10+
= new(new SabreTools.Models.StarForce.FileSystem(), new MemoryStream(new byte[1024]));
11+
912
[Fact]
1013
public void DetectFile_EmptyString_Null()
1114
{
1215
string file = string.Empty;
13-
var detectable = new SFFS();
16+
var detectable = new SFFS(wrapper);
1417

1518
string? actual = detectable.Detect(file, includeDebug: false);
1619
Assert.Null(actual);
@@ -21,10 +24,10 @@ public void DetectStream_EmptyStream_Null()
2124
{
2225
Stream? stream = new MemoryStream();
2326
string file = string.Empty;
24-
var detectable = new SFFS();
27+
var detectable = new SFFS(wrapper);
2528

2629
string? actual = detectable.Detect(stream, file, includeDebug: false);
27-
Assert.Null(actual);
30+
Assert.Equal("StarForce Filesystem Container", actual);
2831
}
2932
}
3033
}

BinaryObjectScanner/BinaryObjectScanner.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="SabreTools.Hashing" Version="1.5.0" />
57-
<PackageReference Include="SabreTools.IO" Version="1.7.3" />
58-
<PackageReference Include="SabreTools.Matching" Version="1.6.0" />
59-
<PackageReference Include="SabreTools.Models" Version="1.7.1" />
60-
<PackageReference Include="SabreTools.Serialization" Version="1.9.5" />
57+
<PackageReference Include="SabreTools.IO" Version="1.7.5" />
58+
<PackageReference Include="SabreTools.Models" Version="1.7.2" />
59+
<PackageReference Include="SabreTools.Serialization" Version="1.9.6" />
6160
<PackageReference Include="SharpCompress" Version="0.40.0" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))" />
6261
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.9" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))" />
6362
</ItemGroup>
Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
1-
using System;
2-
using System.IO;
3-
using SabreTools.IO.Extensions;
4-
using SabreTools.Matching;
1+
using System.IO;
52

63
namespace BinaryObjectScanner.FileType
74
{
85
/// <summary>
96
/// Link Data Security encrypted file
107
/// </summary>
11-
public class LDSCRYPT : DetectableBase
8+
public class LDSCRYPT : DetectableBase<SabreTools.Serialization.Wrappers.LDSCRYPT>
129
{
1310
/// <inheritdoc/>
14-
public override string? Detect(Stream stream, string file, bool includeDebug)
15-
{
16-
try
17-
{
18-
int bytesToRead = (int)Math.Min(16, stream.Length);
19-
byte[] magic = stream.ReadBytes(bytesToRead);
20-
21-
if (magic.StartsWith(new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 }))
22-
return "Link Data Security encrypted file";
23-
}
24-
catch (Exception ex)
25-
{
26-
if (includeDebug) Console.Error.WriteLine(ex);
27-
}
11+
public LDSCRYPT(SabreTools.Serialization.Wrappers.LDSCRYPT wrapper) : base(wrapper) { }
2812

29-
return null;
30-
}
13+
/// <inheritdoc/>
14+
public override string? Detect(Stream stream, string file, bool includeDebug)
15+
=> "LDSCRYPT";
3116
}
3217
}
Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.IO;
3-
using SabreTools.IO.Extensions;
4-
using SabreTools.Matching;
1+
using System.IO;
52

63
namespace BinaryObjectScanner.FileType
74
{
@@ -10,27 +7,13 @@ namespace BinaryObjectScanner.FileType
107
///
118
/// TODO: Add further parsing, game ID and name should be possible to parse.
129
/// </summary>
13-
public class RealArcadeInstaller : DetectableBase
10+
public class RealArcadeInstaller : DetectableBase<SabreTools.Serialization.Wrappers.RealArcadeInstaller>
1411
{
1512
/// <inheritdoc/>
16-
public override string? Detect(Stream stream, string file, bool includeDebug)
17-
{
18-
try
19-
{
20-
int bytesToRead = (int)Math.Min(16, stream.Length);
21-
byte[] magic = stream.ReadBytes(bytesToRead);
22-
23-
// RASGI2.0
24-
// Found in the ".rgs" files in IA item "Nova_RealArcadeCD_USA".
25-
if (magic.StartsWith(new byte?[] { 0x52, 0x41, 0x53, 0x47, 0x49, 0x32, 0x2E, 0x30 }))
26-
return "RealArcade Installer";
27-
}
28-
catch (Exception ex)
29-
{
30-
if (includeDebug) Console.Error.WriteLine(ex);
31-
}
13+
public RealArcadeInstaller(SabreTools.Serialization.Wrappers.RealArcadeInstaller wrapper) : base(wrapper) { }
3214

33-
return null;
34-
}
15+
/// <inheritdoc/>
16+
public override string? Detect(Stream stream, string file, bool includeDebug)
17+
=> "RealArcade Installer";
3518
}
3619
}
Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.IO;
3-
using SabreTools.IO.Extensions;
4-
using SabreTools.Matching;
1+
using System.IO;
52

63
namespace BinaryObjectScanner.FileType
74
{
@@ -10,27 +7,13 @@ namespace BinaryObjectScanner.FileType
107
///
118
/// TODO: Add further parsing, game ID should be possible to parse.
129
/// </summary>
13-
public class RealArcadeMezzanine : DetectableBase
10+
public class RealArcadeMezzanine : DetectableBase<SabreTools.Serialization.Wrappers.RealArcadeMezzanine>
1411
{
1512
/// <inheritdoc/>
16-
public override string? Detect(Stream stream, string file, bool includeDebug)
17-
{
18-
try
19-
{
20-
int bytesToRead = (int)Math.Min(16, stream.Length);
21-
byte[] magic = stream.ReadBytes(bytesToRead);
22-
23-
// XZip2.0
24-
// Found in the ".mez" files in IA item "Nova_RealArcadeCD_USA".
25-
if (magic.StartsWith(new byte?[] { 0x58, 0x5A, 0x69, 0x70, 0x32, 0x2E, 0x30 }))
26-
return "RealArcade Mezzanine";
27-
}
28-
catch (Exception ex)
29-
{
30-
if (includeDebug) Console.Error.WriteLine(ex);
31-
}
13+
public RealArcadeMezzanine(SabreTools.Serialization.Wrappers.RealArcadeMezzanine wrapper) : base(wrapper) { }
3214

33-
return null;
34-
}
15+
/// <inheritdoc/>
16+
public override string? Detect(Stream stream, string file, bool includeDebug)
17+
=> "RealArcade Mezzanine";
3518
}
3619
}
Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.IO;
3-
using SabreTools.IO.Extensions;
4-
using SabreTools.Matching;
1+
using System.IO;
52

63
namespace BinaryObjectScanner.FileType
74
{
@@ -10,25 +7,13 @@ namespace BinaryObjectScanner.FileType
107
/// </summary>
118
/// <see href="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
129
/// TODO: Implement extraction
13-
public class SFFS : DetectableBase
10+
public class SFFS : DetectableBase<SabreTools.Serialization.Wrappers.SFFS>
1411
{
1512
/// <inheritdoc/>
16-
public override string? Detect(Stream stream, string file, bool includeDebug)
17-
{
18-
try
19-
{
20-
int bytesToRead = (int)Math.Min(16, stream.Length);
21-
byte[] magic = stream.ReadBytes(bytesToRead);
22-
23-
if (magic.StartsWith(new byte?[] { 0x53, 0x46, 0x46, 0x53 }))
24-
return "StarForce Filesystem Container";
25-
}
26-
catch (Exception ex)
27-
{
28-
if (includeDebug) Console.Error.WriteLine(ex);
29-
}
13+
public SFFS(SabreTools.Serialization.Wrappers.SFFS wrapper) : base(wrapper) { }
3014

31-
return null;
32-
}
15+
/// <inheritdoc/>
16+
public override string? Detect(Stream stream, string file, bool includeDebug)
17+
=> "StarForce Filesystem Container";
3318
}
3419
}

0 commit comments

Comments
 (0)