diff --git a/BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj b/BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj
index 6a029b1e..52fe1dcc 100644
--- a/BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj
+++ b/BinaryObjectScanner.Test/BinaryObjectScanner.Test.csproj
@@ -17,7 +17,7 @@
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs b/BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs
index 93e59b17..7fe753b9 100644
--- a/BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs
+++ b/BinaryObjectScanner.Test/FileType/LDSCRYPTTests.cs
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
{
public class LDSCRYPTTests
{
+ private static readonly SabreTools.Serialization.Wrappers.LDSCRYPT wrapper
+ = new(new SabreTools.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);
}
}
}
diff --git a/BinaryObjectScanner.Test/FileType/RealArcadeInstallerTests.cs b/BinaryObjectScanner.Test/FileType/RealArcadeInstallerTests.cs
index 91a7d192..a7313108 100644
--- a/BinaryObjectScanner.Test/FileType/RealArcadeInstallerTests.cs
+++ b/BinaryObjectScanner.Test/FileType/RealArcadeInstallerTests.cs
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
{
public class RealArcadeInstallerTests
{
+ private static readonly SabreTools.Serialization.Wrappers.RealArcadeInstaller wrapper
+ = new(new SabreTools.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);
}
}
}
diff --git a/BinaryObjectScanner.Test/FileType/RealArcadeMezzanineTests.cs b/BinaryObjectScanner.Test/FileType/RealArcadeMezzanineTests.cs
index 3e0083e2..e4e40518 100644
--- a/BinaryObjectScanner.Test/FileType/RealArcadeMezzanineTests.cs
+++ b/BinaryObjectScanner.Test/FileType/RealArcadeMezzanineTests.cs
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
{
public class RealArcadeMezzanineTests
{
+ private static readonly SabreTools.Serialization.Wrappers.RealArcadeMezzanine wrapper
+ = new(new SabreTools.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);
}
}
}
diff --git a/BinaryObjectScanner.Test/FileType/SFFSTests.cs b/BinaryObjectScanner.Test/FileType/SFFSTests.cs
index c9c4e719..c0f147ab 100644
--- a/BinaryObjectScanner.Test/FileType/SFFSTests.cs
+++ b/BinaryObjectScanner.Test/FileType/SFFSTests.cs
@@ -6,11 +6,14 @@ namespace BinaryObjectScanner.Test.FileType
{
public class SFFSTests
{
+ private static readonly SabreTools.Serialization.Wrappers.SFFS wrapper
+ = new(new SabreTools.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,10 +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);
+ Assert.Equal("StarForce Filesystem Container", actual);
}
}
}
diff --git a/BinaryObjectScanner/BinaryObjectScanner.csproj b/BinaryObjectScanner/BinaryObjectScanner.csproj
index 2c360bab..e1cd7240 100644
--- a/BinaryObjectScanner/BinaryObjectScanner.csproj
+++ b/BinaryObjectScanner/BinaryObjectScanner.csproj
@@ -54,10 +54,9 @@
-
-
-
-
+
+
+
diff --git a/BinaryObjectScanner/FileType/LDSCRYPT.cs b/BinaryObjectScanner/FileType/LDSCRYPT.cs
index a0465167..c2197382 100644
--- a/BinaryObjectScanner/FileType/LDSCRYPT.cs
+++ b/BinaryObjectScanner/FileType/LDSCRYPT.cs
@@ -1,32 +1,17 @@
-using System;
-using System.IO;
-using SabreTools.IO.Extensions;
-using SabreTools.Matching;
+using System.IO;
namespace BinaryObjectScanner.FileType
{
///
/// Link Data Security encrypted file
///
- public class LDSCRYPT : DetectableBase
+ public class LDSCRYPT : DetectableBase
{
+ ///
+ public LDSCRYPT(SabreTools.Serialization.Wrappers.LDSCRYPT wrapper) : base(wrapper) { }
+
///
public override string? Detect(Stream stream, string file, bool includeDebug)
- {
- try
- {
- int bytesToRead = (int)Math.Min(16, stream.Length);
- byte[] magic = stream.ReadBytes(bytesToRead);
-
- if (magic.StartsWith(new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 }))
- return "Link Data Security encrypted file";
- }
- catch (Exception ex)
- {
- if (includeDebug) Console.Error.WriteLine(ex);
- }
-
- return null;
- }
+ => "LDSCRYPT";
}
}
diff --git a/BinaryObjectScanner/FileType/RealArcadeInstaller.cs b/BinaryObjectScanner/FileType/RealArcadeInstaller.cs
index 66c5aec5..54402507 100644
--- a/BinaryObjectScanner/FileType/RealArcadeInstaller.cs
+++ b/BinaryObjectScanner/FileType/RealArcadeInstaller.cs
@@ -1,7 +1,4 @@
-using System;
-using System.IO;
-using SabreTools.IO.Extensions;
-using SabreTools.Matching;
+using System.IO;
namespace BinaryObjectScanner.FileType
{
@@ -10,27 +7,13 @@ namespace BinaryObjectScanner.FileType
///
/// TODO: Add further parsing, game ID and name should be possible to parse.
///
- public class RealArcadeInstaller : DetectableBase
+ public class RealArcadeInstaller : DetectableBase
{
+ ///
+ public RealArcadeInstaller(SabreTools.Serialization.Wrappers.RealArcadeInstaller wrapper) : base(wrapper) { }
+
///
public override string? Detect(Stream stream, string file, bool includeDebug)
- {
- try
- {
- int bytesToRead = (int)Math.Min(16, stream.Length);
- byte[] magic = stream.ReadBytes(bytesToRead);
-
- // RASGI2.0
- // Found in the ".rgs" files in IA item "Nova_RealArcadeCD_USA".
- if (magic.StartsWith(new byte?[] { 0x52, 0x41, 0x53, 0x47, 0x49, 0x32, 0x2E, 0x30 }))
- return "RealArcade Installer";
- }
- catch (Exception ex)
- {
- if (includeDebug) Console.Error.WriteLine(ex);
- }
-
- return null;
- }
+ => "RealArcade Installer";
}
}
diff --git a/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs b/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs
index b9d65644..16a32480 100644
--- a/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs
+++ b/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs
@@ -1,7 +1,4 @@
-using System;
-using System.IO;
-using SabreTools.IO.Extensions;
-using SabreTools.Matching;
+using System.IO;
namespace BinaryObjectScanner.FileType
{
@@ -10,27 +7,13 @@ namespace BinaryObjectScanner.FileType
///
/// TODO: Add further parsing, game ID should be possible to parse.
///
- public class RealArcadeMezzanine : DetectableBase
+ public class RealArcadeMezzanine : DetectableBase
{
+ ///
+ public RealArcadeMezzanine(SabreTools.Serialization.Wrappers.RealArcadeMezzanine wrapper) : base(wrapper) { }
+
///
public override string? Detect(Stream stream, string file, bool includeDebug)
- {
- try
- {
- int bytesToRead = (int)Math.Min(16, stream.Length);
- byte[] magic = stream.ReadBytes(bytesToRead);
-
- // XZip2.0
- // Found in the ".mez" files in IA item "Nova_RealArcadeCD_USA".
- if (magic.StartsWith(new byte?[] { 0x58, 0x5A, 0x69, 0x70, 0x32, 0x2E, 0x30 }))
- return "RealArcade Mezzanine";
- }
- catch (Exception ex)
- {
- if (includeDebug) Console.Error.WriteLine(ex);
- }
-
- return null;
- }
+ => "RealArcade Mezzanine";
}
}
diff --git a/BinaryObjectScanner/FileType/SFFS.cs b/BinaryObjectScanner/FileType/SFFS.cs
index 7671a55a..2cc66aa4 100644
--- a/BinaryObjectScanner/FileType/SFFS.cs
+++ b/BinaryObjectScanner/FileType/SFFS.cs
@@ -1,7 +1,4 @@
-using System;
-using System.IO;
-using SabreTools.IO.Extensions;
-using SabreTools.Matching;
+using System.IO;
namespace BinaryObjectScanner.FileType
{
@@ -10,25 +7,13 @@ namespace BinaryObjectScanner.FileType
///
///
/// TODO: Implement extraction
- public class SFFS : DetectableBase
+ public class SFFS : DetectableBase
{
+ ///
+ public SFFS(SabreTools.Serialization.Wrappers.SFFS wrapper) : base(wrapper) { }
+
///
public override string? Detect(Stream stream, string file, bool includeDebug)
- {
- try
- {
- int bytesToRead = (int)Math.Min(16, stream.Length);
- byte[] magic = stream.ReadBytes(bytesToRead);
-
- if (magic.StartsWith(new byte?[] { 0x53, 0x46, 0x46, 0x53 }))
- return "StarForce Filesystem Container";
- }
- catch (Exception ex)
- {
- if (includeDebug) Console.Error.WriteLine(ex);
- }
-
- return null;
- }
+ => "StarForce Filesystem Container";
}
}
diff --git a/BinaryObjectScanner/Packer/ASPack.cs b/BinaryObjectScanner/Packer/ASPack.cs
index cb5f4419..4e28510f 100644
--- a/BinaryObjectScanner/Packer/ASPack.cs
+++ b/BinaryObjectScanner/Packer/ASPack.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/CExe.cs b/BinaryObjectScanner/Packer/CExe.cs
index eedcdb56..59012265 100644
--- a/BinaryObjectScanner/Packer/CExe.cs
+++ b/BinaryObjectScanner/Packer/CExe.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/DotNetReactor.cs b/BinaryObjectScanner/Packer/DotNetReactor.cs
index 973eaf54..d60ddc2e 100644
--- a/BinaryObjectScanner/Packer/DotNetReactor.cs
+++ b/BinaryObjectScanner/Packer/DotNetReactor.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/EXEStealth.cs b/BinaryObjectScanner/Packer/EXEStealth.cs
index ba2251ee..f11878a9 100644
--- a/BinaryObjectScanner/Packer/EXEStealth.cs
+++ b/BinaryObjectScanner/Packer/EXEStealth.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/EmbeddedFile.cs b/BinaryObjectScanner/Packer/EmbeddedFile.cs
index 7d932933..2bcac1cd 100644
--- a/BinaryObjectScanner/Packer/EmbeddedFile.cs
+++ b/BinaryObjectScanner/Packer/EmbeddedFile.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/GhostInstaller.cs b/BinaryObjectScanner/Packer/GhostInstaller.cs
index 95c43eed..e35b5a93 100644
--- a/BinaryObjectScanner/Packer/GhostInstaller.cs
+++ b/BinaryObjectScanner/Packer/GhostInstaller.cs
@@ -1,5 +1,5 @@
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
+using SabreTools.IO.Extensions;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/HyperTechCrackProof.cs b/BinaryObjectScanner/Packer/HyperTechCrackProof.cs
index 99a2ad29..08741649 100644
--- a/BinaryObjectScanner/Packer/HyperTechCrackProof.cs
+++ b/BinaryObjectScanner/Packer/HyperTechCrackProof.cs
@@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Packer
{
// This check may be overly limiting, as it excludes the sample provided to DiE (https://github.com/horsicq/Detect-It-Easy/issues/102).
// TODO: Find further samples and invesitgate if the "peC" section is only present on specific versions.
- bool importTableMatch = Array.Exists(exe.ImportTable?.ImportDirectoryTable ?? [],
+ bool importTableMatch = Array.Exists(exe.ImportDirectoryTable ?? [],
idte => idte.Name == "KeRnEl32.dLl");
if (exe.ContainsSection("peC", exact: true) && importTableMatch)
diff --git a/BinaryObjectScanner/Packer/InnoSetup.cs b/BinaryObjectScanner/Packer/InnoSetup.cs
index ea02b531..f667e458 100644
--- a/BinaryObjectScanner/Packer/InnoSetup.cs
+++ b/BinaryObjectScanner/Packer/InnoSetup.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/ReflexiveArcadeInstaller.cs b/BinaryObjectScanner/Packer/ReflexiveArcadeInstaller.cs
index 381f9918..ee3fb4d4 100644
--- a/BinaryObjectScanner/Packer/ReflexiveArcadeInstaller.cs
+++ b/BinaryObjectScanner/Packer/ReflexiveArcadeInstaller.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Packer
diff --git a/BinaryObjectScanner/Packer/WinZipSFX.cs b/BinaryObjectScanner/Packer/WinZipSFX.cs
index 0e8a4cce..7bdbc03a 100644
--- a/BinaryObjectScanner/Packer/WinZipSFX.cs
+++ b/BinaryObjectScanner/Packer/WinZipSFX.cs
@@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Packer
public string? CheckExecutable(string file, PortableExecutable exe, bool includeDebug)
{
// Check the export directory table, if it exists
- if (exe.ExportTable?.ExportDirectoryTable != null)
+ if (exe.ExportDirectoryTable != null)
{
var version = GetPEExportDirectoryVersion(exe);
if (!string.IsNullOrEmpty(version))
@@ -621,8 +621,8 @@ namespace BinaryObjectScanner.Packer
/// TODO: Research to see if the versions are embedded elsewhere in these files
private static string? GetPEExportDirectoryVersion(PortableExecutable exe)
{
- string sfxFileName = exe.ExportTable?.ExportDirectoryTable?.Name ?? string.Empty;
- uint sfxTimeDateStamp = exe.ExportTable?.ExportDirectoryTable?.TimeDateStamp ?? uint.MaxValue;
+ string sfxFileName = exe.ExportDirectoryTable?.Name ?? string.Empty;
+ uint sfxTimeDateStamp = exe.ExportDirectoryTable?.TimeDateStamp ?? uint.MaxValue;
string assemblyVersion = exe.AssemblyVersion ?? "Unknown Version";
// Standard
diff --git a/BinaryObjectScanner/Protection/ActiveMARK.cs b/BinaryObjectScanner/Protection/ActiveMARK.cs
index b92a1246..f11e99de 100644
--- a/BinaryObjectScanner/Protection/ActiveMARK.cs
+++ b/BinaryObjectScanner/Protection/ActiveMARK.cs
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Text;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Extensions;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/AegiSoft.cs b/BinaryObjectScanner/Protection/AegiSoft.cs
index 1725396a..0a66c6cf 100644
--- a/BinaryObjectScanner/Protection/AegiSoft.cs
+++ b/BinaryObjectScanner/Protection/AegiSoft.cs
@@ -1,8 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/AlphaDVD.cs b/BinaryObjectScanner/Protection/AlphaDVD.cs
index bded0e7d..64c9686c 100644
--- a/BinaryObjectScanner/Protection/AlphaDVD.cs
+++ b/BinaryObjectScanner/Protection/AlphaDVD.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/Bitpool.cs b/BinaryObjectScanner/Protection/Bitpool.cs
index 528fa633..c77336d8 100644
--- a/BinaryObjectScanner/Protection/Bitpool.cs
+++ b/BinaryObjectScanner/Protection/Bitpool.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/ByteShield.cs b/BinaryObjectScanner/Protection/ByteShield.cs
index 69331c64..957a22c3 100644
--- a/BinaryObjectScanner/Protection/ByteShield.cs
+++ b/BinaryObjectScanner/Protection/ByteShield.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -67,7 +67,7 @@ namespace BinaryObjectScanner.Protection
if (name.OptionalEquals("ByteShield Client"))
return $"ByteShield Activation Client {exe.GetInternalVersion()}";
- name = exe.ExportTable?.ExportDirectoryTable?.Name;
+ name = exe.ExportDirectoryTable?.Name;
// Found in "ByteShield.dll" in Redump entry 6236
if (name.OptionalEquals("ByteShield Client"))
diff --git a/BinaryObjectScanner/Protection/CDDVDCops.cs b/BinaryObjectScanner/Protection/CDDVDCops.cs
index a990936e..a41a6bf7 100644
--- a/BinaryObjectScanner/Protection/CDDVDCops.cs
+++ b/BinaryObjectScanner/Protection/CDDVDCops.cs
@@ -3,10 +3,9 @@ using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/CDGuard.cs b/BinaryObjectScanner/Protection/CDGuard.cs
index 5bdae6e0..25dde39c 100644
--- a/BinaryObjectScanner/Protection/CDGuard.cs
+++ b/BinaryObjectScanner/Protection/CDGuard.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -29,19 +29,19 @@ namespace BinaryObjectScanner.Protection
// TODO: Investigate the numerous ".guard" sections present in "Randevu.exe" in Redump entry 97142.
// Get the export directory table
- if (exe.ExportTable?.ExportDirectoryTable != null)
+ if (exe.ExportDirectoryTable != null)
{
// Found in "cdguard.dll" in Redump entry 97142 and IA item "pahgeby-he3hakomkou".
- bool match = exe.ExportTable.ExportDirectoryTable.Name.OptionalEquals("cdguard.dll", StringComparison.OrdinalIgnoreCase);
+ bool match = exe.ExportDirectoryTable.Name.OptionalEquals("cdguard.dll", StringComparison.OrdinalIgnoreCase);
if (match)
return "CD-Guard Copy Protection System";
}
// Get the import directory table
- if (exe.ImportTable?.ImportDirectoryTable != null)
+ if (exe.ImportDirectoryTable != null)
{
// Found in "Randevu.exe" in Redump entry 97142.
- bool match = Array.Exists(exe.ImportTable.ImportDirectoryTable, idte => idte?.Name != null && idte.Name.Equals("cdguard.dll", StringComparison.OrdinalIgnoreCase));
+ bool match = Array.Exists(exe.ImportDirectoryTable, idte => idte?.Name != null && idte.Name.Equals("cdguard.dll", StringComparison.OrdinalIgnoreCase));
if (match)
return "CD-Guard Copy Protection System";
}
diff --git a/BinaryObjectScanner/Protection/CDLock.cs b/BinaryObjectScanner/Protection/CDLock.cs
index 7f039769..00bcb897 100644
--- a/BinaryObjectScanner/Protection/CDLock.cs
+++ b/BinaryObjectScanner/Protection/CDLock.cs
@@ -1,8 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/CDProtector.cs b/BinaryObjectScanner/Protection/CDProtector.cs
index 1647d076..98e39cd6 100644
--- a/BinaryObjectScanner/Protection/CDProtector.cs
+++ b/BinaryObjectScanner/Protection/CDProtector.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/CDSHiELDSE.cs b/BinaryObjectScanner/Protection/CDSHiELDSE.cs
index eaf9c4eb..c608632f 100644
--- a/BinaryObjectScanner/Protection/CDSHiELDSE.cs
+++ b/BinaryObjectScanner/Protection/CDSHiELDSE.cs
@@ -10,9 +10,9 @@ namespace BinaryObjectScanner.Protection
{
// TODO: Indicates Hypertech Crack Proof as well?
//// Get the import directory table
- //if (exe.ImportTable?.ImportDirectoryTable != null)
+ //if (exe.ImportDirectoryTable != null)
//{
- // bool match = exe.ImportTable.ImportDirectoryTable.Any(idte => idte.Name == "KeRnEl32.dLl");
+ // bool match = exe.ImportDirectoryTable.Any(idte => idte.Name == "KeRnEl32.dLl");
// if (match)
// return "CDSHiELD SE";
//}
diff --git a/BinaryObjectScanner/Protection/CDX.cs b/BinaryObjectScanner/Protection/CDX.cs
index 27337af0..810c01f2 100644
--- a/BinaryObjectScanner/Protection/CDX.cs
+++ b/BinaryObjectScanner/Protection/CDX.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/CactusDataShield.cs b/BinaryObjectScanner/Protection/CactusDataShield.cs
index 7d36ae45..c34b87a1 100644
--- a/BinaryObjectScanner/Protection/CactusDataShield.cs
+++ b/BinaryObjectScanner/Protection/CactusDataShield.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/CenegaProtectDVD.cs b/BinaryObjectScanner/Protection/CenegaProtectDVD.cs
index 3bccbf0a..dd2f2a51 100644
--- a/BinaryObjectScanner/Protection/CenegaProtectDVD.cs
+++ b/BinaryObjectScanner/Protection/CenegaProtectDVD.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -19,10 +19,10 @@ namespace BinaryObjectScanner.Protection
public string? CheckExecutable(string file, PortableExecutable exe, bool includeDebug)
{
// Get the export directory table
- if (exe.ExportTable?.ExportDirectoryTable != null)
+ if (exe.ExportDirectoryTable != null)
{
// Found in "cenega.dll" in IA item "speed-pack".
- bool match = exe.ExportTable.ExportDirectoryTable.Name.OptionalEquals("ProtectDVD.dll", StringComparison.OrdinalIgnoreCase);
+ bool match = exe.ExportDirectoryTable.Name.OptionalEquals("ProtectDVD.dll", StringComparison.OrdinalIgnoreCase);
if (match)
return "Cenega ProtectDVD";
}
diff --git a/BinaryObjectScanner/Protection/Channelware.cs b/BinaryObjectScanner/Protection/Channelware.cs
index 29f4ed34..2893946a 100644
--- a/BinaryObjectScanner/Protection/Channelware.cs
+++ b/BinaryObjectScanner/Protection/Channelware.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs b/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs
index 9fe08220..173d01e9 100644
--- a/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs
+++ b/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/CopyKiller.cs b/BinaryObjectScanner/Protection/CopyKiller.cs
index d610ee0f..5ed40045 100644
--- a/BinaryObjectScanner/Protection/CopyKiller.cs
+++ b/BinaryObjectScanner/Protection/CopyKiller.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/CopyX.cs b/BinaryObjectScanner/Protection/CopyX.cs
index 0abdb441..4223faa2 100644
--- a/BinaryObjectScanner/Protection/CopyX.cs
+++ b/BinaryObjectScanner/Protection/CopyX.cs
@@ -2,10 +2,9 @@ using System;
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/CrypKey.cs b/BinaryObjectScanner/Protection/CrypKey.cs
index f8fcf68a..ad13e26b 100644
--- a/BinaryObjectScanner/Protection/CrypKey.cs
+++ b/BinaryObjectScanner/Protection/CrypKey.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Cucko.cs b/BinaryObjectScanner/Protection/Cucko.cs
index a2759d01..ddeb1188 100644
--- a/BinaryObjectScanner/Protection/Cucko.cs
+++ b/BinaryObjectScanner/Protection/Cucko.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/DVDCrypt.cs b/BinaryObjectScanner/Protection/DVDCrypt.cs
index a2a7d701..780929a7 100644
--- a/BinaryObjectScanner/Protection/DVDCrypt.cs
+++ b/BinaryObjectScanner/Protection/DVDCrypt.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/Denuvo.cs b/BinaryObjectScanner/Protection/Denuvo.cs
index 74fdc4cf..fd905582 100644
--- a/BinaryObjectScanner/Protection/Denuvo.cs
+++ b/BinaryObjectScanner/Protection/Denuvo.cs
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
-using OHMN = SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber;
+using OHMN = SabreTools.Models.COFF.OptionalHeaderMagicNumber;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/DigiGuard.cs b/BinaryObjectScanner/Protection/DigiGuard.cs
index 004807d1..ded37505 100644
--- a/BinaryObjectScanner/Protection/DigiGuard.cs
+++ b/BinaryObjectScanner/Protection/DigiGuard.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/DinamicMultimedia.cs b/BinaryObjectScanner/Protection/DinamicMultimedia.cs
index 41500337..7ede9271 100644
--- a/BinaryObjectScanner/Protection/DinamicMultimedia.cs
+++ b/BinaryObjectScanner/Protection/DinamicMultimedia.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/DiscGuard.cs b/BinaryObjectScanner/Protection/DiscGuard.cs
index 0c3fadf2..b1814fbc 100644
--- a/BinaryObjectScanner/Protection/DiscGuard.cs
+++ b/BinaryObjectScanner/Protection/DiscGuard.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/EAAntiCheat.cs b/BinaryObjectScanner/Protection/EAAntiCheat.cs
index e838a3a0..e830ab3a 100644
--- a/BinaryObjectScanner/Protection/EAAntiCheat.cs
+++ b/BinaryObjectScanner/Protection/EAAntiCheat.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/EasyAntiCheat.cs b/BinaryObjectScanner/Protection/EasyAntiCheat.cs
index 2880328d..f3faeb52 100644
--- a/BinaryObjectScanner/Protection/EasyAntiCheat.cs
+++ b/BinaryObjectScanner/Protection/EasyAntiCheat.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Engine32.cs b/BinaryObjectScanner/Protection/Engine32.cs
index 416beb8c..b34954cc 100644
--- a/BinaryObjectScanner/Protection/Engine32.cs
+++ b/BinaryObjectScanner/Protection/Engine32.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -20,11 +20,11 @@ namespace BinaryObjectScanner.Protection
// Most every tested sample of "engine32.dll" has a product name of "engine32", and the file description typically follows the naming pattern of "[Game Name] DLL-helper".
// Detects Engine32 within the game executables that contain it.
- if (exe.ImportTable?.ImportDirectoryTable != null && exe.ImportTable?.HintNameTable != null)
+ if (exe.ImportDirectoryTable != null && exe.ImportHintNameTable != null)
{
- bool importDirectoryTableMatch = Array.Exists(exe.ImportTable.ImportDirectoryTable,
+ bool importDirectoryTableMatch = Array.Exists(exe.ImportDirectoryTable,
idte => idte?.Name != null && idte.Name.Equals("ENGINE32.DLL", StringComparison.OrdinalIgnoreCase));
- bool hintNameTableMatch = Array.Exists(exe.ImportTable.HintNameTable,
+ bool hintNameTableMatch = Array.Exists(exe.ImportHintNameTable,
ihne => ihne?.Name == "InitEngine");
// The Hint/Name Table Entry "DeinitEngine" is present in every tested sample, aside from TOCA Race Driver 2 (Redump entries 104593-104596).
@@ -33,10 +33,10 @@ namespace BinaryObjectScanner.Protection
}
// Detects Engine32 within the file "engine32.dll".
- if (exe.ExportTable?.ExportNameTable?.Strings != null)
+ if (exe.ExportNameTable?.Strings != null)
{
- bool exportNameTableMatch1 = Array.Exists(exe.ExportTable.ExportNameTable.Strings, s => s == "engine32.dll");
- bool exportNameTableMatch2 = Array.Exists(exe.ExportTable.ExportNameTable.Strings, s => s == "DeinitEngine");
+ bool exportNameTableMatch1 = Array.Exists(exe.ExportNameTable.Strings, s => s == "engine32.dll");
+ bool exportNameTableMatch2 = Array.Exists(exe.ExportNameTable.Strings, s => s == "DeinitEngine");
if (exportNameTableMatch1 && exportNameTableMatch2)
return "Engine32";
diff --git a/BinaryObjectScanner/Protection/FreeLock.cs b/BinaryObjectScanner/Protection/FreeLock.cs
index 1adc6e83..a05d166f 100644
--- a/BinaryObjectScanner/Protection/FreeLock.cs
+++ b/BinaryObjectScanner/Protection/FreeLock.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/GFWL.cs b/BinaryObjectScanner/Protection/GFWL.cs
index 9bce55b7..1edf8819 100644
--- a/BinaryObjectScanner/Protection/GFWL.cs
+++ b/BinaryObjectScanner/Protection/GFWL.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -22,9 +22,9 @@ namespace BinaryObjectScanner.Protection
return $"Games for Windows LIVE {exe.GetInternalVersion()}";
// Get the import directory table
- if (exe.ImportTable?.ImportDirectoryTable != null)
+ if (exe.ImportDirectoryTable != null)
{
- if (Array.Exists(exe.ImportTable.ImportDirectoryTable, idte => idte?.Name == "xlive.dll"))
+ if (Array.Exists(exe.ImportDirectoryTable, idte => idte?.Name == "xlive.dll"))
return "Games for Windows LIVE";
}
diff --git a/BinaryObjectScanner/Protection/Gefest.cs b/BinaryObjectScanner/Protection/Gefest.cs
index df75018d..81b39195 100644
--- a/BinaryObjectScanner/Protection/Gefest.cs
+++ b/BinaryObjectScanner/Protection/Gefest.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/HexalockAutoLock.cs b/BinaryObjectScanner/Protection/HexalockAutoLock.cs
index be94ce27..d89b0057 100644
--- a/BinaryObjectScanner/Protection/HexalockAutoLock.cs
+++ b/BinaryObjectScanner/Protection/HexalockAutoLock.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/HudsonHuPPPX.cs b/BinaryObjectScanner/Protection/HudsonHuPPPX.cs
index a6239743..4fdfcb93 100644
--- a/BinaryObjectScanner/Protection/HudsonHuPPPX.cs
+++ b/BinaryObjectScanner/Protection/HudsonHuPPPX.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -20,17 +20,13 @@ namespace BinaryObjectScanner.Protection
///
public string? CheckExecutable(string file, PortableExecutable exe, bool includeDebug)
{
- var exportTable = exe.ExportTable;
- if (exportTable != null)
- {
- // Found in Bomberman Vol 2 (Japan)
- if (exportTable.ExportDirectoryTable?.Name == "HVCDISSR.DLL")
- return "Hudson huPPPX";
+ // Found in Bomberman Vol 2 (Japan)
+ if (exe.ExportDirectoryTable?.Name == "HVCDISSR.DLL")
+ return "Hudson huPPPX";
- // Found in Bomberman Vol 2 (Japan)
- if (Array.Exists(exportTable.ExportNameTable?.Strings ?? [], s => s.StartsWith("HVRCD_IS_")))
- return "Hudson huPPPX";
- }
+ // Found in Bomberman Vol 2 (Japan)
+ if (Array.Exists(exe.ExportNameTable?.Strings ?? [], s => s.StartsWith("HVRCD_IS_")))
+ return "Hudson huPPPX";
return null;
}
diff --git a/BinaryObjectScanner/Protection/ImpulseReactor.cs b/BinaryObjectScanner/Protection/ImpulseReactor.cs
index 8c2c3e29..ced0b200 100644
--- a/BinaryObjectScanner/Protection/ImpulseReactor.cs
+++ b/BinaryObjectScanner/Protection/ImpulseReactor.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -33,8 +33,8 @@ namespace BinaryObjectScanner.Protection
// TODO: Check for CVP* instead?
bool containsCheck = false;
- if (exe.ExportTable?.ExportNameTable?.Strings != null)
- containsCheck = Array.Exists(exe.ExportTable.ExportNameTable.Strings, s => s.OptionalStartsWith("CVPInitializeClient"));
+ if (exe.ExportNameTable?.Strings != null)
+ containsCheck = Array.Exists(exe.ExportNameTable.Strings, s => s.OptionalStartsWith("CVPInitializeClient"));
// Get the .rdata section strings, if they exist
bool containsCheck2 = false;
diff --git a/BinaryObjectScanner/Protection/IndyVCD.cs b/BinaryObjectScanner/Protection/IndyVCD.cs
index dca172d0..b6978260 100644
--- a/BinaryObjectScanner/Protection/IndyVCD.cs
+++ b/BinaryObjectScanner/Protection/IndyVCD.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/JoWood.cs b/BinaryObjectScanner/Protection/JoWood.cs
index 77eafa77..5dc50205 100644
--- a/BinaryObjectScanner/Protection/JoWood.cs
+++ b/BinaryObjectScanner/Protection/JoWood.cs
@@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Text;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -19,8 +19,8 @@ namespace BinaryObjectScanner.Protection
// Get the .ext section, if it exists
if (exe.ContainsSection(".ext ", exact: true))
{
- bool importTableMatches = Array.Exists(exe.ImportTable?.ImportDirectoryTable ?? [], idte => idte?.Name == "kernel32.dll")
- && Array.Exists(exe.ImportTable?.HintNameTable ?? [], s => s?.Name == "VirtualProtect");
+ bool importTableMatches = Array.Exists(exe.ImportDirectoryTable ?? [], idte => idte?.Name == "kernel32.dll")
+ && Array.Exists(exe.ImportHintNameTable ?? [], s => s?.Name == "VirtualProtect");
// Get the .dcrtext section, if it exists
if (exe.ContainsSection(".dcrtext") && importTableMatches)
diff --git a/BinaryObjectScanner/Protection/KalypsoLauncher.cs b/BinaryObjectScanner/Protection/KalypsoLauncher.cs
index a38654e1..feab9d7c 100644
--- a/BinaryObjectScanner/Protection/KalypsoLauncher.cs
+++ b/BinaryObjectScanner/Protection/KalypsoLauncher.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/KeyLock.cs b/BinaryObjectScanner/Protection/KeyLock.cs
index b3991fc1..33d5a906 100644
--- a/BinaryObjectScanner/Protection/KeyLock.cs
+++ b/BinaryObjectScanner/Protection/KeyLock.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/LabelGate.cs b/BinaryObjectScanner/Protection/LabelGate.cs
index fabb34d4..5e4463d1 100644
--- a/BinaryObjectScanner/Protection/LabelGate.cs
+++ b/BinaryObjectScanner/Protection/LabelGate.cs
@@ -2,9 +2,9 @@ using System;
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/LaserLok.cs b/BinaryObjectScanner/Protection/LaserLok.cs
index 62e9f357..1b5ea35e 100644
--- a/BinaryObjectScanner/Protection/LaserLok.cs
+++ b/BinaryObjectScanner/Protection/LaserLok.cs
@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -65,10 +65,10 @@ namespace BinaryObjectScanner.Protection
// Check the executable tables
position = exe.StubExecutableData?.FirstPosition(check) ?? -1;
bool containsCheck = position > -1;
- bool containsCheck2 = Array.Exists(exe.ImportTable?.HintNameTable ?? [], hnte => hnte?.Name == "GetModuleHandleA")
- && Array.Exists(exe.ImportTable?.HintNameTable ?? [], hnte => hnte?.Name == "GetProcAddress")
- && Array.Exists(exe.ImportTable?.HintNameTable ?? [], hnte => hnte?.Name == "LoadLibraryA")
- && Array.Exists(exe.ImportTable?.ImportDirectoryTable ?? [], idte => idte?.Name == "KERNEL32.dll");
+ bool containsCheck2 = Array.Exists(exe.ImportHintNameTable ?? [], hnte => hnte?.Name == "GetModuleHandleA")
+ && Array.Exists(exe.ImportHintNameTable ?? [], hnte => hnte?.Name == "GetProcAddress")
+ && Array.Exists(exe.ImportHintNameTable ?? [], hnte => hnte?.Name == "LoadLibraryA")
+ && Array.Exists(exe.ImportDirectoryTable ?? [], idte => idte?.Name == "KERNEL32.dll");
int position2 = -1;
diff --git a/BinaryObjectScanner/Protection/Macrovision.CDilla.cs b/BinaryObjectScanner/Protection/Macrovision.CDilla.cs
index 58a188a1..c3693d1c 100644
--- a/BinaryObjectScanner/Protection/Macrovision.CDilla.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.CDilla.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs b/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs
index b1fad9ee..a8775e3a 100644
--- a/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs b/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs
index eee52120..a09b5ca7 100644
--- a/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs b/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs
index 00c4a63d..d166c2bc 100644
--- a/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using SabreTools.Hashing;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs b/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs
index 928f11a2..05b565ad 100644
--- a/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -75,9 +74,9 @@ namespace BinaryObjectScanner.Protection
// TODO: Invesitgate if the "AdobeLM.dll" file (along with mentions of "AdobeLM" in executables) uniquely identifies SafeCast, or if it can be used with different DRM. (Found in IA item ccd0605)
// Get the import directory table, if it exists
- if (exe.ImportTable?.ImportDirectoryTable != null)
+ if (exe.ImportDirectoryTable != null)
{
- if (Array.Exists(exe.ImportTable.ImportDirectoryTable,
+ if (Array.Exists(exe.ImportDirectoryTable,
idte => idte?.Name != null && idte.Name.Equals("CdaC14BA.dll", StringComparison.OrdinalIgnoreCase)))
{
return "SafeCast";
diff --git a/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs b/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs
index a84191be..57bf4179 100644
--- a/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Hashing;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -52,16 +52,16 @@ namespace BinaryObjectScanner.Protection
internal static string? SafeDiscCheckExecutable(string file, PortableExecutable exe, bool includeDebug)
{
// Found in Redump entry 57986.
- if (exe.ImportTable?.HintNameTable != null)
+ if (exe.ImportHintNameTable != null)
{
- if (Array.Exists(exe.ImportTable.HintNameTable, ihne => ihne?.Name == "LTDLL_Authenticate"))
+ if (Array.Exists(exe.ImportHintNameTable, ihne => ihne?.Name == "LTDLL_Authenticate"))
return "SafeDisc Lite";
}
// Found in Redump entry 57986.
- if (exe.ImportTable?.ImportDirectoryTable != null)
+ if (exe.ImportDirectoryTable != null)
{
- if (Array.Exists(exe.ImportTable.ImportDirectoryTable, idte => idte?.Name == "ltdll.dll"))
+ if (Array.Exists(exe.ImportDirectoryTable, idte => idte?.Name == "ltdll.dll"))
return "SafeDisc Lite";
}
diff --git a/BinaryObjectScanner/Protection/Macrovision.cs b/BinaryObjectScanner/Protection/Macrovision.cs
index a2a4d904..175c34d6 100644
--- a/BinaryObjectScanner/Protection/Macrovision.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/MediaCloQ.cs b/BinaryObjectScanner/Protection/MediaCloQ.cs
index 67c5ac6d..74f9b238 100644
--- a/BinaryObjectScanner/Protection/MediaCloQ.cs
+++ b/BinaryObjectScanner/Protection/MediaCloQ.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/MediaMax.cs b/BinaryObjectScanner/Protection/MediaMax.cs
index 2d043248..3556e8bc 100644
--- a/BinaryObjectScanner/Protection/MediaMax.cs
+++ b/BinaryObjectScanner/Protection/MediaMax.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -48,9 +48,9 @@ namespace BinaryObjectScanner.Protection
}
// Get the export name table
- if (exe.ExportTable?.ExportNameTable?.Strings != null)
+ if (exe.ExportNameTable?.Strings != null)
{
- if (Array.Exists(exe.ExportTable.ExportNameTable.Strings, s => s == "DllInstallSbcp"))
+ if (Array.Exists(exe.ExportNameTable.Strings, s => s == "DllInstallSbcp"))
return "MediaMax CD-3";
}
diff --git a/BinaryObjectScanner/Protection/NEACProtect.cs b/BinaryObjectScanner/Protection/NEACProtect.cs
index dd76de46..c9776c92 100644
--- a/BinaryObjectScanner/Protection/NEACProtect.cs
+++ b/BinaryObjectScanner/Protection/NEACProtect.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/NProtect.cs b/BinaryObjectScanner/Protection/NProtect.cs
index 2de71f57..307b64c6 100644
--- a/BinaryObjectScanner/Protection/NProtect.cs
+++ b/BinaryObjectScanner/Protection/NProtect.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/OpenMG.cs b/BinaryObjectScanner/Protection/OpenMG.cs
index 01e92f8c..cc0d2109 100644
--- a/BinaryObjectScanner/Protection/OpenMG.cs
+++ b/BinaryObjectScanner/Protection/OpenMG.cs
@@ -2,9 +2,9 @@ using System;
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Origin.cs b/BinaryObjectScanner/Protection/Origin.cs
index 61cb47cd..c39ed6bc 100644
--- a/BinaryObjectScanner/Protection/Origin.cs
+++ b/BinaryObjectScanner/Protection/Origin.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/PSXAntiModchip.cs b/BinaryObjectScanner/Protection/PSXAntiModchip.cs
index 8e5009e3..1c900532 100644
--- a/BinaryObjectScanner/Protection/PSXAntiModchip.cs
+++ b/BinaryObjectScanner/Protection/PSXAntiModchip.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/PlayJ.cs b/BinaryObjectScanner/Protection/PlayJ.cs
index 85efd194..5f2b8fd3 100644
--- a/BinaryObjectScanner/Protection/PlayJ.cs
+++ b/BinaryObjectScanner/Protection/PlayJ.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/ProtectDISC.cs b/BinaryObjectScanner/Protection/ProtectDISC.cs
index 02a0cd5c..3575bd22 100644
--- a/BinaryObjectScanner/Protection/ProtectDISC.cs
+++ b/BinaryObjectScanner/Protection/ProtectDISC.cs
@@ -2,9 +2,8 @@
using System.Collections.Generic;
using System.Text;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/RainbowSentinel.cs b/BinaryObjectScanner/Protection/RainbowSentinel.cs
index 7bfa4fd0..63b59d1d 100644
--- a/BinaryObjectScanner/Protection/RainbowSentinel.cs
+++ b/BinaryObjectScanner/Protection/RainbowSentinel.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.Text;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/RealArcade.cs b/BinaryObjectScanner/Protection/RealArcade.cs
index 39db21fe..70142edc 100644
--- a/BinaryObjectScanner/Protection/RealArcade.cs
+++ b/BinaryObjectScanner/Protection/RealArcade.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/RingPROTECH.cs b/BinaryObjectScanner/Protection/RingPROTECH.cs
index b023104a..cb44d2a0 100644
--- a/BinaryObjectScanner/Protection/RingPROTECH.cs
+++ b/BinaryObjectScanner/Protection/RingPROTECH.cs
@@ -1,8 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/Roxxe.cs b/BinaryObjectScanner/Protection/Roxxe.cs
index 287013ce..966c2c67 100644
--- a/BinaryObjectScanner/Protection/Roxxe.cs
+++ b/BinaryObjectScanner/Protection/Roxxe.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/SVKProtector.cs b/BinaryObjectScanner/Protection/SVKProtector.cs
index 87ed8f7c..2b6e939e 100644
--- a/BinaryObjectScanner/Protection/SVKProtector.cs
+++ b/BinaryObjectScanner/Protection/SVKProtector.cs
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Extensions;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/SafeLock.cs b/BinaryObjectScanner/Protection/SafeLock.cs
index c41d37ce..2475caf9 100644
--- a/BinaryObjectScanner/Protection/SafeLock.cs
+++ b/BinaryObjectScanner/Protection/SafeLock.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/SecuROM.cs b/BinaryObjectScanner/Protection/SecuROM.cs
index 9d33d5ca..32e5efa0 100644
--- a/BinaryObjectScanner/Protection/SecuROM.cs
+++ b/BinaryObjectScanner/Protection/SecuROM.cs
@@ -2,10 +2,9 @@ using System;
using System.Collections.Generic;
using System.Text;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -441,11 +440,11 @@ namespace BinaryObjectScanner.Protection
// If not known, check if encrypted executable is likely an alt signing of a known executable
// Filetime could be checked here, but if it was signed at a different time, the time will vary anyways
- var readPathBytes = entry.Path;
- if (readPathBytes == null || readPathBytes.Length == 0)
+ var readPath = entry.Path;
+ if (readPath == null || readPath.Length == 0)
return $"SecuROM Release Control - Unknown executable {md5String},{entry.Size} - Please report to us on GitHub!";
- var readPathName = Encoding.ASCII.GetString(readPathBytes).TrimEnd('\0');
+ var readPathName = readPath.TrimEnd('\0');
if (MatroschkaSizeFilenameDictionary.TryGetValue(entry.Size, out var pathName) && pathName == readPathName)
return $"SecuROM Release Control - Unknown possible alt executable of size {entry.Size} - Please report to us on GitHub";
@@ -493,7 +492,7 @@ namespace BinaryObjectScanner.Protection
// catch other modified PA variants (this would have also caught EA GAM, for example) and to match PiD's
// detection abilities.
- name = exe.ExportTable?.ExportNameTable?.Strings?[0];
+ name = exe.ExportNameTable?.Strings?[0];
if (name.OptionalEquals("drm_pagui_doit"))
{
// Not all of them are guaranteed to have an internal version
diff --git a/BinaryObjectScanner/Protection/SmartE.cs b/BinaryObjectScanner/Protection/SmartE.cs
index cb85f663..2b0b171c 100644
--- a/BinaryObjectScanner/Protection/SmartE.cs
+++ b/BinaryObjectScanner/Protection/SmartE.cs
@@ -1,9 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/SoftLock.cs b/BinaryObjectScanner/Protection/SoftLock.cs
index 5a22dfe6..8f8e5df6 100644
--- a/BinaryObjectScanner/Protection/SoftLock.cs
+++ b/BinaryObjectScanner/Protection/SoftLock.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/SolidShield.cs b/BinaryObjectScanner/Protection/SolidShield.cs
index 70de3482..7329f31f 100644
--- a/BinaryObjectScanner/Protection/SolidShield.cs
+++ b/BinaryObjectScanner/Protection/SolidShield.cs
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -93,15 +92,15 @@ namespace BinaryObjectScanner.Protection
}
// Get the import directory table, if it exists
- if (exe.ImportTable?.ImportDirectoryTable != null)
+ if (exe.ImportDirectoryTable != null)
{
- if (Array.Exists(exe.ImportTable.ImportDirectoryTable, idte => idte?.Name == "dvm.dll"))
+ if (Array.Exists(exe.ImportDirectoryTable, idte => idte?.Name == "dvm.dll"))
return "SolidShield EXE Wrapper v1";
- if (Array.Exists(exe.ImportTable.ImportDirectoryTable, idte => idte?.Name == "activation.x86.dll"))
+ if (Array.Exists(exe.ImportDirectoryTable, idte => idte?.Name == "activation.x86.dll"))
return "SolidShield EXE Wrapper v2";
- if (Array.Exists(exe.ImportTable.ImportDirectoryTable, idte => idte?.Name == "activation.x64.dll"))
+ if (Array.Exists(exe.ImportDirectoryTable, idte => idte?.Name == "activation.x64.dll"))
return "SolidShield EXE Wrapper v2";
}
diff --git a/BinaryObjectScanner/Protection/StarForce.cs b/BinaryObjectScanner/Protection/StarForce.cs
index 6682e4bc..f7a88654 100644
--- a/BinaryObjectScanner/Protection/StarForce.cs
+++ b/BinaryObjectScanner/Protection/StarForce.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
@@ -90,10 +90,10 @@ namespace BinaryObjectScanner.Protection
// return $"StarForce {Tools.Utilities.GetInternalVersion(exe)}";
// Check the export name table
- if (exe.ExportTable?.ExportNameTable?.Strings != null)
+ if (exe.ExportNameTable?.Strings != null)
{
// TODO: Should we just check for "PSA_*" instead of a single entry?
- if (Array.Exists(exe.ExportTable.ExportNameTable.Strings, s => s == "PSA_GetDiscLabel"))
+ if (Array.Exists(exe.ExportNameTable.Strings, s => s == "PSA_GetDiscLabel"))
return $"StarForce {exe.GetInternalVersion()}";
}
diff --git a/BinaryObjectScanner/Protection/Steam.cs b/BinaryObjectScanner/Protection/Steam.cs
index 594fb34e..df8fd30b 100644
--- a/BinaryObjectScanner/Protection/Steam.cs
+++ b/BinaryObjectScanner/Protection/Steam.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/TZCopyProtection.cs b/BinaryObjectScanner/Protection/TZCopyProtection.cs
index 85438970..6bd574a7 100644
--- a/BinaryObjectScanner/Protection/TZCopyProtection.cs
+++ b/BinaryObjectScanner/Protection/TZCopyProtection.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/Tages.cs b/BinaryObjectScanner/Protection/Tages.cs
index dec1492e..0ec99056 100644
--- a/BinaryObjectScanner/Protection/Tages.cs
+++ b/BinaryObjectScanner/Protection/Tages.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Content;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/UbisoftOrbit.cs b/BinaryObjectScanner/Protection/UbisoftOrbit.cs
index 3d8fe22c..7479aebd 100644
--- a/BinaryObjectScanner/Protection/UbisoftOrbit.cs
+++ b/BinaryObjectScanner/Protection/UbisoftOrbit.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/UnilocSoftAnchor.cs b/BinaryObjectScanner/Protection/UnilocSoftAnchor.cs
index ba19b31f..20d7e7b7 100644
--- a/BinaryObjectScanner/Protection/UnilocSoftAnchor.cs
+++ b/BinaryObjectScanner/Protection/UnilocSoftAnchor.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/Uplay.cs b/BinaryObjectScanner/Protection/Uplay.cs
index 2bc62bf1..4cf915ec 100644
--- a/BinaryObjectScanner/Protection/Uplay.cs
+++ b/BinaryObjectScanner/Protection/Uplay.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/WMDS.cs b/BinaryObjectScanner/Protection/WMDS.cs
index 479acdd2..dd17dec0 100644
--- a/BinaryObjectScanner/Protection/WMDS.cs
+++ b/BinaryObjectScanner/Protection/WMDS.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/WTMCDProtect.cs b/BinaryObjectScanner/Protection/WTMCDProtect.cs
index 608c30a0..ef44a4de 100644
--- a/BinaryObjectScanner/Protection/WTMCDProtect.cs
+++ b/BinaryObjectScanner/Protection/WTMCDProtect.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
+using SabreTools.IO;
using SabreTools.IO.Extensions;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO.Matching;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
diff --git a/BinaryObjectScanner/Protection/WinLock.cs b/BinaryObjectScanner/Protection/WinLock.cs
index ecf1408f..524842b2 100644
--- a/BinaryObjectScanner/Protection/WinLock.cs
+++ b/BinaryObjectScanner/Protection/WinLock.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/YuPlay.cs b/BinaryObjectScanner/Protection/YuPlay.cs
index bfc9c861..828dcdf4 100644
--- a/BinaryObjectScanner/Protection/YuPlay.cs
+++ b/BinaryObjectScanner/Protection/YuPlay.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Protection/Zzxzz.cs b/BinaryObjectScanner/Protection/Zzxzz.cs
index 38251fc2..ef25bd08 100644
--- a/BinaryObjectScanner/Protection/Zzxzz.cs
+++ b/BinaryObjectScanner/Protection/Zzxzz.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.IO;
using BinaryObjectScanner.Interfaces;
-using SabreTools.Matching;
-using SabreTools.Matching.Paths;
+using SabreTools.IO;
+using SabreTools.IO.Matching;
namespace BinaryObjectScanner.Protection
{
diff --git a/BinaryObjectScanner/Scanner.cs b/BinaryObjectScanner/Scanner.cs
index 3d7839eb..137b7340 100644
--- a/BinaryObjectScanner/Scanner.cs
+++ b/BinaryObjectScanner/Scanner.cs
@@ -4,6 +4,7 @@ using System.IO;
using BinaryObjectScanner.Data;
using BinaryObjectScanner.Interfaces;
using SabreTools.IO.Extensions;
+using SabreTools.Serialization;
using SabreTools.Serialization.Interfaces;
using SabreTools.Serialization.Wrappers;
@@ -477,20 +478,20 @@ namespace BinaryObjectScanner
{
case AACSMediaKeyBlock obj: return new FileType.AACSMediaKeyBlock(obj);
case BDPlusSVM obj: return new FileType.BDPlusSVM(obj);
+ case LDSCRYPT obj: return new FileType.LDSCRYPT(obj);
case LinearExecutable obj: return new FileType.LinearExecutable(obj);
case MSDOS obj: return new FileType.MSDOS(obj);
case NewExecutable obj: return new FileType.NewExecutable(obj);
case PlayJAudioFile obj: return new FileType.PLJ(obj);
case PortableExecutable obj: return new FileType.PortableExecutable(obj);
+ case RealArcadeInstaller obj: return new FileType.RealArcadeInstaller(obj);
+ case RealArcadeMezzanine obj: return new FileType.RealArcadeMezzanine(obj);
+ case SFFS obj: return new FileType.SFFS(obj);
}
// Fall back on the file type for types not implemented in Serialization
return fileType switch
{
- WrapperType.LDSCRYPT => new FileType.LDSCRYPT(),
- WrapperType.RealArcadeInstaller => new FileType.RealArcadeInstaller(),
- WrapperType.RealArcadeMezzanine => new FileType.RealArcadeMezzanine(),
- WrapperType.SFFS => new FileType.SFFS(),
WrapperType.Textfile => new FileType.Textfile(),
_ => null,
};
diff --git a/ProtectionScan/ProtectionScan.csproj b/ProtectionScan/ProtectionScan.csproj
index f4736ae0..32d1a0dc 100644
--- a/ProtectionScan/ProtectionScan.csproj
+++ b/ProtectionScan/ProtectionScan.csproj
@@ -40,7 +40,7 @@
-
+
\ No newline at end of file