diff --git a/BinaryObjectScanner/FileType/BFPK.cs b/BinaryObjectScanner/FileType/BFPK.cs
index 4fbd8014..a6dbd313 100644
--- a/BinaryObjectScanner/FileType/BFPK.cs
+++ b/BinaryObjectScanner/FileType/BFPK.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
@@ -111,18 +109,18 @@ namespace BinaryObjectScanner.FileType
// Create the output path
string filePath = Path.Combine(outputDirectory, file.Name ?? $"file{index}");
- using (FileStream fs = File.OpenWrite(filePath))
- {
- // Read the data block
- var data = item.ReadFromDataSource(offset, compressedSize);
- if (data == null)
- return false;
+ using FileStream fs = File.OpenWrite(filePath);
- // If we have uncompressed data
- if (compressedSize == file.UncompressedSize)
- {
- fs.Write(data, 0, compressedSize);
- }
+ // Read the data block
+ var data = item.ReadFromDataSource(offset, compressedSize);
+ if (data == null)
+ return false;
+
+ // If we have uncompressed data
+ if (compressedSize == file.UncompressedSize)
+ {
+ fs.Write(data, 0, compressedSize);
+ }
#if NET462_OR_GREATER || NETCOREAPP
else
{
@@ -131,7 +129,6 @@ namespace BinaryObjectScanner.FileType
zs.CopyTo(fs);
}
#endif
- }
return true;
}
diff --git a/BinaryObjectScanner/FileType/BZip2.cs b/BinaryObjectScanner/FileType/BZip2.cs
index cbc2aa79..c8b0af66 100644
--- a/BinaryObjectScanner/FileType/BZip2.cs
+++ b/BinaryObjectScanner/FileType/BZip2.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/FileType/GZIP.cs b/BinaryObjectScanner/FileType/GZIP.cs
index 3fc19933..c15c9f2c 100644
--- a/BinaryObjectScanner/FileType/GZIP.cs
+++ b/BinaryObjectScanner/FileType/GZIP.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/FileType/PKZIP.cs b/BinaryObjectScanner/FileType/PKZIP.cs
index 21d65fba..d34e6557 100644
--- a/BinaryObjectScanner/FileType/PKZIP.cs
+++ b/BinaryObjectScanner/FileType/PKZIP.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/FileType/RAR.cs b/BinaryObjectScanner/FileType/RAR.cs
index 84804518..f162c500 100644
--- a/BinaryObjectScanner/FileType/RAR.cs
+++ b/BinaryObjectScanner/FileType/RAR.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/FileType/SGA.cs b/BinaryObjectScanner/FileType/SGA.cs
index fe3415a5..f1eaa737 100644
--- a/BinaryObjectScanner/FileType/SGA.cs
+++ b/BinaryObjectScanner/FileType/SGA.cs
@@ -20,10 +20,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
@@ -259,10 +257,8 @@ namespace BinaryObjectScanner.FileType
try
{
// Open the output file for writing
- using (Stream fs = File.OpenWrite(filename))
- {
- fs.Write(data, 0, data.Length);
- }
+ using Stream fs = File.OpenWrite(filename);
+ fs.Write(data, 0, data.Length);
}
catch
{
diff --git a/BinaryObjectScanner/FileType/SevenZip.cs b/BinaryObjectScanner/FileType/SevenZip.cs
index 73554259..d5de5710 100644
--- a/BinaryObjectScanner/FileType/SevenZip.cs
+++ b/BinaryObjectScanner/FileType/SevenZip.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/FileType/TapeArchive.cs b/BinaryObjectScanner/FileType/TapeArchive.cs
index 3e87ad31..d5f56464 100644
--- a/BinaryObjectScanner/FileType/TapeArchive.cs
+++ b/BinaryObjectScanner/FileType/TapeArchive.cs
@@ -19,10 +19,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/FileType/XZ.cs b/BinaryObjectScanner/FileType/XZ.cs
index b851b435..48af693b 100644
--- a/BinaryObjectScanner/FileType/XZ.cs
+++ b/BinaryObjectScanner/FileType/XZ.cs
@@ -18,10 +18,8 @@ namespace BinaryObjectScanner.FileType
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/Handler.cs b/BinaryObjectScanner/Handler.cs
index 8a673e98..df484fa1 100644
--- a/BinaryObjectScanner/Handler.cs
+++ b/BinaryObjectScanner/Handler.cs
@@ -24,9 +24,7 @@ namespace BinaryObjectScanner
{
get
{
- if (pathCheckClasses == null)
- pathCheckClasses = InitCheckClasses();
-
+ pathCheckClasses ??= InitCheckClasses();
return pathCheckClasses;
}
}
diff --git a/BinaryObjectScanner/Packer/ASPack.cs b/BinaryObjectScanner/Packer/ASPack.cs
index 7215648a..ba08b3f7 100644
--- a/BinaryObjectScanner/Packer/ASPack.cs
+++ b/BinaryObjectScanner/Packer/ASPack.cs
@@ -78,7 +78,7 @@ namespace BinaryObjectScanner.Packer
{
#region No Wildcards (Long)
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x92, 0x1A, 0x44, 0x00, 0xB8, 0x8C, 0x1A,
@@ -87,7 +87,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0xC4, 0x1D, 0x44,
}, "ASPack 1.00b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0xD2, 0x2A, 0x44, 0x00, 0xB8, 0xCC, 0x2A,
@@ -101,7 +101,7 @@ namespace BinaryObjectScanner.Packer
0x44, 0x00, 0x89, 0x44, 0x24, 0x1C, 0x61, 0xFF
}, "ASPack 1.01b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0xD2, 0x2A, 0x44, 0x00, 0xB8, 0xCC, 0x2A,
@@ -110,7 +110,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x9C, 0x2E, 0x44
}, "ASPack 1.01b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x96, 0x78, 0x43, 0x00, 0xB8, 0x90, 0x78,
@@ -124,7 +124,7 @@ namespace BinaryObjectScanner.Packer
0x43, 0x00, 0x89, 0x44, 0x24, 0x1C, 0x61, 0xFF
}, "ASPack 1.02b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x96, 0x78, 0x43, 0x00, 0xB8, 0x90, 0x78,
@@ -134,7 +134,7 @@ namespace BinaryObjectScanner.Packer
0x15, 0xFE, 0x85, 0x74, 0x7C, 0x43
}, "ASPack 1.02b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x8A, 0x1C, 0x40, 0x00, 0xB9, 0x9E, 0x00,
@@ -142,14 +142,14 @@ namespace BinaryObjectScanner.Packer
0x8B, 0xF7, 0x33
}, "ASPack 1.02b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x96, 0x78, 0x43, 0x00, 0xB8, 0x90, 0x78,
0x43, 0x00, 0x03, 0xC5
}, "ASPack 1.02b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0xAE, 0x98, 0x43, 0x00, 0xB8, 0xA8, 0x98,
@@ -158,7 +158,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x0E, 0x9D, 0x43
}, "ASPack 1.03b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0xCE, 0x3A, 0x44, 0x00, 0xB8, 0xC8, 0x3A,
@@ -167,7 +167,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0xAC, 0x3E, 0x44
}, "ASPack 1.05b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0xEA, 0xA8, 0x43, 0x00, 0xB8, 0xE4, 0xA8,
@@ -181,7 +181,7 @@ namespace BinaryObjectScanner.Packer
0x43, 0x00, 0x89, 0x44, 0x24, 0x1C, 0x61, 0xFF
}, "ASPack 1.06.01b (DLL)"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0xEA, 0xA8, 0x43, 0x00, 0xB8, 0xE4, 0xA8,
@@ -191,7 +191,7 @@ namespace BinaryObjectScanner.Packer
0x15, 0xFE, 0x85, 0x6E, 0xAD, 0x43
}, "ASPack 1.06.01b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x3E, 0xD9, 0x43, 0x00, 0xB8, 0x38, 0xD9,
@@ -205,7 +205,7 @@ namespace BinaryObjectScanner.Packer
0x43, 0x00, 0x89, 0x44, 0x24, 0x1C, 0x61, 0xFF
}, "ASPack 1.07b (DLL)"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xEB, 0x03, 0x5D, 0xFF, 0xE5, 0xE8, 0xF8,
0xFF, 0xFF, 0xFF, 0x81, 0xED, 0x1B, 0x6A, 0x44,
@@ -213,7 +213,7 @@ namespace BinaryObjectScanner.Packer
0x2B, 0x9D, 0x2A
}, "ASPack 1.08"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x0A, 0x4A, 0x44, 0x00, 0xBB, 0x04, 0x4A,
@@ -227,7 +227,7 @@ namespace BinaryObjectScanner.Packer
0x53, 0x50, 0xFF, 0x95, 0x90, 0x51, 0x44, 0x00
}, "ASPack 1.08.03"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x0A, 0x4A, 0x44, 0x00, 0xBB, 0x04, 0x4A,
@@ -236,20 +236,20 @@ namespace BinaryObjectScanner.Packer
0x00, 0x89, 0x9D, 0xBB, 0x4E
}, "ASPack 1.08.03"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x0A, 0x4A, 0x44, 0x00, 0xBB, 0x04, 0x4A,
0x44, 0x00, 0x03, 0xDD
}, "ASPack 1.08.03"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x72, 0x05, 0x00, 0x00, 0xEB, 0x33,
0x87, 0xDB, 0x90, 0x00
}, "ASPack 2.00.01"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9, 0xEB,
0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01, 0x00,
@@ -257,34 +257,34 @@ namespace BinaryObjectScanner.Packer
0xFF, 0x03, 0xDD, 0x81, 0xEB
}, "ASPack 2.1"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x02, 0x00, 0x00, 0x00, 0xEB, 0x09,
0x5D, 0x55, 0x81, 0xED, 0x39, 0x39, 0x44, 0x00,
0xC3, 0xE9, 0x3D, 0x04, 0x00, 0x00
}, "ASPack 2.11b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x02, 0x00, 0x00, 0x00, 0xEB, 0x09,
0x5D, 0x55
}, "ASPack 2.11b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x02, 0x00, 0x00, 0x00, 0xEB, 0x09,
0x5D, 0x55, 0x81, 0xED, 0x39, 0x39, 0x44, 0x00,
0xC3, 0xE9, 0x59, 0x04, 0x00, 0x00
}, "ASPack 2.11c"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x02, 0x00, 0x00, 0x00, 0xCD, 0x20,
0xE8, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x2B, 0xC9,
0x58, 0x74, 0x02
}, "ASPack 2.11d"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9, 0xEB,
0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01
@@ -294,7 +294,7 @@ namespace BinaryObjectScanner.Packer
#region Wildcards (Long)
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0x3E, 0xD9, 0x43, null, 0xB8, 0x38, null,
@@ -308,7 +308,7 @@ namespace BinaryObjectScanner.Packer
0x43, null, 0x89, 0x44, 0x24, 0x1C, 0x61, 0xFF
}, "ASPack 1.00b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0xD2, 0x2A, 0x44, null, 0xB8, 0xCC, 0x2A,
@@ -317,7 +317,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x9C, 0x2E, 0x44
}, "ASPack 1.01b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0xCE, 0x3A, 0x44, null, 0xB8, 0xC8, 0x3A,
@@ -326,7 +326,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0xAC, 0x3E, 0x44
}, "ASPack 1.01b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, 0x3E, 0xD9, 0x43, 0x00, 0xB8, 0x38, null,
@@ -340,13 +340,13 @@ namespace BinaryObjectScanner.Packer
0x43, 0x00, 0x89, 0x44, 0x24, 0x1C, 0x61, 0xFF
}, "ASPack 1.02a -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0x06, null, null, null, 0x64, 0xA0, 0x23
}, "ASPack 1.02a"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0x96, 0x78, 0x43, null, 0xB8, 0x90, 0x78,
@@ -355,7 +355,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x74, 0x7C, 0x43
}, "ASPack 1.02b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0xAE, 0x98, 0x43, null, 0xB8, 0xA8, 0x98,
@@ -364,7 +364,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x0E, 0x9D, 0x43
}, "ASPack 1.03b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, null, null, null, null, 0xE8, 0x0D, null,
@@ -372,7 +372,7 @@ namespace BinaryObjectScanner.Packer
null, null, null, null, null, null, null, 0x58
}, "ASPack 1.03b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81,
0xED, null, null, null, 0x00, 0xB8, null, null,
@@ -381,7 +381,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x08, 0x9D, null, 0x00, 0x00
}, "ASPack 1.04b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, null, null, null, null, 0xB8, null, null,
@@ -390,7 +390,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x08, 0x9D
}, "ASPack 1.04b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, null, null, null, null, 0xB8, null, null,
@@ -399,7 +399,7 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x01, 0xDE
}, "ASPack 1.04b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, 0xEA, 0xA8, 0x43, null, 0xB8, 0xE4, 0xA8,
@@ -408,28 +408,28 @@ namespace BinaryObjectScanner.Packer
0x80, 0xBD, 0x6E, 0xAD, 0x43
}, "ASPack 1.06.1b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x90, 0x61, 0xBE, null, null, null, null, 0x8D,
0xBE, null, null, null, null, 0x57, 0x83, 0xCD,
0xFF
}, "ASPack 1.06.1b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, null,
null, null, null, null, null, 0xB8, null, null,
null, null, 0x03, 0xC5
}, "ASPack 1.07b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, null, null, null, null, 0x5D, 0x81,
0xED, null, null, null, null, 0x60, 0xE8, 0x2B,
0x03, 0x00, 0x00
}, "ASPack 1.07b"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xEB, 0x0A, 0x5D, 0xEB, 0x02, 0xFF, 0x25,
0x45, 0xFF, 0xE5, 0xE8, 0xE9, 0xE8, 0xF1, 0xFF,
@@ -438,7 +438,7 @@ namespace BinaryObjectScanner.Packer
0x2B, 0x9D
}, "ASPack 1.08.01"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xEB, 0x0A, 0x5D, 0xEB, 0x02, 0xFF, 0x25,
0x45, 0xFF, 0xE5, 0xE8, 0xE9, 0xE8, 0xF1, 0xFF,
@@ -447,7 +447,7 @@ namespace BinaryObjectScanner.Packer
0x2B, 0x9D
}, "ASPack 1.08.01"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xEB, 0x0A, 0x5D, 0xEB, 0x02, 0xFF, 0x25,
0x45, 0xFF, 0xE5, 0xE8, 0xE9, 0xE8, 0xF1, 0xFF,
@@ -456,7 +456,7 @@ namespace BinaryObjectScanner.Packer
0x2B, 0x9D, 0x72
}, "ASPack 1.08.02"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, null,
null, null, null, null, null, 0xBB, null, null,
@@ -465,14 +465,14 @@ namespace BinaryObjectScanner.Packer
0x00, 0x89, 0x9D, 0xBB, 0x4E
}, "ASPack 1.08.03"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, null,
null, null, null, null, null, 0xBB, null, null,
null, null, 0x03, 0xDD
}, "ASPack 1.08.03"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x55, 0x57, 0x51, 0x53, 0xE8, null, null, null,
null, 0x5D, 0x8B, 0xC5, 0x81, 0xED, null, null,
@@ -481,27 +481,27 @@ namespace BinaryObjectScanner.Packer
null, 0x0F, 0xB6
}, "ASPack 1.08.03"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE9, null, null, null, null, 0xEF, 0x40,
0x03, 0xA7, 0x07, 0x8F, 0x07, 0x1C, 0x37, 0x5D,
0x43, 0xA7, 0x04, 0xB9, 0x2C, 0x3A
}, "ASPack 1.08.x"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x02, 0x00, 0x00, 0x00, 0xEB, 0x09,
0x5D, 0x55, 0x81, 0xED, 0x39, 0x39, 0x44, 0x00,
0xC3, 0xE9, null, 0x04, 0x00, 0x00
}, "ASPack 2.11.x -> Alexey Solodovnikov"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
null, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9, 0xEB,
0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01
}, "ASPack 2.12 (without Poly) -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
null, 0x60, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9,
0xEB, 0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01,
@@ -518,7 +518,7 @@ namespace BinaryObjectScanner.Packer
0xFF, 0x95, 0x48, 0x0F
}, "ASPack 2.12b -> Solodovnikov Alexey"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x60, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9, 0xEB,
0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01, 0x00,
@@ -567,7 +567,7 @@ namespace BinaryObjectScanner.Packer
0x08
}, "ASPack 2.2 -> Alexey Solodovnikov & StarForce * 2009408"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
null, 0x60, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE9,
0xEB, 0x04, 0x5D, 0x45, 0x55, 0xC3, 0xE8, 0x01,
@@ -580,7 +580,7 @@ namespace BinaryObjectScanner.Packer
#region 2.xx (Long)
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0xA8, 0x03, 0x00, 0x00, 0x61, 0x75, 0x08, 0xB8,
0x01, 0x00, 0x00, 0x00, 0xC2, 0x0C, 0x00, 0x68,
@@ -589,7 +589,7 @@ namespace BinaryObjectScanner.Packer
0x00, 0x51, 0x50, 0xFF, 0x95
}, "ASPack 2.xx"),
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0xA8, 0x03, null, null, 0x61, 0x75, 0x08, 0xB8,
0x01, null, null, null, 0xC2, 0x0C, null, 0x68,
@@ -602,55 +602,55 @@ namespace BinaryObjectScanner.Packer
#region Short
- new ContentMatchSet(new byte?[] { 0x75, 0x00, 0xE9 }, "ASPack 1.05b"),
+ new(new byte?[] { 0x75, 0x00, 0xE9 }, "ASPack 1.05b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x90, 0x75, 0x00, 0xE9 }, "ASPack 1.06.1b"),
+ new(new byte?[] { 0x90, 0x90, 0x90, 0x75, 0x00, 0xE9 }, "ASPack 1.06.1b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x75, 0x00, 0xE9 }, "ASPack 1.06.1b"),
+ new(new byte?[] { 0x90, 0x90, 0x75, 0x00, 0xE9 }, "ASPack 1.06.1b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x75, 0x00, 0xE9 }, "ASPack 1.06.1b"),
+ new(new byte?[] { 0x90, 0x75, 0x00, 0xE9 }, "ASPack 1.06.1b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x90, 0x75, null, 0xE9 }, "ASPack 1.07b"),
+ new(new byte?[] { 0x90, 0x90, 0x90, 0x75, null, 0xE9 }, "ASPack 1.07b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x75, null, 0xE9 }, "ASPack 1.07b"),
+ new(new byte?[] { 0x90, 0x90, 0x75, null, 0xE9 }, "ASPack 1.07b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x75, null, 0xE9 }, "ASPack 1.07b"),
+ new(new byte?[] { 0x90, 0x75, null, 0xE9 }, "ASPack 1.07b"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x90, 0x75, 0x01, 0x90, 0xE9 }, "ASPack 1.08"),
+ new(new byte?[] { 0x90, 0x90, 0x90, 0x75, 0x01, 0x90, 0xE9 }, "ASPack 1.08"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x90, 0x75, 0x01, 0xFF, 0xE9 }, "ASPack 1.08"),
+ new(new byte?[] { 0x90, 0x90, 0x90, 0x75, 0x01, 0xFF, 0xE9 }, "ASPack 1.08"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x75, 0x01, 0xFF, 0xE9 }, "ASPack 1.08"),
+ new(new byte?[] { 0x90, 0x90, 0x75, 0x01, 0xFF, 0xE9 }, "ASPack 1.08"),
- new ContentMatchSet(new byte?[] { 0x90, 0x75, 0x01, 0xFF, 0xE9 }, "ASPack 1.08"),
+ new(new byte?[] { 0x90, 0x75, 0x01, 0xFF, 0xE9 }, "ASPack 1.08"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x90, 0x75, null, 0x90, 0xE9 }, "ASPack 1.08.01"),
+ new(new byte?[] { 0x90, 0x90, 0x90, 0x75, null, 0x90, 0xE9 }, "ASPack 1.08.01"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x75, null, 0x90, 0xE9 }, "ASPack 1.08.01"),
+ new(new byte?[] { 0x90, 0x90, 0x75, null, 0x90, 0xE9 }, "ASPack 1.08.01"),
- new ContentMatchSet(new byte?[] { 0x90, 0x75, null, 0x90, 0xE9 }, "ASPack 1.08.01"),
+ new(new byte?[] { 0x90, 0x75, null, 0x90, 0xE9 }, "ASPack 1.08.01"),
- new ContentMatchSet(new byte?[] { 0x90, 0x90, 0x75, 0x01, 0x90, 0xE9 }, "ASPack 1.08.02"),
+ new(new byte?[] { 0x90, 0x90, 0x75, 0x01, 0x90, 0xE9 }, "ASPack 1.08.02"),
- new ContentMatchSet(new byte?[] { 0x90, 0x75, 0x01, 0x90, 0xE9 }, "ASPack 1.08.02"),
+ new(new byte?[] { 0x90, 0x75, 0x01, 0x90, 0xE9 }, "ASPack 1.08.02"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, 0x41, 0x06, 0x00, 0x00, 0xEB, 0x41 }, "ASPack 1.08.04"),
+ new(new byte?[] { 0x60, 0xE8, 0x41, 0x06, 0x00, 0x00, 0xEB, 0x41 }, "ASPack 1.08.04"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, null, null, null, null, 0xEB }, "ASPack 1.08.04"),
+ new(new byte?[] { 0x60, 0xE8, null, null, null, null, 0xEB }, "ASPack 1.08.04"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, 0x70, 0x05, 0x00, 0x00, 0xEB, 0x4C }, "ASPack 2.00.00"),
+ new(new byte?[] { 0x60, 0xE8, 0x70, 0x05, 0x00, 0x00, 0xEB, 0x4C }, "ASPack 2.00.00"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, 0x48, 0x11, 0x00, 0x00, 0xC3, 0x83 }, "ASPack 2.00.00"),
+ new(new byte?[] { 0x60, 0xE8, 0x48, 0x11, 0x00, 0x00, 0xC3, 0x83 }, "ASPack 2.00.00"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, 0x72, 0x05, 0x00, 0x00, 0xEB, 0x4C }, "ASPack 2.00.01"),
+ new(new byte?[] { 0x60, 0xE8, 0x72, 0x05, 0x00, 0x00, 0xEB, 0x4C }, "ASPack 2.00.01"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, null, 0x05, 0x00, 0x00, 0xEB, 0x4C }, "ASPack 2.00.x -> Alexey Solodovnikov"),
+ new(new byte?[] { 0x60, 0xE8, null, 0x05, 0x00, 0x00, 0xEB, 0x4C }, "ASPack 2.00.x -> Alexey Solodovnikov"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE9, 0x3D, 0x04, 0x00, 0x00 }, "ASPack 2.11"),
+ new(new byte?[] { 0x60, 0xE9, 0x3D, 0x04, 0x00, 0x00 }, "ASPack 2.11"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, 0xF9, 0x11, 0x00, 0x00, 0xC3, 0x83 }, "ASPack 2.11"),
+ new(new byte?[] { 0x60, 0xE8, 0xF9, 0x11, 0x00, 0x00, 0xC3, 0x83 }, "ASPack 2.11"),
- new ContentMatchSet(new byte?[] { 0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81, 0xED }, "ASPack 1.02b/1.08.03"),
+ new(new byte?[] { 0x60, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x81, 0xED }, "ASPack 1.02b/1.08.03"),
#endregion
};
diff --git a/BinaryObjectScanner/Packer/CExe.cs b/BinaryObjectScanner/Packer/CExe.cs
index 3c1c567f..01c51560 100644
--- a/BinaryObjectScanner/Packer/CExe.cs
+++ b/BinaryObjectScanner/Packer/CExe.cs
@@ -32,7 +32,7 @@ namespace BinaryObjectScanner.Packer
{
var matchers = new List
{
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x25, 0x57, 0x6F, 0xC1, 0x61, 0x36, 0x01, 0x92,
0x61, 0x36, 0x01, 0x92, 0x61, 0x36, 0x01, 0x92,
@@ -57,10 +57,8 @@ namespace BinaryObjectScanner.Packer
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/Packer/EXEStealth.cs b/BinaryObjectScanner/Packer/EXEStealth.cs
index bba36782..ddca763e 100644
--- a/BinaryObjectScanner/Packer/EXEStealth.cs
+++ b/BinaryObjectScanner/Packer/EXEStealth.cs
@@ -21,7 +21,7 @@ namespace BinaryObjectScanner.Packer
var contentMatchSets = new List
{
// ??[[__[[_ + (char)0x00 + {{ + (char)0x0 + (char)0x00 + {{ + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x0 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + ?;??;??
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x3F, 0x3F, 0x5B, 0x5B, 0x5F, 0x5F, 0x5B, 0x5B,
0x5F, 0x00, 0x7B, 0x7B, 0x00, 0x00, 0x7B, 0x7B,
diff --git a/BinaryObjectScanner/Packer/InnoSetup.cs b/BinaryObjectScanner/Packer/InnoSetup.cs
index c3785a28..4ca75009 100644
--- a/BinaryObjectScanner/Packer/InnoSetup.cs
+++ b/BinaryObjectScanner/Packer/InnoSetup.cs
@@ -85,7 +85,7 @@ namespace BinaryObjectScanner.Packer
var matchers = new List
{
// "rDlPtS02" + (char)0x87 + "eVx"
- new ContentMatchSet(new byte?[] { 0x72, 0x44, 0x6C, 0x50, 0x74, 0x53, 0x30, 0x32, 0x87, 0x65, 0x56, 0x78 }, "1.2.16 or earlier"),
+ new(new byte?[] { 0x72, 0x44, 0x6C, 0x50, 0x74, 0x53, 0x30, 0x32, 0x87, 0x65, 0x56, 0x78 }, "1.2.16 or earlier"),
};
return MatchUtil.GetFirstMatch(file, data, matchers, false) ?? "Unknown 1.X";
diff --git a/BinaryObjectScanner/Packer/WinRARSFX.cs b/BinaryObjectScanner/Packer/WinRARSFX.cs
index 46816d7f..00c3df13 100644
--- a/BinaryObjectScanner/Packer/WinRARSFX.cs
+++ b/BinaryObjectScanner/Packer/WinRARSFX.cs
@@ -38,10 +38,8 @@ namespace BinaryObjectScanner.Packer
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
diff --git a/BinaryObjectScanner/Packer/WinZipSFX.cs b/BinaryObjectScanner/Packer/WinZipSFX.cs
index e61fe6fa..8baad155 100644
--- a/BinaryObjectScanner/Packer/WinZipSFX.cs
+++ b/BinaryObjectScanner/Packer/WinZipSFX.cs
@@ -68,10 +68,8 @@ namespace BinaryObjectScanner.Packer
if (!File.Exists(file))
return null;
- using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- return Extract(fs, file, includeDebug);
- }
+ using var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
+ return Extract(fs, file, includeDebug);
}
///
@@ -693,37 +691,23 @@ namespace BinaryObjectScanner.Packer
|| sfxFileName == "WZIPSE32.exe" || sfxFileName == "SI32LPG.SFX"
|| sfxFileName == "ST32E.WZE")
{
- switch (sfxTimeDateStamp)
+ return sfxTimeDateStamp switch
{
- case 842636344:
- return "2.0 (32-bit)";
- case 865370756:
- return "2.1 RC2 (32-bit)";
- case 869059925:
- return "2.1 (32-bit)";
- case 979049321:
- return "2.2.4003";
- case 1149714685:
- return "3.0.7158";
- case 1185211734:
- return "3.1.7556";
- case 1185211920:
- return "3.1.7556";
- case 1235490556:
- return "4.0.8421";
- case 1235490757:
- return "4.0.8421";
- case 1235490687:
- return "4.0.8421"; // 3.1.8421.0, SI32LPG?
- case 1257193383:
- return "4.0.8672"; // 3.1.8672.0
- case 1257193543:
- return "4.0.8672";
- case 1470410848:
- return "4.0.12218"; // 4.0.1221.0
- default:
- return $"{assemblyVersion} (32-bit)";
- }
+ 842636344 => "2.0 (32-bit)",
+ 865370756 => "2.1 RC2 (32-bit)",
+ 869059925 => "2.1 (32-bit)",
+ 979049321 => "2.2.4003",
+ 1149714685 => "3.0.7158",
+ 1185211734 => "3.1.7556",
+ 1185211920 => "3.1.7556",
+ 1235490556 => "4.0.8421",
+ 1235490757 => "4.0.8421",
+ 1235490687 => "4.0.8421",// 3.1.8421.0, SI32LPG?
+ 1257193383 => "4.0.8672",// 3.1.8672.0
+ 1257193543 => "4.0.8672",
+ 1470410848 => "4.0.12218",// 4.0.1221.0
+ _ => $"{assemblyVersion} (32-bit)",
+ };
}
// Personal Edition
@@ -731,152 +715,90 @@ namespace BinaryObjectScanner.Packer
|| sfxFileName == "wzsepe32.exe" || sfxFileName == "SI32PE.SFX"
|| sfxFileName == "SI32LPE.SFX")
{
- switch (sfxTimeDateStamp)
+ return sfxTimeDateStamp switch
{
- case 845061601:
- return "Personal Edition (32-bit)"; // TODO: Find version
- case 868303343:
- return "Personal Edition (32-bit)"; // TODO: Find version
- case 868304170:
- return "Personal Edition (32-bit)"; // TODO: Find version
- case 906039079:
- return "Personal Edition 2.2.1260 (32-bit)";
- case 906040543:
- return "Personal Edition 2.2.1260 (32-bit)";
- case 908628435:
- return "Personal Edition 2.2.1285 (32-bit)";
- case 908628785:
- return "Personal Edition 2.2.1285 (32-bit)";
- case 956165981:
- return "Personal Edition 2.2.3063";
- case 956166038:
- return "Personal Edition 2.2.3063";
- case 1006353695:
- return "Personal Edition 2.2.4325";
- case 1006353714:
- return "Personal Edition 2.2.4325"; // 8.1.0.0
- case 1076515698:
- return "Personal Edition 2.2.6028";
- case 1076515784:
- return "Personal Edition 2.2.6028"; // 9.0.6028.0
- case 1092688561:
- return "Personal Edition 2.2.6224";
- case 1092688645:
- return "Personal Edition 2.2.6224"; // 9.0.6224.0
- case 1125074095:
- return "Personal Edition 2.2.6604";
- case 1125074162:
- return "Personal Edition 2.2.6604"; // 10.0.6604.0
- case 1130153399:
- return "Personal Edition 2.2.6663";
- case 1130153428:
- return "Personal Edition 2.2.6663"; // 10.0.6663.0
- case 1149714176:
- return "Personal Edition 3.0.7158";
- case 1163137967:
- return "Personal Edition 3.0.7305";
- case 1163137994:
- return "Personal Edition 3.0.7313"; // 11.0.7313.0
- case 1176345383:
- return "Personal Edition 3.0.7452";
- case 1176345423:
- return "Personal Edition 3.1.7466"; // 11.1.7466.0
- case 1184106698:
- return "Personal Edition 3.1.7556";
- case 1207280880:
- return "Personal Edition 4.0.8060"; // 2.3.7382.0
- case 1207280892:
- return "Personal Edition 4.0.8094"; // 11.2.8094.0
- case 1220904506:
- return "Personal Edition 4.0.8213"; // 2.3.7382.0
- case 1220904518:
- return "Personal Edition 4.0.8252"; // 12.0.8252.0
- case 1235490648:
- return "Personal Edition 4.0.8421"; // 3.1.8421.0
- case 1242049399:
- return "Personal Edition 4.0.8497"; // 12.1.8497.0
- case 1257193469:
- return "Personal Edition 4.0.8672"; // 3.1.8672.0, SI32LPE?
- default:
- return $"Personal Edition {assemblyVersion} (32-bit)";
- }
+ 845061601 => "Personal Edition (32-bit)",// TODO: Find version
+ 868303343 => "Personal Edition (32-bit)",// TODO: Find version
+ 868304170 => "Personal Edition (32-bit)",// TODO: Find version
+ 906039079 => "Personal Edition 2.2.1260 (32-bit)",
+ 906040543 => "Personal Edition 2.2.1260 (32-bit)",
+ 908628435 => "Personal Edition 2.2.1285 (32-bit)",
+ 908628785 => "Personal Edition 2.2.1285 (32-bit)",
+ 956165981 => "Personal Edition 2.2.3063",
+ 956166038 => "Personal Edition 2.2.3063",
+ 1006353695 => "Personal Edition 2.2.4325",
+ 1006353714 => "Personal Edition 2.2.4325",// 8.1.0.0
+ 1076515698 => "Personal Edition 2.2.6028",
+ 1076515784 => "Personal Edition 2.2.6028",// 9.0.6028.0
+ 1092688561 => "Personal Edition 2.2.6224",
+ 1092688645 => "Personal Edition 2.2.6224",// 9.0.6224.0
+ 1125074095 => "Personal Edition 2.2.6604",
+ 1125074162 => "Personal Edition 2.2.6604",// 10.0.6604.0
+ 1130153399 => "Personal Edition 2.2.6663",
+ 1130153428 => "Personal Edition 2.2.6663",// 10.0.6663.0
+ 1149714176 => "Personal Edition 3.0.7158",
+ 1163137967 => "Personal Edition 3.0.7305",
+ 1163137994 => "Personal Edition 3.0.7313",// 11.0.7313.0
+ 1176345383 => "Personal Edition 3.0.7452",
+ 1176345423 => "Personal Edition 3.1.7466",// 11.1.7466.0
+ 1184106698 => "Personal Edition 3.1.7556",
+ 1207280880 => "Personal Edition 4.0.8060",// 2.3.7382.0
+ 1207280892 => "Personal Edition 4.0.8094",// 11.2.8094.0
+ 1220904506 => "Personal Edition 4.0.8213",// 2.3.7382.0
+ 1220904518 => "Personal Edition 4.0.8252",// 12.0.8252.0
+ 1235490648 => "Personal Edition 4.0.8421",// 3.1.8421.0
+ 1242049399 => "Personal Edition 4.0.8497",// 12.1.8497.0
+ 1257193469 => "Personal Edition 4.0.8672",// 3.1.8672.0, SI32LPE?
+ _ => $"Personal Edition {assemblyVersion} (32-bit)",
+ };
}
// Software Installation
else if (sfxFileName == "VW95SRE.SFX" || sfxFileName == "SI32E.SFX"
|| sfxFileName == "SI32E.WZE")
{
- switch (sfxTimeDateStamp)
+ return sfxTimeDateStamp switch
{
- case 842636381:
- return "Software Installation 2.0 (32-bit)";
- case 865370800:
- return "Software Installation 2.1 RC2 (32-bit)";
- case 869059963:
- return "Software Installation 2.1 (32-bit)";
- case 893107697:
- return "Software Installation 2.2.1110 (32-bit)";
- case 952007369:
- return "Software Installation 2.2.3063";
- case 1006352634:
- return "Software Installation 2.2.4325"; // +Personal Edition?
- case 979049345:
- return "Software Installation 2.2.4403";
- case 1026227373:
- return "Software Installation 2.2.5196"; // +Personal Edition?
- case 1090582390:
- return "Software Installation 2.2.6202"; // +Personal Edition?
- case 1149714757:
- return "Software Installation 3.0.7158";
- case 1154357628:
- return "Software Installation 3.0.7212";
- case 1175234637:
- return "Software Installation 3.0.7454";
- case 1185211802:
- return "Software Installation 3.1.7556";
- case 1470410906:
- return "Software Installation 4.0.12218"; // 4.0.1221.0
- default:
- return $"Software Installation {assemblyVersion} (32-bit)";
- }
+ 842636381 => "Software Installation 2.0 (32-bit)",
+ 865370800 => "Software Installation 2.1 RC2 (32-bit)",
+ 869059963 => "Software Installation 2.1 (32-bit)",
+ 893107697 => "Software Installation 2.2.1110 (32-bit)",
+ 952007369 => "Software Installation 2.2.3063",
+ 1006352634 => "Software Installation 2.2.4325",// +Personal Edition?
+ 979049345 => "Software Installation 2.2.4403",
+ 1026227373 => "Software Installation 2.2.5196",// +Personal Edition?
+ 1090582390 => "Software Installation 2.2.6202",// +Personal Edition?
+ 1149714757 => "Software Installation 3.0.7158",
+ 1154357628 => "Software Installation 3.0.7212",
+ 1175234637 => "Software Installation 3.0.7454",
+ 1185211802 => "Software Installation 3.1.7556",
+ 1470410906 => "Software Installation 4.0.12218",// 4.0.1221.0
+ _ => $"Software Installation {assemblyVersion} (32-bit)",
+ };
}
- switch (sfxFileName)
+ return sfxFileName switch
{
// Standard
- case "VW95SE.SFX":
- return "Unknown Version (32-bit)"; // TODO: Find starting version
- case "ST32E.SFX":
- return "Unknown Version (32-bit)"; // TODO: Find starting version
- case "WZIPSE32.exe":
- return "Unknown Version (32-bit)"; // TODO: Find starting version
- case "SI32LPG.SFX":
- return "Unknown Version (32-bit)"; // TODO: Find starting version
- case "ST32E.WZE":
- return "Unknown Version (32-bit)"; // TODO: Find starting version
-
+ "VW95SE.SFX" => "Unknown Version (32-bit)",// TODO: Find starting version
+ "ST32E.SFX" => "Unknown Version (32-bit)",// TODO: Find starting version
+ "WZIPSE32.exe" => "Unknown Version (32-bit)",// TODO: Find starting version
+ "SI32LPG.SFX" => "Unknown Version (32-bit)",// TODO: Find starting version
+ "ST32E.WZE" => "Unknown Version (32-bit)",// TODO: Find starting version
+
// Personal Edition
- case "VW95LE.SFX":
- return "Unknown Version before Personal Edition Build 1285 (32-bit)";
- case "PE32E.SFX":
- return "Unknown Version after Personal Edition Build 1285 (32-bit)";
- case "wzsepe32.exe":
- return "Unknown Version Personal Edition (32-bit)"; // TODO: Find starting version
- case "SI32PE.SFX":
- return "Unknown Version Personal Edition (32-bit)"; // TODO: Find starting version
- case "SI32LPE.SFX":
- return "Unknown Version Personal Edition (32-bit)"; // TODO: Find starting version
-
+ "VW95LE.SFX" => "Unknown Version before Personal Edition Build 1285 (32-bit)",
+ "PE32E.SFX" => "Unknown Version after Personal Edition Build 1285 (32-bit)",
+ "wzsepe32.exe" => "Unknown Version Personal Edition (32-bit)",// TODO: Find starting version
+ "SI32PE.SFX" => "Unknown Version Personal Edition (32-bit)",// TODO: Find starting version
+ "SI32LPE.SFX" => "Unknown Version Personal Edition (32-bit)",// TODO: Find starting version
+
// Software Installation
- case "VW95SRE.SFX":
- return "Unknown Version before Software Installation 2.1 (32-bit)";
- case "SI32E.SFX":
- return "Unknown Version after Software Installation 2.1 (32-bit)";
- case "SI32E.WZE":
- return "Unknown Version Software Installation (32-bit)"; // TODO: Find starting version
- }
-
- return null;
+ "VW95SRE.SFX" => "Unknown Version before Software Installation 2.1 (32-bit)",
+ "SI32E.SFX" => "Unknown Version after Software Installation 2.1 (32-bit)",
+ "SI32E.WZE" => "Unknown Version Software Installation (32-bit)",// TODO: Find starting version
+ _ => null,
+ };
}
}
}
diff --git a/BinaryObjectScanner/Packer/WiseInstaller.cs b/BinaryObjectScanner/Packer/WiseInstaller.cs
index 26d906b5..409317f9 100644
--- a/BinaryObjectScanner/Packer/WiseInstaller.cs
+++ b/BinaryObjectScanner/Packer/WiseInstaller.cs
@@ -30,10 +30,10 @@ namespace BinaryObjectScanner.Packer
var neMatchSets = new List
{
// WiseInst
- new ContentMatchSet(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x49, 0x6E, 0x73, 0x74 }, "Wise Installation Wizard Module"),
+ new(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x49, 0x6E, 0x73, 0x74 }, "Wise Installation Wizard Module"),
// WiseMain
- new ContentMatchSet(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"),
+ new(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"),
};
return MatchUtil.GetFirstMatch(file, data, neMatchSets, includeDebug);
diff --git a/BinaryObjectScanner/Protection/ActiveMARK.cs b/BinaryObjectScanner/Protection/ActiveMARK.cs
index 56e3cd0b..2c118f66 100644
--- a/BinaryObjectScanner/Protection/ActiveMARK.cs
+++ b/BinaryObjectScanner/Protection/ActiveMARK.cs
@@ -19,7 +19,7 @@ namespace BinaryObjectScanner.Protection
var contentMatchSets = new List
{
// " " + (char)0xC2 + (char)0x16 + (char)0x00 + (char)0xA8 + (char)0xC1 + (char)0x16 + (char)0x00 + (char)0xB8 + (char)0xC1 + (char)0x16 + (char)0x00 + (char)0x86 + (char)0xC8 + (char)0x16 + (char)0x00 + (char)0x9A + (char)0xC1 + (char)0x16 + (char)0x00 + (char)0x10 + (char)0xC2 + (char)0x16 + (char)0x00
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x20, 0xC2, 0x16, 0x00, 0xA8, 0xC1, 0x16, 0x00,
0xB8, 0xC1, 0x16, 0x00, 0x86, 0xC8, 0x16, 0x00,
diff --git a/BinaryObjectScanner/Protection/AegiSoft.cs b/BinaryObjectScanner/Protection/AegiSoft.cs
index 048b95d9..4d059b2a 100644
--- a/BinaryObjectScanner/Protection/AegiSoft.cs
+++ b/BinaryObjectScanner/Protection/AegiSoft.cs
@@ -53,7 +53,7 @@ namespace BinaryObjectScanner.Protection
{
// Found in "Asc001.dll", "Asc002.dll", "Asc003.dll", "Asc005.dll", "Asc006.exe", and "AscLM.cpl" (Redump entry 73521/IA item "Nova_HoyleCasino99USA").
// ÿÿÿÿ\\.\ASCLM
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0xFF, 0xFF, 0xFF, 0xFF, 0x5C, 0x5C, 0x2E, 0x5C,
0x41, 0x53, 0x43, 0x4C, 0x4D
@@ -78,9 +78,9 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in Redump entry 73521/IA item "Nova_HoyleCasino99USA".
- new PathMatchSet(new PathMatch("AscLM.cpl", useEndsWith: true), "AegiSoft License Manager"),
- new PathMatchSet(new PathMatch("AscLM.vxd", useEndsWith: true), "AegiSoft License Manager"),
- new PathMatchSet(new PathMatch("AscLMd.vxd", useEndsWith: true), "AegiSoft License Manager"),
+ new(new FilePathMatch("AscLM.cpl"), "AegiSoft License Manager"),
+ new(new FilePathMatch("AscLM.vxd"), "AegiSoft License Manager"),
+ new(new FilePathMatch("AscLMd.vxd"), "AegiSoft License Manager"),
// There are a few other files present, but the file names on their own may be too overmatching. Due to the small sample size, it's not sure if these files are always present together.
// These files are "Asc001.dll", "Asc002.dll", "Asc003.dll", "Asc005.dll", and "Asc006.exe" (Found in Redump entry 73521/IA item "Nova_HoyleCasino99USA").
@@ -95,9 +95,9 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in Redump entry 73521/IA item "Nova_HoyleCasino99USA".
- new PathMatchSet(new PathMatch("AscLM.cpl", useEndsWith: true), "AegiSoft License Manager"),
- new PathMatchSet(new PathMatch("AscLM.vxd", useEndsWith: true), "AegiSoft License Manager"),
- new PathMatchSet(new PathMatch("AscLMd.vxd", useEndsWith: true), "AegiSoft License Manager"),
+ new(new FilePathMatch("AscLM.cpl"), "AegiSoft License Manager"),
+ new(new FilePathMatch("AscLM.vxd"), "AegiSoft License Manager"),
+ new(new FilePathMatch("AscLMd.vxd"), "AegiSoft License Manager"),
// There are a few other files present, but the file names on their own may be too overmatching. Due to the small sample size, it's not sure if these files are always present together.
// These files are "Asc001.dll", "Asc002.dll", "Asc003.dll", "Asc005.dll", and "Asc006.exe" (Found in Redump entry 73521/IA item "Nova_HoyleCasino99USA").
diff --git a/BinaryObjectScanner/Protection/AlphaDVD.cs b/BinaryObjectScanner/Protection/AlphaDVD.cs
index 226f6667..e60f9736 100644
--- a/BinaryObjectScanner/Protection/AlphaDVD.cs
+++ b/BinaryObjectScanner/Protection/AlphaDVD.cs
@@ -26,7 +26,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("PlayDVD.exe", useEndsWith: true), "Alpha-DVD (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("PlayDVD.exe"), "Alpha-DVD (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -37,7 +37,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("PlayDVD.exe", useEndsWith: true), "Alpha-DVD (Unconfirmed - Please report to us on Github"),
+ new(new FilePathMatch("PlayDVD.exe"), "Alpha-DVD (Unconfirmed - Please report to us on Github"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Bitpool.cs b/BinaryObjectScanner/Protection/Bitpool.cs
index a13b129d..08875ae0 100644
--- a/BinaryObjectScanner/Protection/Bitpool.cs
+++ b/BinaryObjectScanner/Protection/Bitpool.cs
@@ -23,15 +23,15 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("bitpool.rsc", useEndsWith: true), "Bitpool"),
- new PathMatchSet(new FilePathMatch("CD.IDX"), "Bitpool"),
+ new(new FilePathMatch("bitpool.rsc"), "Bitpool"),
+ new(new FilePathMatch("CD.IDX"), "Bitpool"),
// Completely empty file present on multiple discs with Bitpool (Redump entries 52626 and 50229).
- new PathMatchSet(new PathMatch("LEADOUT.OFS", useEndsWith: true), "Bitpool"),
+ new(new FilePathMatch("LEADOUT.OFS"), "Bitpool"),
// A set of 4 identically sized (within the same game, not between games), corrupted/padded files present in several games (Redump entries 31782 and 35476).
// Both examples with only having the first letter uppercase and as the whole file name being uppercase have been seen.
- new PathMatchSet(new List
+ new(new List
{
new FilePathMatch("Crc_a"),
new FilePathMatch("Crc_b"),
@@ -48,11 +48,11 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("bitpool.rsc", useEndsWith: true), "Bitpool"),
- new PathMatchSet(new FilePathMatch("CD.IDX"), "Bitpool"),
+ new(new FilePathMatch("bitpool.rsc"), "Bitpool"),
+ new(new FilePathMatch("CD.IDX"), "Bitpool"),
// Completely empty file present on multiple discs with Bitpool (Redump entries 52626 and 50229).
- new PathMatchSet(new PathMatch("LEADOUT.OFS", useEndsWith: true), "Bitpool"),
+ new(new FilePathMatch("LEADOUT.OFS"), "Bitpool"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/ByteShield.cs b/BinaryObjectScanner/Protection/ByteShield.cs
index 8d75a868..16c5f204 100644
--- a/BinaryObjectScanner/Protection/ByteShield.cs
+++ b/BinaryObjectScanner/Protection/ByteShield.cs
@@ -142,8 +142,8 @@ namespace BinaryObjectScanner.Protection
// Files with the ".bbz" extension are associated with ByteShield, but the extenstion is known to be used in other places as well.
var matchers = new List
{
- new PathMatchSet(new PathMatch("Byteshield.dll", useEndsWith: true), "ByteShield Component Module"),
- new PathMatchSet(new PathMatch("Byteshield.ini", useEndsWith: true), "ByteShield"),
+ new(new FilePathMatch("Byteshield.dll"), "ByteShield Component Module"),
+ new(new FilePathMatch("Byteshield.ini"), "ByteShield"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -156,8 +156,8 @@ namespace BinaryObjectScanner.Protection
// Files with the ".bbz" extension are associated with ByteShield, but the extenstion is known to be used in other places as well.
var matchers = new List
{
- new PathMatchSet(new PathMatch("Byteshield.dll", useEndsWith: true), "ByteShield Component Module"),
- new PathMatchSet(new PathMatch("Byteshield.ini", useEndsWith: true), "ByteShield"),
+ new(new FilePathMatch("Byteshield.dll"), "ByteShield Component Module"),
+ new(new FilePathMatch("Byteshield.ini"), "ByteShield"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/CDDVDCops.cs b/BinaryObjectScanner/Protection/CDDVDCops.cs
index a50c7eb8..eba149c6 100644
--- a/BinaryObjectScanner/Protection/CDDVDCops.cs
+++ b/BinaryObjectScanner/Protection/CDDVDCops.cs
@@ -78,14 +78,14 @@ namespace BinaryObjectScanner.Protection
{
// TODO: Remove from here once it's confirmed that no PE executables contain this string
// CD-Cops, ver.
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x43, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C,
0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20
}, GetVersion, "CD-Cops (Unconfirmed - Please report to us on Github)"),
// // DVD-Cops, ver.
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x44, 0x56, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73,
0x2C, 0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20
@@ -111,7 +111,7 @@ namespace BinaryObjectScanner.Protection
{
// CD-Cops, ver.
// Found in "h3blade.exe" in Redump entry 85077.
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x43, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C,
0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20
@@ -157,7 +157,7 @@ namespace BinaryObjectScanner.Protection
{
// WEBCOPS
// Found in "HyperBowl.C_S" in https://web.archive.org/web/20120616074941/http://icm.games.tucows.com/files2/HyperDemo-109a.exe.
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x57, 0x45, 0x42, 0x43, 0x4F, 0x50, 0x53
}, "WEB-Cops")
@@ -197,12 +197,12 @@ namespace BinaryObjectScanner.Protection
// Presumably used to increase the amount of data written to the disc to allow DPM checking to be used for the protection. It's unknown if this file is used on any other protected discs.
// Found in Redump entry 84517.
- new PathMatchSet(new PathMatch("CDCOPS.DLL", useEndsWith: true), "CD-Cops"),
- new PathMatchSet(new PathMatch(".W_X", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
- new PathMatchSet(new PathMatch(".QZ_", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
+ new(new PathMatch("CDCOPS.DLL", useEndsWith: true), "CD-Cops"),
+ new(new PathMatch(".W_X", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
+ new(new PathMatch(".QZ_", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
- new PathMatchSet(new PathMatch(".GZ_", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch(".Qz", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
+ new(new PathMatch(".GZ_", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
+ new(new PathMatch(".Qz", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -217,12 +217,12 @@ namespace BinaryObjectScanner.Protection
// Presumably used to increase the amount of data written to the disc to allow DPM checking to be used for the protection. It's unknown if this file is used on any other protected discs.
// Found in Redump entry 84517.
- new PathMatchSet(new PathMatch("CDCOPS.DLL", useEndsWith: true), "CD-Cops"),
- new PathMatchSet(new PathMatch(".W_X", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
- new PathMatchSet(new PathMatch(".QZ_", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
+ new(new PathMatch("CDCOPS.DLL", useEndsWith: true), "CD-Cops"),
+ new(new PathMatch(".W_X", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
+ new(new PathMatch(".QZ_", matchExact: true, useEndsWith: true), "CD/DVD-Cops"),
- new PathMatchSet(new PathMatch(".GZ_", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch(".Qz", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
+ new(new PathMatch(".GZ_", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
+ new(new PathMatch(".Qz", matchExact: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/CDGuard.cs b/BinaryObjectScanner/Protection/CDGuard.cs
index f84bff21..4b2be046 100644
--- a/BinaryObjectScanner/Protection/CDGuard.cs
+++ b/BinaryObjectScanner/Protection/CDGuard.cs
@@ -66,7 +66,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in Redump entry 97142.
- new PathMatchSet(new PathMatch("cdguard.dll", useEndsWith: true), "CD-Guard Copy Protection System"),
+ new(new FilePathMatch("cdguard.dll"), "CD-Guard Copy Protection System"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -78,7 +78,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in Redump entry 97142.
- new PathMatchSet(new PathMatch("cdguard.dll", useEndsWith: true), "CD-Guard Copy Protection System"),
+ new(new FilePathMatch("cdguard.dll"), "CD-Guard Copy Protection System"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/CDLock.cs b/BinaryObjectScanner/Protection/CDLock.cs
index d9095b2f..9aeb3964 100644
--- a/BinaryObjectScanner/Protection/CDLock.cs
+++ b/BinaryObjectScanner/Protection/CDLock.cs
@@ -45,7 +45,7 @@ namespace BinaryObjectScanner.Protection
// Found in game executables protected with CD-Lock (Redump entries 24287 and 31615).
// TODO: Check for possible false postives (Redump entry 97942).
// 2 + (char)0xF2 + (char)0x02 + (char)0x82 + (char)0xC3 + (char)0xBC + (char)0x0B + $ + (char)0x99 + (char)0xAD + 'C + (char)0xE4 + (char)0x9D + st + (char)0x99 + (char)0xFA + 2$ + (char)0x9D + )4 + (char)0xFF + t
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x32, 0xF2, 0x02, 0x82, 0xC3, 0xBC, 0x0B, 0x24,
0x99, 0xAD, 0x27, 0x43, 0xE4, 0x9D, 0x73, 0x74,
@@ -74,7 +74,7 @@ namespace BinaryObjectScanner.Protection
// TODO: Determine if there's any consistency in the naming of the additional AFP files.
// Found in every confirmed sample of CD-Lock, generally (but not always) appears to include markers relating to the additional AFP files present (Redump entries 24287 and 31615).
- new PathMatchSet(new PathMatch("CONFIG.AFP", useEndsWith: true), "CD-Lock"),
+ new(new PathMatch("CONFIG.AFP", useEndsWith: true), "CD-Lock"),
// There is also a "$$$$$$$$.$$$" file present on some discs, but it isn't known if this is directly related to CD-Lock (Redump entries 37788 and 43221).
};
@@ -90,7 +90,7 @@ namespace BinaryObjectScanner.Protection
// TODO: Determine if there's any consistency in the naming of the additional AFP files.
// Found in every confirmed sample of CD-Lock, generally (but not always) appears to include markers relating to the additional AFP files present (Redump entries 24287 and 31615).
- new PathMatchSet(new PathMatch("CONFIG.AFP", useEndsWith: true), "CD-Lock"),
+ new(new PathMatch("CONFIG.AFP", useEndsWith: true), "CD-Lock"),
// There is also a "$$$$$$$$.$$$" file present on some discs, but it isn't known if this is directly related to CD-Lock (Redump entries 37788 and 43221).
};
diff --git a/BinaryObjectScanner/Protection/CDProtector.cs b/BinaryObjectScanner/Protection/CDProtector.cs
index ce42c038..0d3f71e5 100644
--- a/BinaryObjectScanner/Protection/CDProtector.cs
+++ b/BinaryObjectScanner/Protection/CDProtector.cs
@@ -32,13 +32,13 @@ namespace BinaryObjectScanner.Protection
// "_cdp32.dat" is actually an archive that contains the original executable.
// Another EXE is created, with the name of the original executable. I'm not sure what this executable does, but it appears to be compressed with NeoLite.
// TODO: Invesitage if this EXE itself can be detected in any way.
- new PathMatchSet(new PathMatch("_cdp16.dat", useEndsWith: true), "CD-Protector"),
- new PathMatchSet(new PathMatch("_cdp16.dll", useEndsWith: true), "CD-Protector"),
- new PathMatchSet(new PathMatch("_cdp32.dat", useEndsWith: true), "CD-Protector"),
- new PathMatchSet(new PathMatch("_cdp32.dll", useEndsWith: true), "CD-Protector"),
+ new(new FilePathMatch("_cdp16.dat"), "CD-Protector"),
+ new(new FilePathMatch("_cdp16.dll"), "CD-Protector"),
+ new(new FilePathMatch("_cdp32.dat"), "CD-Protector"),
+ new(new FilePathMatch("_cdp32.dll"), "CD-Protector"),
// This is the "Phantom Trax" file generated by CD-Protector, intended to be burned to a protected CD as an audio track.
- new PathMatchSet(new PathMatch("Track#1 - Track#2 Cd-Protector.wav", useEndsWith: true), "CD-Protector"),
+ new(new FilePathMatch("Track#1 - Track#2 Cd-Protector.wav"), "CD-Protector"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -54,13 +54,13 @@ namespace BinaryObjectScanner.Protection
// "_cdp32.dat" is actually an archive that contains the original executable.
// Another EXE is created, with the name of the original executable. I'm not sure what this executable does, but it appears to be compressed with NeoLite.
// TODO: Invesitage if this EXE itself can be detected in any way.
- new PathMatchSet(new PathMatch("_cdp16.dat", useEndsWith: true), "CD-Protector"),
- new PathMatchSet(new PathMatch("_cdp16.dll", useEndsWith: true), "CD-Protector"),
- new PathMatchSet(new PathMatch("_cdp32.dat", useEndsWith: true), "CD-Protector"),
- new PathMatchSet(new PathMatch("_cdp32.dll", useEndsWith: true), "CD-Protector"),
+ new(new FilePathMatch("_cdp16.dat"), "CD-Protector"),
+ new(new FilePathMatch("_cdp16.dll"), "CD-Protector"),
+ new(new FilePathMatch("_cdp32.dat"), "CD-Protector"),
+ new(new FilePathMatch("_cdp32.dll"), "CD-Protector"),
// This is the "Phantom Trax" file generated by CD-Protector, intended to be burned to a protected CD as an audio track.
- new PathMatchSet(new PathMatch("Track#1 - Track#2 Cd-Protector.wav", useEndsWith: true), "CD-Protector"),
+ new(new FilePathMatch("Track#1 - Track#2 Cd-Protector.wav"), "CD-Protector"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/CDX.cs b/BinaryObjectScanner/Protection/CDX.cs
index bfbddf46..15c8afe9 100644
--- a/BinaryObjectScanner/Protection/CDX.cs
+++ b/BinaryObjectScanner/Protection/CDX.cs
@@ -19,9 +19,9 @@ namespace BinaryObjectScanner.Protection
// TODO: Verify if these are OR or AND
var matchers = new List
{
- new PathMatchSet(new PathMatch("CHKCDX16.DLL", useEndsWith: true), "CD-X (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch("CHKCDX32.DLL", useEndsWith: true), "CD-X (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch("CHKCDXNT.DLL", useEndsWith: true), "CD-X (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("CHKCDX16.DLL"), "CD-X (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("CHKCDX32.DLL"), "CD-X (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("CHKCDXNT.DLL"), "CD-X (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -32,9 +32,9 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("CHKCDX16.DLL", useEndsWith: true), "CD-X (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch("CHKCDX32.DLL", useEndsWith: true), "CD-X (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch("CHKCDXNT.DLL", useEndsWith: true), "CD-X (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("CHKCDX16.DLL"), "CD-X (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("CHKCDX32.DLL"), "CD-X (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("CHKCDXNT.DLL"), "CD-X (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/CactusDataShield.cs b/BinaryObjectScanner/Protection/CactusDataShield.cs
index d6002538..11f28d7f 100644
--- a/BinaryObjectScanner/Protection/CactusDataShield.cs
+++ b/BinaryObjectScanner/Protection/CactusDataShield.cs
@@ -17,10 +17,10 @@ namespace BinaryObjectScanner.Protection
var contentMatchSets = new List
{
// CDSPlayer
- new ContentMatchSet(new byte?[] { 0x43, 0x44, 0x53, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72 }, "Cactus Data Shield 200"),
+ new(new byte?[] { 0x43, 0x44, 0x53, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72 }, "Cactus Data Shield 200"),
// yucca.cds
- new ContentMatchSet(new byte?[] { 0x79, 0x75, 0x63, 0x63, 0x61, 0x2E, 0x63, 0x64, 0x73 }, "Cactus Data Shield 200"),
+ new(new byte?[] { 0x79, 0x75, 0x63, 0x63, 0x61, 0x2E, 0x63, 0x64, 0x73 }, "Cactus Data Shield 200"),
};
if (contentMatchSets != null && contentMatchSets.Any())
diff --git a/BinaryObjectScanner/Protection/CenegaProtectDVD.cs b/BinaryObjectScanner/Protection/CenegaProtectDVD.cs
index add43b44..b22b8e40 100644
--- a/BinaryObjectScanner/Protection/CenegaProtectDVD.cs
+++ b/BinaryObjectScanner/Protection/CenegaProtectDVD.cs
@@ -65,7 +65,7 @@ namespace BinaryObjectScanner.Protection
{
// Seems likely to be present in most, if not all discs protected with Cenega ProtectDVD, but unable to confirm due to only having a small sample size.
// Found in Redump entry 31422 and IA item "speed-pack".
- new PathMatchSet(new PathMatch("cenega.dll", useEndsWith: true), "Cenega ProtectDVD"),
+ new(new FilePathMatch("cenega.dll"), "Cenega ProtectDVD"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -78,7 +78,7 @@ namespace BinaryObjectScanner.Protection
{
// Seems likely to be present in most, if not all discs protected with Cenega ProtectDVD, but unable to confirm due to only having a small sample size.
// Found in Redump entry 31422 and IA item "speed-pack".
- new PathMatchSet(new PathMatch("cenega.dll", useEndsWith: true), "Cenega ProtectDVD"),
+ new(new FilePathMatch("cenega.dll"), "Cenega ProtectDVD"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs b/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs
index f9eeabc9..e0e37cec 100644
--- a/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs
+++ b/BinaryObjectScanner/Protection/ChosenBytesCodeLock.cs
@@ -65,10 +65,10 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in the installation directory of Code-Lock version 2.35.
- new PathMatchSet(new PathMatch("Code-Lock.chm", useEndsWith: true), "ChosenBytes Code-Lock"),
- new PathMatchSet(new PathMatch("Code-Lock.DEP", useEndsWith: true), "ChosenBytes Code-Lock"),
- new PathMatchSet(new PathMatch("Code-Lock.ocx", useEndsWith: true), "ChosenBytes Code-Lock"),
- new PathMatchSet(new PathMatch("Code-Lock Wizard.exe", useEndsWith: true), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock.chm"), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock.DEP"), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock.ocx"), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock Wizard.exe"), "ChosenBytes Code-Lock"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -80,10 +80,10 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in the installation directory of Code-Lock version 2.35.
- new PathMatchSet(new PathMatch("Code-Lock.chm", useEndsWith: true), "ChosenBytes Code-Lock"),
- new PathMatchSet(new PathMatch("Code-Lock.DEP", useEndsWith: true), "ChosenBytes Code-Lock"),
- new PathMatchSet(new PathMatch("Code-Lock.ocx", useEndsWith: true), "ChosenBytes Code-Lock"),
- new PathMatchSet(new PathMatch("Code-Lock Wizard.exe", useEndsWith: true), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock.chm"), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock.DEP"), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock.ocx"), "ChosenBytes Code-Lock"),
+ new(new FilePathMatch("Code-Lock Wizard.exe"), "ChosenBytes Code-Lock"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/CopyKiller.cs b/BinaryObjectScanner/Protection/CopyKiller.cs
index a7411d54..423e62c1 100644
--- a/BinaryObjectScanner/Protection/CopyKiller.cs
+++ b/BinaryObjectScanner/Protection/CopyKiller.cs
@@ -18,7 +18,7 @@ namespace BinaryObjectScanner.Protection
var contentMatchSets = new List
{
// Tom Commander
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x54, 0x6F, 0x6D, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
0x61, 0x6E, 0x64, 0x65, 0x72
@@ -42,7 +42,7 @@ namespace BinaryObjectScanner.Protection
// TODO: Look into .PFF files as an indicator. At least one disc has those oversized files
var matchers = new List
{
- //new PathMatchSet(new PathMatch("Autorun.dat", useEndsWith: true), "CopyKiller"),
+ //new(new PathMatch("Autorun.dat", useEndsWith: true), "CopyKiller"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -55,7 +55,7 @@ namespace BinaryObjectScanner.Protection
// TODO: Look into .PFF files as an indicator. At least one disc has those oversized files
var matchers = new List
{
- //new PathMatchSet(new PathMatch("Autorun.dat", useEndsWith: true), "CopyKiller"),
+ //new(new PathMatch("Autorun.dat", useEndsWith: true), "CopyKiller"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Cucko.cs b/BinaryObjectScanner/Protection/Cucko.cs
index 79f3dd66..d29309d1 100644
--- a/BinaryObjectScanner/Protection/Cucko.cs
+++ b/BinaryObjectScanner/Protection/Cucko.cs
@@ -29,7 +29,7 @@ namespace BinaryObjectScanner.Protection
{
// Confirmed to detect most examples known of Cucko. The only known exception is the version of "TSLHost.dll" included on Redump entry 36119.
// ŠU‰8...…™...ŠUŠ8T...
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x8A, 0x55, 0x89, 0x38, 0x14, 0x1E, 0x0F, 0x85,
0x99, 0x00, 0x00, 0x00, 0x8A, 0x55, 0x8A, 0x38,
diff --git a/BinaryObjectScanner/Protection/DVDCrypt.cs b/BinaryObjectScanner/Protection/DVDCrypt.cs
index 3bddf13d..1a7320d0 100644
--- a/BinaryObjectScanner/Protection/DVDCrypt.cs
+++ b/BinaryObjectScanner/Protection/DVDCrypt.cs
@@ -18,7 +18,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("DvdCrypt.pdb", useEndsWith: true), "DVD Crypt (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("DvdCrypt.pdb"), "DVD Crypt (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -29,7 +29,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("DvdCrypt.pdb", useEndsWith: true), "DVD Crypt (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("DvdCrypt.pdb"), "DVD Crypt (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/DVDMoviePROTECT.cs b/BinaryObjectScanner/Protection/DVDMoviePROTECT.cs
index a3bb83b4..75c0c891 100644
--- a/BinaryObjectScanner/Protection/DVDMoviePROTECT.cs
+++ b/BinaryObjectScanner/Protection/DVDMoviePROTECT.cs
@@ -31,11 +31,11 @@ namespace BinaryObjectScanner.Protection
string[] bupfiles = files.Where(s => s.EndsWith(".bup")).ToArray();
for (int i = 0; i < bupfiles.Length; i++)
{
- FileInfo bupfile = new FileInfo(bupfiles[i]);
+ var bupfile = new FileInfo(bupfiles[i]);
if (bupfile.DirectoryName == null)
continue;
- FileInfo ifofile = new FileInfo(Path.Combine(bupfile.DirectoryName, bupfile.Name.Substring(0, bupfile.Name.Length - bupfile.Extension.Length) + ".ifo"));
+ var ifofile = new FileInfo(Path.Combine(bupfile.DirectoryName, bupfile.Name.Substring(0, bupfile.Name.Length - bupfile.Extension.Length) + ".ifo"));
if (bupfile.Length != ifofile.Length)
{
protections.Enqueue("DVD-Movie-PROTECT (Unconfirmed - Please report to us on Github)");
diff --git a/BinaryObjectScanner/Protection/Denuvo.cs b/BinaryObjectScanner/Protection/Denuvo.cs
index 99aa6266..cd4c0b2b 100644
--- a/BinaryObjectScanner/Protection/Denuvo.cs
+++ b/BinaryObjectScanner/Protection/Denuvo.cs
@@ -78,7 +78,7 @@ namespace BinaryObjectScanner.Protection
var timingMatchers = new List
{
// Denuvo Timing
- new ContentMatchSet(
+ new(
new byte?[]
{
0x44, 0x65, 0x6E, 0x75, 0x76, 0x6F, 0x20, 0x54,
@@ -268,12 +268,12 @@ namespace BinaryObjectScanner.Protection
// Found in Doom Eternal Update 1 (Steam Depot 782332, Manifest 7064393210727378308).
// These files are automatically installed into an "Denuvo Anti-Cheat" folder when the game is installed.
- new PathMatchSet(new PathMatch("denuvo-anti-cheat.sys", useEndsWith: true), "Denuvo Anti-Cheat"),
- new PathMatchSet(new PathMatch("denuvo-anti-cheat-update-service.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
- new PathMatchSet(new PathMatch("denuvo-anti-cheat-runtime.dll", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("denuvo-anti-cheat.sys", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("denuvo-anti-cheat-update-service.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("denuvo-anti-cheat-runtime.dll", useEndsWith: true), "Denuvo Anti-Cheat"),
// This file is a renamed copy of "denuvo-anti-cheat-update-service.exe" which is only seen in the folder of the main game executable after it has been run, but before Denuvo Anti-Cheat is finished installing.
- new PathMatchSet(new PathMatch("Denuvo Anti-Cheat Installer.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("Denuvo Anti-Cheat Installer.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -287,12 +287,12 @@ namespace BinaryObjectScanner.Protection
// Found in Doom Eternal Update 1 (Steam Depot 782332, Manifest 7064393210727378308).
// These files are automatically installed into an "Denuvo Anti-Cheat" folder when the game is installed.
- new PathMatchSet(new PathMatch("denuvo-anti-cheat.sys", useEndsWith: true), "Denuvo Anti-Cheat"),
- new PathMatchSet(new PathMatch("denuvo-anti-cheat-update-service.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
- new PathMatchSet(new PathMatch("denuvo-anti-cheat-runtime.dll", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("denuvo-anti-cheat.sys", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("denuvo-anti-cheat-update-service.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("denuvo-anti-cheat-runtime.dll", useEndsWith: true), "Denuvo Anti-Cheat"),
// This file is a renamed copy of "denuvo-anti-cheat-update-service.exe" which is only seen in the folder of the main game executable after it has been run, but before Denuvo Anti-Cheat is finished installing.
- new PathMatchSet(new PathMatch("Denuvo Anti-Cheat Installer.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
+ new(new PathMatch("Denuvo Anti-Cheat Installer.exe", useEndsWith: true), "Denuvo Anti-Cheat"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/DigiGuard.cs b/BinaryObjectScanner/Protection/DigiGuard.cs
index 8cb5be8d..fa8194ca 100644
--- a/BinaryObjectScanner/Protection/DigiGuard.cs
+++ b/BinaryObjectScanner/Protection/DigiGuard.cs
@@ -64,7 +64,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in IA item "Nova_DellBigWIGDVD_USA"/Redump entry 108588.
- new PathMatchSet(new FilePathMatch("DecryptWrap.exe"), "DigiGuard"),
+ new(new FilePathMatch("DecryptWrap.exe"), "DigiGuard"),
// There are at least two additional specifically named DecryptWrap files, "DecryptWrapTW2000.exe" and "DecryptWrapTW2KCode.exe" in IA item "Nova_DellBigWIGDVD_USA"/Redump entry 108588.
};
@@ -78,7 +78,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in IA item "Nova_DellBigWIGDVD_USA"/Redump entry 108588.
- new PathMatchSet(new FilePathMatch("DecryptWrap.exe"), "DigiGuard"),
+ new(new FilePathMatch("DecryptWrap.exe"), "DigiGuard"),
// There are at least two additional specifically named DecryptWrap files, "DecryptWrapTW2000.exe" and "DecryptWrapTW2KCode.exe" in IA item "Nova_DellBigWIGDVD_USA"/Redump entry 108588.
};
diff --git a/BinaryObjectScanner/Protection/DinamicMultimedia.cs b/BinaryObjectScanner/Protection/DinamicMultimedia.cs
index 71312826..2631701c 100644
--- a/BinaryObjectScanner/Protection/DinamicMultimedia.cs
+++ b/BinaryObjectScanner/Protection/DinamicMultimedia.cs
@@ -35,13 +35,13 @@ namespace BinaryObjectScanner.Protection
// Many more checks are likely possible based on the sources, but only ones that have been personally verified are getting added.
// Uncopyable files found in at least http://redump.org/disc/70531/, and likely in multiple others.
- new PathMatchSet(new PathMatch(Path.Combine("XCONTROL", "COMPPLAY._01").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch(Path.Combine("XCONTROL", "LANDER.DA0").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch(Path.Combine("XCONTROL", "XSMGOP.DAP").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch(Path.Combine("XCONTROL", "XSMGOP.VBX").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch(Path.Combine("XCONTROL", "COMPPLAY._01").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch(Path.Combine("XCONTROL", "LANDER.DA0").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch(Path.Combine("XCONTROL", "XSMGOP.DAP").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch(Path.Combine("XCONTROL", "XSMGOP.VBX").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
// Copyable file found in http://redump.org/disc/70531/ that seems to be exclusively associated with the protection and other files that are part of the protection.
- new PathMatchSet(new PathMatch(Path.Combine("XCONTROL", "COMPSCO._01").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch(Path.Combine("XCONTROL", "COMPSCO._01").Replace("\\", "/"), useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -55,15 +55,15 @@ namespace BinaryObjectScanner.Protection
// Many more checks are likely possible based on the sources, but only ones that have been personally verified are getting added.
// Uncopyable files found in at least http://redump.org/disc/70531/, and likely in multiple others.
- new PathMatchSet(new PathMatch("2kscore.sc0", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("arrcalc.obj", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("bdrvisa.drv", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("gprinter.dll", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("hstadium.ipx", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("omanager.odl", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("opublic.001", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("spland.sc0", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
- new PathMatchSet(new PathMatch("uqprime.ipx", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("2kscore.sc0", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("arrcalc.obj", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("bdrvisa.drv", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("gprinter.dll", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("hstadium.ipx", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("omanager.odl", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("opublic.001", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("spland.sc0", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
+ new(new PathMatch("uqprime.ipx", useEndsWith: true), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/DiscGuard.cs b/BinaryObjectScanner/Protection/DiscGuard.cs
index 66e9a9ca..1d89431c 100644
--- a/BinaryObjectScanner/Protection/DiscGuard.cs
+++ b/BinaryObjectScanner/Protection/DiscGuard.cs
@@ -84,7 +84,7 @@ namespace BinaryObjectScanner.Protection
{
// Found in "T29.dll" (Redump entry 31914).
// This check should be as long as the following check, as this data is nearly identical (including length) in the original files, but for some reason the section ends early, causing part of the remaining data to not be part of a section.
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x7B, 0x39, 0x8F, 0x07, 0x47, 0xE9, 0x96, 0x8C, 0xCA, 0xB2, 0x5C, 0x50,
0xC7, 0x5A, 0x18, 0xBD, 0x75, 0xB5, 0x68, 0x6A, 0x78, 0xB5, 0xCF, 0xF2,
@@ -102,7 +102,7 @@ namespace BinaryObjectScanner.Protection
}, GetVersion, "DiscGuard"),
// Found in "T5375.dll" (Redump entry 79284), "TD352.dll" and "TE091.dll" (Redump entry 46743), "T71E1.dll" and "T7181.dll" (Redump entry 46961), and "TA0E4.DLL" (Redump entry 79374).
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x7B, 0x39, 0x8F, 0x07, 0x45, 0xE9, 0x96, 0x8C, 0xCA, 0xB2, 0x5C, 0x50,
0xC7, 0x5A, 0x18, 0xBD, 0x75, 0xB5, 0x68, 0x6A, 0x78, 0xB5, 0xCF, 0xF2,
@@ -148,24 +148,24 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found together in seemingly every DiscGuard game (Redump entries 31914, 46743, 46961, 79284, and 79374).
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("IOSLINK.VXD", useEndsWith: true),
- new PathMatch("IOSLINK.SYS", useEndsWith: true),
+ new FilePathMatch("IOSLINK.VXD"),
+ new FilePathMatch("IOSLINK.SYS"),
}, "DiscGuard"),
// Found together in one DiscGuard game (Redump entry 31914).
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("TTR1.DLL", useEndsWith: true),
- new PathMatch("TTR2.DLL", useEndsWith: true),
+ new FilePathMatch("TTR1.DLL"),
+ new FilePathMatch("TTR2.DLL"),
}, "DiscGuard"),
// Found together in most DiscGuard games (Redump entries 46743, 46961, 79284, and 79374).
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("T111.DLL", useEndsWith: true),
- new PathMatch("T222.DLL", useEndsWith: true),
+ new FilePathMatch("T111.DLL"),
+ new FilePathMatch("T222.DLL"),
}, "DiscGuard"),
};
@@ -178,11 +178,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found together in seemingly every DiscGuard game (Redump entries 31914, 46743, 46961, 79284, and 79374).
- new PathMatchSet(new PathMatch("IOSLINK.VXD", useEndsWith: true), "DiscGuard"),
- new PathMatchSet(new PathMatch("IOSLINK.SYS", useEndsWith: true), "DiscGuard"),
+ new(new FilePathMatch("IOSLINK.VXD"), "DiscGuard"),
+ new(new FilePathMatch("IOSLINK.SYS"), "DiscGuard"),
// IOSLINK.DLL doesn't seem to be present in any known samples, but a check for it was in the original BurnOut.
- new PathMatchSet(new PathMatch("IOSLINK.DLL", useEndsWith: true), "DiscGuard (Unconfirmed check, report this to us on GitHub))"),
+ new(new FilePathMatch("IOSLINK.DLL"), "DiscGuard (Unconfirmed check, report this to us on GitHub))"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -218,11 +218,9 @@ namespace BinaryObjectScanner.Protection
{
try
{
- using (Stream fileStream = File.Open(firstMatchedString, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- var pex = PortableExecutable.Create(fileStream);
- return pex?.GetInternalVersion() ?? string.Empty;
- }
+ using Stream fileStream = File.Open(firstMatchedString, FileMode.Open, FileAccess.Read, FileShare.Read);
+ var pex = PortableExecutable.Create(fileStream);
+ return pex?.GetInternalVersion() ?? string.Empty;
}
catch
{
diff --git a/BinaryObjectScanner/Protection/EasyAntiCheat.cs b/BinaryObjectScanner/Protection/EasyAntiCheat.cs
index 43b4727d..d7cee163 100644
--- a/BinaryObjectScanner/Protection/EasyAntiCheat.cs
+++ b/BinaryObjectScanner/Protection/EasyAntiCheat.cs
@@ -92,41 +92,42 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found installed in "Program Files (x86)\EasyAntiCheat".
- new PathMatchSet(new PathMatch("EasyAntiCheat.exe", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat.sys", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.exe"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.sys"), "Easy Anti-Cheat"),
// Found installed in "Program Files (x86)\EasyAntiCheat_EOS".
- new PathMatchSet(new PathMatch("EasyAntiCheat_EOS.exe", useEndsWith: true), "Easy Anti-Cheat (EOS Version)"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_EOS.sys", useEndsWith: true), "Easy Anti-Cheat (EOS Version)"),
+ new(new FilePathMatch("EasyAntiCheat_EOS.exe"), "Easy Anti-Cheat (EOS Version)"),
+ new(new FilePathMatch("EasyAntiCheat_EOS.sys"), "Easy Anti-Cheat (EOS Version)"),
// Found installed in "AppData\Roaming\EasyAntiCheat".
- new PathMatchSet(new PathMatch("easyanticheat_wow64_x64.eac", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat_wow64_x64.eac.metadata", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheatAnimation.png", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat_wow64_x64.eac"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat_wow64_x64.eac.metadata"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheatAnimation.png"), "Easy Anti-Cheat"),
// Found in "Intruder" (Version 2287, Steam).
- new PathMatchSet(new PathMatch("eac_server.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat.icns", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat.Client.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat.Server.dll", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("eac_server.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat.icns"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.Client.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.Server.dll"), "Easy Anti-Cheat"),
+
// Found in "Intruder" (Version 2287, Steam) and "Rec Room" (Version 20220803, Oculus).
- new PathMatchSet(new PathMatch("EasyAntiCheat.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_Setup.exe", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_x64.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_x86.dll", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_Setup.exe"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_x64.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_x86.dll"), "Easy Anti-Cheat"),
// Found in "Video Horror Society" (Patch 1.0.70309, Steam).
- new PathMatchSet(new PathMatch("EasyAntiCheat_EOS_Setup.exe", useEndsWith: true), "Easy Anti-Cheat (EOS Version)"),
- new PathMatchSet(new PathMatch("InstallAntiCheat.bat", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("UninstallAntiCheat.bat", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_EOS_Setup.exe"), "Easy Anti-Cheat (EOS Version)"),
+ new(new FilePathMatch("InstallAntiCheat.bat"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("UninstallAntiCheat.bat"), "Easy Anti-Cheat"),
// Found in "VRChat" (Version 2022.2.2p2, Oculus).
- new PathMatchSet(new PathMatch("start_protected_game.exe", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("start_protected_game.exe"), "Easy Anti-Cheat"),
// Found in "Apex Legends" (Build ID 12029216, Steam)
- new PathMatchSet(new PathMatch("EasyAntiCheat_launcher.exe", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat_x64.so", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_launcher.exe"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat_x64.so"), "Easy Anti-Cheat"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -139,41 +140,41 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found installed in "Program Files (x86)\EasyAntiCheat".
- new PathMatchSet(new PathMatch("EasyAntiCheat.exe", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat.sys", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.exe"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.sys"), "Easy Anti-Cheat"),
// Found installed in "Program Files (x86)\EasyAntiCheat_EOS".
- new PathMatchSet(new PathMatch("EasyAntiCheat_EOS.exe", useEndsWith: true), "Easy Anti-Cheat (EOS Version)"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_EOS.sys", useEndsWith: true), "Easy Anti-Cheat (EOS Version)"),
+ new(new FilePathMatch("EasyAntiCheat_EOS.exe"), "Easy Anti-Cheat (EOS Version)"),
+ new(new FilePathMatch("EasyAntiCheat_EOS.sys"), "Easy Anti-Cheat (EOS Version)"),
// Found installed in "AppData\Roaming\EasyAntiCheat".
- new PathMatchSet(new PathMatch("easyanticheat_wow64_x64.eac", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat_wow64_x64.eac.metadata", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheatAnimation.png", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat_wow64_x64.eac"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat_wow64_x64.eac.metadata"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheatAnimation.png"), "Easy Anti-Cheat"),
// Found in "Intruder" (Version 2287, Steam).
- new PathMatchSet(new PathMatch("eac_server.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat.icns", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat.Client.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat.Server.dll", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("eac_server.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat.icns"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.Client.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.Server.dll"), "Easy Anti-Cheat"),
// Found in "Intruder" (Version 2287, Steam) and "Rec Room" (Version 20220803, Oculus).
- new PathMatchSet(new PathMatch("EasyAntiCheat.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_Setup.exe", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_x64.dll", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("EasyAntiCheat_x86.dll", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_Setup.exe"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_x64.dll"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_x86.dll"), "Easy Anti-Cheat"),
// Found in "Video Horror Society" (Patch 1.0.70309, Steam).
- new PathMatchSet(new PathMatch("EasyAntiCheat_EOS_Setup.exe", useEndsWith: true), "Easy Anti-Cheat (EOS Version)"),
- new PathMatchSet(new PathMatch("InstallAntiCheat.bat", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("UninstallAntiCheat.bat", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_EOS_Setup.exe"), "Easy Anti-Cheat (EOS Version)"),
+ new(new FilePathMatch("InstallAntiCheat.bat"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("UninstallAntiCheat.bat"), "Easy Anti-Cheat"),
// Found in "VRChat" (Version 2022.2.2p2, Oculus).
- new PathMatchSet(new PathMatch("start_protected_game.exe", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("start_protected_game.exe"), "Easy Anti-Cheat"),
// Found in "Apex Legends" (Build ID 12029216, Steam)
- new PathMatchSet(new PathMatch("EasyAntiCheat_launcher.exe", useEndsWith: true), "Easy Anti-Cheat"),
- new PathMatchSet(new PathMatch("easyanticheat_x64.so", useEndsWith: true), "Easy Anti-Cheat"),
+ new(new FilePathMatch("EasyAntiCheat_launcher.exe"), "Easy Anti-Cheat"),
+ new(new FilePathMatch("easyanticheat_x64.so"), "Easy Anti-Cheat"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/FreeLock.cs b/BinaryObjectScanner/Protection/FreeLock.cs
index 1db30a85..6f09aae1 100644
--- a/BinaryObjectScanner/Protection/FreeLock.cs
+++ b/BinaryObjectScanner/Protection/FreeLock.cs
@@ -26,31 +26,31 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// The disk image that every version of Freelock is distributed through.
- new PathMatchSet(new PathMatch("FREELOCK.IMG", useEndsWith: true), "Freelock Disk Image"),
+ new(new FilePathMatch("FREELOCK.IMG"), "Freelock Disk Image"),
// Found in every "FREELOCK.IMG".
- new PathMatchSet(new PathMatch("FREELOCK.EXE", useEndsWith: true), "Freelock"),
- new PathMatchSet(new PathMatch("FREELOCK.TXT", useEndsWith: true), "Freelock"),
+ new(new FilePathMatch("FREELOCK.EXE"), "Freelock"),
+ new(new FilePathMatch("FREELOCK.TXT"), "Freelock"),
// Found in "FREELOCK.IMG" from Freelock 1.0-1.2.
- new PathMatchSet(new PathMatch("FREELOCK", useEndsWith: true), "Freelock 1.0-1.2"),
+ new(new FilePathMatch("FREELOCK"), "Freelock 1.0-1.2"),
// Found in "FREELOCK.IMG" from Freelock 1.2+.
- new PathMatchSet(new PathMatch("GENLOCK.EXE", useEndsWith: true), "Freelock 1.2+"),
- new PathMatchSet(new PathMatch("freelock.ico", useEndsWith: true), "Freelock 1.2+"),
- new PathMatchSet(new PathMatch("freelock.pif", useEndsWith: true), "Freelock 1.2+"),
+ new(new FilePathMatch("GENLOCK.EXE"), "Freelock 1.2+"),
+ new(new FilePathMatch("freelock.ico"), "Freelock 1.2+"),
+ new(new FilePathMatch("freelock.pif"), "Freelock 1.2+"),
// Created by "GENLOCK.EXE" in Freelock 1.2+.
- new PathMatchSet(new PathMatch("FREELOCK.DAT", useEndsWith: true), "Freelock 1.2+"),
+ new(new FilePathMatch("FREELOCK.DAT"), "Freelock 1.2+"),
// Found in "FREELOCK.IMG" From Freelock 1.3.
- new PathMatchSet(new PathMatch("FREELOCK.13", useEndsWith: true), "Freelock 1.3"),
+ new(new FilePathMatch("FREELOCK.13"), "Freelock 1.3"),
// Found in "FREELOCK.IMG" From Freelock 1.3.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("FREELOCK.13", useEndsWith: true),
- new PathMatch("FL.DAT", useEndsWith: true),
+ new FilePathMatch("FREELOCK.13"),
+ new FilePathMatch("FL.DAT"),
}, "Freelock 1.3"),
};
@@ -63,25 +63,25 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// The disk image that every version of Freelock is distributed through.
- new PathMatchSet(new PathMatch("FREELOCK.IMG", useEndsWith: true), "Freelock Disk Image"),
+ new(new FilePathMatch("FREELOCK.IMG"), "Freelock Disk Image"),
// Found in every "FREELOCK.IMG".
- new PathMatchSet(new PathMatch("FREELOCK.EXE", useEndsWith: true), "Freelock"),
- new PathMatchSet(new PathMatch("FREELOCK.TXT", useEndsWith: true), "Freelock"),
+ new(new FilePathMatch("FREELOCK.EXE"), "Freelock"),
+ new(new FilePathMatch("FREELOCK.TXT"), "Freelock"),
// Found in "FREELOCK.IMG" from Freelock 1.0-1.2.
- new PathMatchSet(new PathMatch("FREELOCK", useEndsWith: true), "Freelock 1.0-1.2"),
+ new(new FilePathMatch("FREELOCK"), "Freelock 1.0-1.2"),
// Found in "FREELOCK.IMG" from Freelock 1.2+.
- new PathMatchSet(new PathMatch("GENLOCK.EXE", useEndsWith: true), "Freelock 1.2+"),
- new PathMatchSet(new PathMatch("freelock.ico", useEndsWith: true), "Freelock 1.2+"),
- new PathMatchSet(new PathMatch("freelock.pif", useEndsWith: true), "Freelock 1.2+"),
+ new(new FilePathMatch("GENLOCK.EXE"), "Freelock 1.2+"),
+ new(new FilePathMatch("freelock.ico"), "Freelock 1.2+"),
+ new(new FilePathMatch("freelock.pif"), "Freelock 1.2+"),
// Created by "GENLOCK.EXE" in Freelock 1.2+.
- new PathMatchSet(new PathMatch("FREELOCK.DAT", useEndsWith: true), "Freelock 1.2+"),
+ new(new FilePathMatch("FREELOCK.DAT"), "Freelock 1.2+"),
// Found in "FREELOCK.IMG" From Freelock 1.3.
- new PathMatchSet(new PathMatch("FREELOCK.13", useEndsWith: true), "Freelock 1.3"),
+ new(new FilePathMatch("FREELOCK.13"), "Freelock 1.3"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/GFWL.cs b/BinaryObjectScanner/Protection/GFWL.cs
index eaa5bcbd..0b236b6d 100644
--- a/BinaryObjectScanner/Protection/GFWL.cs
+++ b/BinaryObjectScanner/Protection/GFWL.cs
@@ -47,9 +47,9 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// Might be specifically GFWL/Gfwlivesetup.exe
- new PathMatchSet(new PathMatch("Gfwlivesetup.exe", useEndsWith: true), "Games for Windows LIVE"),
- new PathMatchSet(new PathMatch("xliveinstall.dll", useEndsWith: true), "Games for Windows LIVE"),
- new PathMatchSet(new PathMatch("XLiveRedist.msi", useEndsWith: true), "Games for Windows LIVE"),
+ new(new FilePathMatch("Gfwlivesetup.exe"), "Games for Windows LIVE"),
+ new(new FilePathMatch("xliveinstall.dll"), "Games for Windows LIVE"),
+ new(new FilePathMatch("XLiveRedist.msi"), "Games for Windows LIVE"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -61,9 +61,9 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// Might be specifically GFWL/Gfwlivesetup.exe
- new PathMatchSet(new PathMatch("Gfwlivesetup.exe", useEndsWith: true), "Games for Windows LIVE"),
- new PathMatchSet(new PathMatch("xliveinstall.dll", useEndsWith: true), "Games for Windows LIVE"),
- new PathMatchSet(new PathMatch("XLiveRedist.msi", useEndsWith: true), "Games for Windows LIVE"),
+ new(new FilePathMatch("Gfwlivesetup.exe"), "Games for Windows LIVE"),
+ new(new FilePathMatch("xliveinstall.dll"), "Games for Windows LIVE"),
+ new(new FilePathMatch("XLiveRedist.msi"), "Games for Windows LIVE"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/HexaLock.cs b/BinaryObjectScanner/Protection/HexaLock.cs
index 255a0d45..0d4160d5 100644
--- a/BinaryObjectScanner/Protection/HexaLock.cs
+++ b/BinaryObjectScanner/Protection/HexaLock.cs
@@ -79,30 +79,30 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// "Start_Here.exe" is the default name used in HexaLock AutoLock 4.5.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("Start_Here.exe", useEndsWith: true),
- new PathMatch("MFINT.DLL", useEndsWith: true),
- new PathMatch("MFIMP.DLL", useEndsWith: true),
+ new FilePathMatch("Start_Here.exe"),
+ new FilePathMatch("MFINT.DLL"),
+ new FilePathMatch("MFIMP.DLL"),
}, "Hexalock AutoLock 4.5"),
// Used for PDF protection in HexaLock AutoLock 4.7. "Start.exe" likely has some internal strings that can be checked.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("kleft.ipf", useEndsWith: true),
- new PathMatch("ReadPFile.exe", useEndsWith: true),
- new PathMatch("Start.exe", useEndsWith: true),
+ new FilePathMatch("kleft.ipf"),
+ new FilePathMatch("ReadPFile.exe"),
+ new FilePathMatch("Start.exe"),
}, "HexaLock AutoLock 4.7 PDF DRM"),
// Should be present in all known versions.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("MFINT.DLL", useEndsWith: true),
- new PathMatch("MFIMP.DLL", useEndsWith: true),
+ new FilePathMatch("MFINT.DLL"),
+ new FilePathMatch("MFIMP.DLL"),
}, "HexaLock AutoLock"),
// Found inside the file typically named "Start_Here.exe" in version 4.5.
- new PathMatchSet(new PathMatch("HCPSMng.exe", useEndsWith: true), "HexaLock AutoLock 4.5"),
+ new(new PathMatch("HCPSMng.exe"), "HexaLock AutoLock 4.5"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -114,18 +114,18 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found to be the default name used in HexaLock AutoLock 4.5.
- new PathMatchSet(new PathMatch("Start_Here.exe", useEndsWith: true), "HexaLock AutoLock 4.5"),
+ new(new FilePathMatch("Start_Here.exe"), "HexaLock AutoLock 4.5"),
// Found to be contained in HexaLock AutoLock 4.5 and 4.7.
- new PathMatchSet(new PathMatch("MFINT.DLL", useEndsWith: true), "HexaLock AutoLock"),
- new PathMatchSet(new PathMatch("MFIMP.DLL", useEndsWith: true), "HexaLock AutoLock"),
+ new(new FilePathMatch("MFINT.DLL"), "HexaLock AutoLock"),
+ new(new FilePathMatch("MFIMP.DLL"), "HexaLock AutoLock"),
// Used for PDF protection in HexaLock AutoLock 4.7.
- new PathMatchSet(new PathMatch("kleft.ipf", useEndsWith: true), "HexaLock AutoLock 4.7 PDF DRM"),
- new PathMatchSet(new PathMatch("ReadPFile.exe", useEndsWith: true), "HexaLock AutoLock 4.7 PDF DRM"),
+ new(new FilePathMatch("kleft.ipf"), "HexaLock AutoLock 4.7 PDF DRM"),
+ new(new FilePathMatch("ReadPFile.exe"), "HexaLock AutoLock 4.7 PDF DRM"),
// Found inside the file typically named "Start_Here.exe" in version 4.5.
- new PathMatchSet(new PathMatch("HCPSMng.exe", useEndsWith: true), "HexaLock AutoLock 4.5"),
+ new(new FilePathMatch("HCPSMng.exe"), "HexaLock AutoLock 4.5"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/ImpulseReactor.cs b/BinaryObjectScanner/Protection/ImpulseReactor.cs
index 5d40a4b9..a0632bed 100644
--- a/BinaryObjectScanner/Protection/ImpulseReactor.cs
+++ b/BinaryObjectScanner/Protection/ImpulseReactor.cs
@@ -64,8 +64,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("ImpulseReactor.dll", useEndsWith: true), GetInternalVersion, "Impulse Reactor Core Module"),
- new PathMatchSet(new PathMatch("ReactorActivate.exe", useEndsWith: true), GetInternalVersion, "Stardock Product Activation"),
+ new(new FilePathMatch("ImpulseReactor.dll"), GetInternalVersion, "Impulse Reactor Core Module"),
+ new(new FilePathMatch("ReactorActivate.exe"), GetInternalVersion, "Stardock Product Activation"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -76,8 +76,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("ImpulseReactor.dll", useEndsWith: true), GetInternalVersion, "Impulse Reactor Core Module"),
- new PathMatchSet(new PathMatch("ReactorActivate.exe", useEndsWith: true), GetInternalVersion, "Stardock Product Activation"),
+ new(new FilePathMatch("ImpulseReactor.dll"), GetInternalVersion, "Impulse Reactor Core Module"),
+ new(new FilePathMatch("ReactorActivate.exe"), GetInternalVersion, "Stardock Product Activation"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -87,11 +87,9 @@ namespace BinaryObjectScanner.Protection
{
try
{
- using (Stream fileStream = File.Open(firstMatchedString, FileMode.Open, FileAccess.Read, FileShare.Read))
- {
- var pex = PortableExecutable.Create(fileStream);
- return pex?.GetInternalVersion() ?? string.Empty;
- }
+ using Stream fileStream = File.Open(firstMatchedString, FileMode.Open, FileAccess.Read, FileShare.Read);
+ var pex = PortableExecutable.Create(fileStream);
+ return pex?.GetInternalVersion() ?? string.Empty;
}
catch
{
diff --git a/BinaryObjectScanner/Protection/IndyVCD.cs b/BinaryObjectScanner/Protection/IndyVCD.cs
index 56a2f428..fc14f3cf 100644
--- a/BinaryObjectScanner/Protection/IndyVCD.cs
+++ b/BinaryObjectScanner/Protection/IndyVCD.cs
@@ -23,8 +23,8 @@ namespace BinaryObjectScanner.Protection
// TODO: Verify if these are OR or AND
var matchers = new List
{
- new PathMatchSet(new PathMatch("INDYVCD.AX", useEndsWith: true), "IndyVCD (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch("INDYMP3.idt", useEndsWith: true), "IndyVCD (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("INDYVCD.AX"), "IndyVCD (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("INDYMP3.idt"), "IndyVCD (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -35,8 +35,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("INDYVCD.AX", useEndsWith: true), "IndyVCD (Unconfirmed - Please report to us on Github)"),
- new PathMatchSet(new PathMatch("INDYMP3.idt", useEndsWith: true), "IndyVCD (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("INDYVCD.AX"), "IndyVCD (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("INDYMP3.idt"), "IndyVCD (Unconfirmed - Please report to us on Github)"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/JoWood.cs b/BinaryObjectScanner/Protection/JoWood.cs
index 9b9bcc89..3ef2c0f1 100644
--- a/BinaryObjectScanner/Protection/JoWood.cs
+++ b/BinaryObjectScanner/Protection/JoWood.cs
@@ -35,7 +35,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// kernel32.dll + (char)0x00 + (char)0x00 + (char)0x00 + VirtualProtect
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x6B, 0x65, 0x72, 0x6E, 0x65, 0x6C, 0x33, 0x32,
0x2E, 0x64, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x56,
diff --git a/BinaryObjectScanner/Protection/KeyLock.cs b/BinaryObjectScanner/Protection/KeyLock.cs
index 8a396b34..2a05e1fb 100644
--- a/BinaryObjectScanner/Protection/KeyLock.cs
+++ b/BinaryObjectScanner/Protection/KeyLock.cs
@@ -15,7 +15,7 @@ namespace BinaryObjectScanner.Protection
var contentMatchSets = new List
{
// KEY-LOCK COMMAND
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x4B, 0x45, 0x59, 0x2D, 0x4C, 0x4F, 0x43, 0x4B,
0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x41, 0x4E, 0x44
diff --git a/BinaryObjectScanner/Protection/LabelGate.cs b/BinaryObjectScanner/Protection/LabelGate.cs
index f24b7ca7..e255f714 100644
--- a/BinaryObjectScanner/Protection/LabelGate.cs
+++ b/BinaryObjectScanner/Protection/LabelGate.cs
@@ -60,23 +60,23 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// All found to be present on at multiple albums with LabelGate CD2 (Redump entry 95010 and product ID SVWC-7185), the original version of LabelGate still needs to be investigated.
- new PathMatchSet(new List
+ new(new List
{
#if NET20 || NET35
- new PathMatch(Path.Combine(Path.Combine("BIN", "WIN32"), "MQ2SETUP.EXE").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine(Path.Combine("BIN", "WIN32"), "MQSTART.EXE").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine(Path.Combine("BIN", "WIN32"), "MQ2SETUP.EXE").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine(Path.Combine("BIN", "WIN32"), "MQSTART.EXE").Replace("\\", "/"), useEndsWith: true),
#else
- new PathMatch(Path.Combine("BIN", "WIN32", "MQ2SETUP.EXE").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine("BIN", "WIN32", "MQSTART.EXE").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("BIN", "WIN32", "MQ2SETUP.EXE").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("BIN", "WIN32", "MQSTART.EXE").Replace("\\", "/"), useEndsWith: true),
#endif
}, "LabelGate CD2 Media Player"),
// All of these are also found present on all known LabelGate CD2 releases, though an additional file "RESERVED.DAT" is found in the same directory in at least one release (Product ID SVWC-7185)
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch(Path.Combine("MQDISC", "LICENSE.TXT").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine("MQDISC", "MQDISC.INI").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine("MQDISC", "START.INI").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("MQDISC", "LICENSE.TXT").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("MQDISC", "MQDISC.INI").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("MQDISC", "START.INI").Replace("\\", "/"), useEndsWith: true),
}, "LabelGate CD2"),
};
@@ -89,7 +89,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// This is the installer for the media player used by LabelGate CD2 (Redump entry 95010 and product ID SVWC-7185).
- new PathMatchSet(new PathMatch("MQ2SETUP.EXE", useEndsWith: true), "LabelGate CD2 Media Player"),
+ new(new FilePathMatch("MQ2SETUP.EXE"), "LabelGate CD2 Media Player"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/LaserLok.cs b/BinaryObjectScanner/Protection/LaserLok.cs
index 157f4e8e..4df629b3 100644
--- a/BinaryObjectScanner/Protection/LaserLok.cs
+++ b/BinaryObjectScanner/Protection/LaserLok.cs
@@ -26,7 +26,7 @@ namespace BinaryObjectScanner.Protection
// C:\NOMOUSE.SP
//
// // :\LASERLOK\LASERLOK.IN + (char)0x00 + C:\NOMOUSE.SP
- // new ContentMatchSet(new byte?[]
+ // new(new byte?[]
// {
// 0x3A, 0x5C, 0x5C, 0x4C, 0x41, 0x53, 0x45, 0x52,
// 0x4C, 0x4F, 0x4B, 0x5C, 0x5C, 0x4C, 0x41, 0x53,
@@ -36,7 +36,7 @@ namespace BinaryObjectScanner.Protection
// }, "LaserLok 3"),
// // LASERLOK_INIT + (char)0xC + LASERLOK_RUN + (char)0xE + LASERLOK_CHECK + (char)0xF + LASERLOK_CHECK2 + (char)0xF + LASERLOK_CHECK3
- // new ContentMatchSet(new byte?[]
+ // new(new byte?[]
// {
// 0x4C, 0x41, 0x53, 0x45, 0x52, 0x4C, 0x4F, 0x4B,
// 0x5F, 0x49, 0x4E, 0x49, 0x54, 0x0C, 0x4C, 0x41,
@@ -56,15 +56,15 @@ namespace BinaryObjectScanner.Protection
return null;
// Packed by SPEEnc V2 Asterios Parlamentas.PE
- byte?[] check = new byte?[]
- {
+ byte?[] check =
+ [
0x50, 0x61, 0x63, 0x6B, 0x65, 0x64, 0x20, 0x62,
0x79, 0x20, 0x53, 0x50, 0x45, 0x45, 0x6E, 0x63,
0x20, 0x56, 0x32, 0x20, 0x41, 0x73, 0x74, 0x65,
0x72, 0x69, 0x6F, 0x73, 0x20, 0x50, 0x61, 0x72,
0x6C, 0x61, 0x6D, 0x65, 0x6E, 0x74, 0x61, 0x73,
0x2E, 0x50, 0x45
- };
+ ];
int endDosStub = (int)(pex.Model.Stub?.Header?.NewExeHeaderAddr ?? 0);
int position = -1;
bool containsCheck = pex.StubExecutableData?.FirstPosition(check, out position) ?? false;
@@ -81,8 +81,8 @@ namespace BinaryObjectScanner.Protection
if (containsCheck2 && pex.ContainsSection(".text"))
{
// GetModuleHandleA + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + GetProcAddress + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + LoadLibraryA + (char)0x00 + (char)0x00 + KERNEL32.dll + (char)0x00 + ëy + (char)0x01 + SNIF/MPVI
- byte?[] check2 = new byte?[]
- {
+ byte?[] check2 =
+ [
0x47, 0x65, 0x74, 0x4D, 0x6F, 0x64, 0x75, 0x6C,
0x65, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x41,
0x00, 0x00, 0x00, 0x00, 0x47, 0x65, 0x74, 0x50,
@@ -92,7 +92,7 @@ namespace BinaryObjectScanner.Protection
0x79, 0x41, 0x00, 0x00, 0x4B, 0x45, 0x52, 0x4E,
0x45, 0x4C, 0x33, 0x32, 0x2E, 0x64, 0x6C, 0x6C,
0x00, 0xEB, 0x79, 0x01, null, null, null, null,
- };
+ ];
containsCheck2 = pex.GetFirstSectionData(".text")?.FirstPosition(check2, out position2) ?? false;
}
else
@@ -121,17 +121,17 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet($"LASERLOK{Path.DirectorySeparatorChar}", "LaserLok [Check disc for physical ring]"),
+ new($"LASERLOK{Path.DirectorySeparatorChar}", "LaserLok [Check disc for physical ring]"),
// TODO: Verify if these are OR or AND
- new PathMatchSet(new FilePathMatch("NOMOUSE.SP"), GetVersion16Bit, "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new FilePathMatch("NOMOUSE.COM"), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("l16dll.dll", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.in", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.o10", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.o11", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.o12", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.out", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new FilePathMatch("NOMOUSE.SP"), GetVersion16Bit, "LaserLok [Check disc for physical ring]"),
+ new(new FilePathMatch("NOMOUSE.COM"), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("l16dll.dll", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.in", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.o10", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.o11", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.o12", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.out", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -142,16 +142,16 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new FilePathMatch("NOMOUSE.SP"), GetVersion16Bit, "LaserLok [Check disc for physical ring]"),
+ new(new FilePathMatch("NOMOUSE.SP"), GetVersion16Bit, "LaserLok [Check disc for physical ring]"),
// TODO: Verify if these are OR or AND
- new PathMatchSet(new FilePathMatch("NOMOUSE.COM"), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("l16dll.dll", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.in", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.o10", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.o11", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.o12", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
- new PathMatchSet(new PathMatch("laserlok.out", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new FilePathMatch("NOMOUSE.COM"), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("l16dll.dll", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.in", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.o10", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.o11", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.o12", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
+ new(new PathMatch("laserlok.out", useEndsWith: true), "LaserLok [Check disc for physical ring]"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -163,11 +163,11 @@ namespace BinaryObjectScanner.Protection
return "(Build unknown)";
// Unkown + (char)0x00 + Unkown
- byte?[] check = new byte?[]
- {
+ byte?[] check =
+ [
0x55, 0x6E, 0x6B, 0x6F, 0x77, 0x6E, 0x00, 0x55,
0x6E, 0x6B, 0x6F, 0x77, 0x6E
- };
+ ];
if (!sectionContent.FirstPosition(check, out int position))
return "(Build unknown)";
@@ -238,11 +238,9 @@ namespace BinaryObjectScanner.Protection
if (!File.Exists(firstMatchedString))
return string.Empty;
- using (var fs = File.Open(firstMatchedString, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
- using (var br = new BinaryReader(fs))
- {
- return GetVersion16Bit(br.ReadBytes((int)fs.Length));
- }
+ using var fs = File.Open(firstMatchedString, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ using var br = new BinaryReader(fs);
+ return GetVersion16Bit(br.ReadBytes((int)fs.Length));
}
private static string GetVersion16Bit(byte[] fileContent)
diff --git a/BinaryObjectScanner/Protection/Macrovision.CDilla.cs b/BinaryObjectScanner/Protection/Macrovision.CDilla.cs
index 6b13befe..ed3b154b 100644
--- a/BinaryObjectScanner/Protection/Macrovision.CDilla.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.CDilla.cs
@@ -159,38 +159,38 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in C-Dilla CD-Secure/CD-Compress 1.31.34.
- new PathMatchSet(new PathMatch("CDANT.DLL", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA05.DLL", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA10.EXE", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA40.DLL", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDANT.DLL"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA05.DLL"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA10.EXE"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA40.DLL"), "C-Dilla License Management System"),
// Found in C-Dilla LMS version 3.24.010 (IA item "ejay_nestle_trial").
// TODO: Verify that all of these are exclusively part of LMS, and not SafeCast.
- new PathMatchSet(new PathMatch("CdaLMS.exe", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("cdilla51.dll", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("cdilla52.dll", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CdaLMS.exe"), "C-Dilla License Management System"),
+ new(new FilePathMatch("cdilla51.dll"), "C-Dilla License Management System"),
+ new(new FilePathMatch("cdilla52.dll"), "C-Dilla License Management System"),
// Found in the installer C-Dilla LMS version 3.27.000.
// The files "CdRemove.exe", "CdSet32.exe", "CdSet32.ini", "CdSetup.exe", "CdSetup.ini", and "CdUnin16.exe" are found there as well, but aren't currently checked for due to possibly being too generic.
// TODO: Add grouped check for "CdRemove.exe", "CdSet32.exe", "CdSet32.ini", "CdSetup.exe", "CdSetup.ini", and "CdUnin16.exe".
- new PathMatchSet(new PathMatch("CdaIns16.dll", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CdaIns32.dll", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CdaIns16.dll"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CdaIns32.dll"), "C-Dilla License Management System"),
// Found installed in C-Dilla LMS version 3.27.000 for Windows 3.1.
// The files "CDILLA05.DLL", "CDILLA10.EXE", and "CDILLA40.DLL" are included as well.
// TODO: Check into what file "CDAW31X.38_" gets installed as. I wasn't able to find what it gets installed to.
- new PathMatchSet(new PathMatch("CDILLA32.DLL", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA64.EXE", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA32.DLL"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA64.EXE"), "C-Dilla License Management System"),
// Found installed in C-Dilla LMS version 3.27.000 for Windows 95. All the files installed for Windows 3.1 are also installed for 95.
- new PathMatchSet(new PathMatch("CDAINT2F.VXD", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDAWIN95.VXD", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA13.DLL", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDAINT2F.VXD"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDAWIN95.VXD"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA13.DLL"), "C-Dilla License Management System"),
// Found installed in C-Dilla LMS version 3.27.000 for Windows NT. All the files installed for Windows 95 and 3.1 (except for the VXD files) are also installed for NT.
- new PathMatchSet(new PathMatch("CDANT.SYS", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDANTSRV.EXE", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA16.EXE", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDANT.SYS"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDANTSRV.EXE"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA16.EXE"), "C-Dilla License Management System"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -202,38 +202,38 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in C-Dilla CD-Secure/CD-Compress 1.31.34.
- new PathMatchSet(new PathMatch("CDANT.DLL", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA05.DLL", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA10.EXE", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA40.DLL", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDANT.DLL"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA05.DLL"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA10.EXE"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA40.DLL"), "C-Dilla License Management System"),
// Found in C-Dilla LMS version 3.24.010 (IA item "ejay_nestle_trial").
// TODO: Verify that all of these are exclusively part of LMS, and not SafeCast.
- new PathMatchSet(new PathMatch("CdaLMS.exe", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("cdilla51.dll", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("cdilla52.dll", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CdaLMS.exe"), "C-Dilla License Management System"),
+ new(new FilePathMatch("cdilla51.dll"), "C-Dilla License Management System"),
+ new(new FilePathMatch("cdilla52.dll"), "C-Dilla License Management System"),
// Found in the installer C-Dilla LMS version 3.27.000.
// The files "CdRemove.exe", "CdSet32.exe", "CdSet32.ini", "CdSetup.exe", "CdSetup.ini", and "CdUnin16.exe" are found there as well, but aren't currently checked for due to possibly being too generic.
// TODO: Add grouped check for "CdRemove.exe", "CdSet32.exe", "CdSet32.ini", "CdSetup.exe", "CdSetup.ini", and "CdUnin16.exe".
- new PathMatchSet(new PathMatch("CdaIns16.dll", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CdaIns32.dll", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CdaIns16.dll"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CdaIns32.dll"), "C-Dilla License Management System"),
// Found installed in C-Dilla LMS version 3.27.000 for Windows 3.1.
// The files "CDILLA05.DLL", "CDILLA10.EXE", and "CDILLA40.DLL" are included as well.
// TODO: Check into what file "CDAW31X.38_" gets installed as. I wasn't able to find what it gets installed to.
- new PathMatchSet(new PathMatch("CDILLA32.DLL", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA64.EXE", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA32.DLL"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA64.EXE"), "C-Dilla License Management System"),
// Found installed in C-Dilla LMS version 3.27.000 for Windows 95. All the files installed for Windows 3.1 are also installed for 95.
- new PathMatchSet(new PathMatch("CDAINT2F.VXD", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDAWIN95.VXD", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA13.DLL", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDAINT2F.VXD"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDAWIN95.VXD"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA13.DLL"), "C-Dilla License Management System"),
// Found installed in C-Dilla LMS version 3.27.000 for Windows NT. All the files installed for Windows 95 and 3.1 (except for the VXD files) are also installed for NT.
- new PathMatchSet(new PathMatch("CDANT.SYS", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDANTSRV.EXE", useEndsWith: true), "C-Dilla License Management System"),
- new PathMatchSet(new PathMatch("CDILLA16.EXE", useEndsWith: true), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDANT.SYS"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDANTSRV.EXE"), "C-Dilla License Management System"),
+ new(new FilePathMatch("CDILLA16.EXE"), "C-Dilla License Management System"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs b/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs
index a260dd26..948bbf68 100644
--- a/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.CactusDataShield.cs
@@ -78,16 +78,16 @@ namespace BinaryObjectScanner.Protection
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]).
// Modified version of the PlayJ Music Player specificaly for CDS, as indicated by the About page present when running the executable.
// The file "DATA16.BML" is also present on this disc but the name is too generic to check for.
- new PathMatchSet(new PathMatch("CACTUSPJ.exe", useEndsWith: true), "PlayJ Music Player (Cactus Data Shield 200)"),
+ new(new FilePathMatch("CACTUSPJ.exe"), "PlayJ Music Player (Cactus Data Shield 200)"),
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]).
// In "Volumina! - Puur" (7 43218 63282 2), this file is composed of multiple PLJ files combined together.
// In later versions, this file is a padded dummy file. ("Ich Habe Einen Traum" by Uwe Busse (Barcode 9 002723 251203)).
- new PathMatchSet(new PathMatch("YUCCA.CDS", useEndsWith: true), "Cactus Data Shield 200"),
+ new(new FilePathMatch("YUCCA.CDS"), "Cactus Data Shield 200"),
// TODO: Find samples of the following:
- new PathMatchSet(new PathMatch("CDSPlayer.app", useEndsWith: true), GetCactusDataShieldVersion, "Cactus Data Shield"),
- new PathMatchSet(new PathMatch("wmmp.exe", useEndsWith: true), GetCactusDataShieldVersion, "Cactus Data Shield"),
+ new(new FilePathMatch("CDSPlayer.app"), GetCactusDataShieldVersion, "Cactus Data Shield"),
+ new(new FilePathMatch("wmmp.exe"), GetCactusDataShieldVersion, "Cactus Data Shield"),
// The file "00000001.TMP" (with a filesize of 2,048 bytes) can be found in CDS-300, as well as SafeDisc.
// Due to this file being used in both protections, this file is detected within the general Macrovision checks.
@@ -104,16 +104,16 @@ namespace BinaryObjectScanner.Protection
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]).
// Modified version of the PlayJ Music Player specificaly for CDS, as indicated by the About page present when running the executable.
// The file "DATA16.BML" is also present on this disc but the name is too generic to check for.
- new PathMatchSet(new PathMatch("CACTUSPJ.exe", useEndsWith: true), "PlayJ Music Player (Cactus Data Shield 200)"),
+ new(new FilePathMatch("CACTUSPJ.exe"), "PlayJ Music Player (Cactus Data Shield 200)"),
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]),
// In "Volumia! - Puur", this file is composed of multiple PLJ files combined together.
// In later versions, this file is a padded dummy file. ("Ich Habe Einen Traum" by Uwe Busse (Barcode 9 002723 251203)).
- new PathMatchSet(new PathMatch("YUCCA.CDS", useEndsWith: true), "Cactus Data Shield 200"),
+ new(new FilePathMatch("YUCCA.CDS"), "Cactus Data Shield 200"),
// TODO: Find samples of the following:
- new PathMatchSet(new PathMatch("CDSPlayer.app", useEndsWith: true), "Cactus Data Shield 200"),
- new PathMatchSet(new PathMatch("wmmp.exe", useEndsWith: true), "Cactus Data Shield 200"),
+ new(new FilePathMatch("CDSPlayer.app"), "Cactus Data Shield 200"),
+ new(new FilePathMatch("wmmp.exe"), "Cactus Data Shield 200"),
// The file "00000001.TMP" (with a filesize of 2,048 bytes) can be found in CDS-300, as well as SafeDisc.
// Due to this file being used in both protections, this file is detected within the general Macrovision checks.
@@ -147,14 +147,12 @@ namespace BinaryObjectScanner.Protection
try
{
- using (var sr = new StreamReader(path, Encoding.Default))
- {
- var line = sr.ReadLine();
- if (line == null)
- return null;
+ using var sr = new StreamReader(path, Encoding.Default);
+ var line = sr.ReadLine();
+ if (line == null)
+ return null;
- return $"{line.Substring(3)} ({sr.ReadLine()})";
- }
+ return $"{line.Substring(3)} ({sr.ReadLine()})";
}
catch
{
diff --git a/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs b/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs
index ae9c4155..8d75a14d 100644
--- a/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs
@@ -42,7 +42,7 @@ namespace BinaryObjectScanner.Protection
{
try
{
- FileInfo fi = new FileInfo(file);
+ var fi = new FileInfo(file);
// So far, every seemingly-randomly named EXE on RipGuard discs have a consistent hash.
if (fi.Length == 49_152)
@@ -70,11 +70,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in the Black Lagoon Season 1 DVD steelbook box set (Geneon ID 12970).
- new PathMatchSet(new PathMatch("G23YHWO1.EXE", useEndsWith: true), "RipGuard"),
- new PathMatchSet(new PathMatch("RGASDEV.SYS", useEndsWith: true), "RipGuard"),
+ new(new PathMatch("G23YHWO1.EXE", useEndsWith: true), "RipGuard"),
+ new(new PathMatch("RGASDEV.SYS", useEndsWith: true), "RipGuard"),
// Mentioned online in https://forum.redfox.bz/threads/resolved-one-on-one-with-tony-horton-vol2-disc3.33901/.
- new PathMatchSet(new PathMatch("9KMJ9G4I.EXE", useEndsWith: true), "RipGuard (Unconfirmed - Please report to us on GitHub)"),
+ new(new PathMatch("9KMJ9G4I.EXE", useEndsWith: true), "RipGuard (Unconfirmed - Please report to us on GitHub)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -86,11 +86,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in the Black Lagoon Season 1 DVD steelbook box set (Geneon ID 12970).
- new PathMatchSet(new PathMatch("G23YHWO1.EXE", useEndsWith: true), "RipGuard"),
- new PathMatchSet(new PathMatch("RGASDEV.SYS", useEndsWith: true), "RipGuard"),
+ new(new PathMatch("G23YHWO1.EXE", useEndsWith: true), "RipGuard"),
+ new(new PathMatch("RGASDEV.SYS", useEndsWith: true), "RipGuard"),
// Mentioned online in https://forum.redfox.bz/threads/resolved-one-on-one-with-tony-horton-vol2-disc3.33901/.
- new PathMatchSet(new PathMatch("9KMJ9G4I.EXE", useEndsWith: true), "RipGuard (Unconfirmed - Please report to us on GitHub)"),
+ new(new PathMatch("9KMJ9G4I.EXE", useEndsWith: true), "RipGuard (Unconfirmed - Please report to us on GitHub)"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs b/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs
index f5f83035..6b73298f 100644
--- a/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.SafeCast.cs
@@ -62,7 +62,7 @@ namespace BinaryObjectScanner.Protection
{
// SafeCast
// Found as the Product Name in "cdac01aa.dll" from IA item "ejay_nestle_trial". Windows 10 appears to incorrectly truncate this to "SafeCas" in File Explorer.
- new ContentMatchSet(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x43, 0x61, 0x73, 0x74 }, "SafeCast"),
+ new(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x43, 0x61, 0x73, 0x74 }, "SafeCast"),
};
return MatchUtil.GetFirstMatch(file, data, neMatchSets, includeDebug);
@@ -155,38 +155,38 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in IA item "britney-spears-special-edition-cd-rom".
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("C2C.16", useEndsWith: true),
- new PathMatch("C2C.DLL", useEndsWith: true),
- new PathMatch("C2CDEL.16", useEndsWith: true),
- new PathMatch("C2CDEL.EXE", useEndsWith: true),
+ new FilePathMatch("C2C.16"),
+ new FilePathMatch("C2C.DLL"),
+ new FilePathMatch("C2CDEL.16"),
+ new FilePathMatch("C2CDEL.EXE"),
}, "SafeCast"),
// Found in IA item "ejay_nestle_trial".
- new PathMatchSet(new PathMatch("cdac01aa.dll", useEndsWith: true), "SafeCast"),
- new PathMatchSet(new PathMatch("cdac01ba.dll", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("cdac01aa.dll"), "SafeCast"),
+ new(new FilePathMatch("cdac01ba.dll"), "SafeCast"),
// Found in multiple versions of SafeCast, including Redump entries 83145 and 95524, as well as IA item "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282".
- new PathMatchSet(new PathMatch("cdac14ba.dll", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("cdac14ba.dll"), "SafeCast"),
// Found in Redump entry 83145.
- new PathMatchSet(new PathMatch("CDAC21BA.DLL", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("CDAC21BA.DLL"), "SafeCast"),
// Found in Redump entry 102979.
- new PathMatchSet(new PathMatch("SCRfrsh.exe", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("SCRfrsh.exe"), "SafeCast"),
// Found in Redump entries 26211 and 95524.
- new PathMatchSet(new PathMatch("SCSHD.CSA", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("SCSHD.CSA"), "SafeCast"),
// Found in Redump entries 95524.
- new PathMatchSet(new PathMatch("SCSHD.EXE", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("SCSHD.EXE"), "SafeCast"),
// Found in IA item "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282".
- new PathMatchSet(new PathMatch("CDAC15BA.SYS", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("CDAC15BA.SYS"), "SafeCast"),
// Found in "cdac14ba.dll" in IA item "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282".
- new PathMatchSet(new PathMatch("CDAC13BA.EXE", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("CDAC13BA.EXE"), "SafeCast"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -198,31 +198,31 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in IA item "ejay_nestle_trial".
- new PathMatchSet(new PathMatch("cdac01aa.dll", useEndsWith: true), "SafeCast"),
- new PathMatchSet(new PathMatch("cdac01ba.dll", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("cdac01aa.dll"), "SafeCast"),
+ new(new FilePathMatch("cdac01ba.dll"), "SafeCast"),
- new PathMatchSet(new PathMatch("cdac11ba.exe", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("cdac11ba.exe"), "SafeCast"),
// Found in multiple versions of SafeCast, including Redump entry 83145 and IA item "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282".
- new PathMatchSet(new PathMatch("cdac14ba.dll", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("cdac14ba.dll"), "SafeCast"),
// Found in Redump entry 83145.
- new PathMatchSet(new PathMatch("CDAC21BA.DLL", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("CDAC21BA.DLL"), "SafeCast"),
// Found in Redump entry 102979.
- new PathMatchSet(new PathMatch("SCRfrsh.exe", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("SCRfrsh.exe"), "SafeCast"),
// Found in Redump entries 26211 and 95524.
- new PathMatchSet(new PathMatch("SCSHD.CSA", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("SCSHD.CSA"), "SafeCast"),
// Found in Redump entries 95524.
- new PathMatchSet(new PathMatch("SCSHD.EXE", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("SCSHD.EXE"), "SafeCast"),
// Found in IA item "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282".
- new PathMatchSet(new PathMatch("CDAC15BA.SYS", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("CDAC15BA.SYS"), "SafeCast"),
// Found in "cdac14ba.dll" in IA item "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282".
- new PathMatchSet(new PathMatch("CDAC13BA.EXE", useEndsWith: true), "SafeCast"),
+ new(new FilePathMatch("CDAC13BA.EXE"), "SafeCast"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs b/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs
index 4687cab8..08b53087 100644
--- a/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs
@@ -120,50 +120,50 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("CLCD16.DLL", useEndsWith: true),
- new PathMatch("CLCD32.DLL", useEndsWith: true),
- new PathMatch("CLOKSPL.EXE", useEndsWith: true),
- new PathMatch(".icd", useEndsWith: true),
+ new FilePathMatch("CLCD16.DLL"),
+ new FilePathMatch("CLCD32.DLL"),
+ new FilePathMatch("CLOKSPL.EXE"),
+ new(".icd", useEndsWith: true),
}, "SafeDisc 1/Lite"),
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("00000001.TMP", useEndsWith: true),
+ new FilePathMatch("00000001.TMP"),
// The .016 and .256 files are banners stored in the BMP image format. The 016 and 256 refers to the color depth of the BMP.
// There are common file names used, such as 00000407.XXX and 00000409.XXX. Further investigation is needed to determine the consistency of these names.
- new PathMatch(".016", useEndsWith: true),
- new PathMatch(".256", useEndsWith: true),
+ new(".016", useEndsWith: true),
+ new(".256", useEndsWith: true),
}, "SafeDisc 1.06.000-3.20.024"),
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("00000001.TMP", useEndsWith: true),
+ new FilePathMatch("00000001.TMP"),
// The .016 files stop being used as of 4.00.000, while the .256 remain in fairly consistent use.
- new PathMatch(".256", useEndsWith: true),
+ new(".256", useEndsWith: true),
}, "SafeDisc 1.06.000+"),
// The file "mcp.dll" is known to only be used in a specific version range for SafeDisc, but is currently only used in a grouped file name check with other SafeDisc files to prevent false positives.
// Found in Redump entries 28810, 30555, 55078, and 62935.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("00000001.TMP", useEndsWith: true),
- new PathMatch("drvmgt.dll", useEndsWith: true),
- new PathMatch("mcp.dll", useEndsWith: true),
- new PathMatch("secdrv.sys", useEndsWith: true),
+ new FilePathMatch("00000001.TMP"),
+ new FilePathMatch("drvmgt.dll"),
+ new FilePathMatch("mcp.dll"),
+ new FilePathMatch("secdrv.sys"),
}, "SafeDisc 1.45.011-1.50.020"),
// TODO: Research "splash16.bmp" and "splash256.bmp".
// Found to be present in every version of SafeDisc, possibly every single release.
- //new PathMatchSet(new PathMatch("00000001.TMP", useEndsWith: true), GetSafeDisc00000001TMPVersion, "SafeDisc"),
+ //new(new FilePathMatch("00000001.TMP"), GetSafeDisc00000001TMPVersion, "SafeDisc"),
// Found in many versions of SafeDisc, beginning in 2.05.030 and being used all the way until the final version 4.90.010. It is not always present, even in versions it has been used in. Found in Redump entries 56319 and 72195.
- new PathMatchSet(new PathMatch("00000002.TMP", useEndsWith: true), "SafeDisc 2+"),
+ new(new FilePathMatch("00000002.TMP"), "SafeDisc 2+"),
- new PathMatchSet(new FilePathMatch("DPLAYERX.DLL"), GetSafeDiscDPlayerXVersion, "SafeDisc"),
- new PathMatchSet(new FilePathMatch("drvmgt.dll"), GetSafeDiscDrvmgtVersion, "SafeDisc"),
+ new(new FilePathMatch("DPLAYERX.DLL"), GetSafeDiscDPlayerXVersion, "SafeDisc"),
+ new(new FilePathMatch("drvmgt.dll"), GetSafeDiscDrvmgtVersion, "SafeDisc"),
// The SD0XXX.dll files appear to solely contain custom strings that allowed the publisher to customize the SafeDisc error messages. They are currently only known to be used by EA.
// Each file appears to contain strings for a specific language each.
@@ -172,51 +172,51 @@ namespace BinaryObjectScanner.Protection
// "d:\DiceCanada\BoosterPack2\Installers\BF2XpackInstaller\Safedisk\SafeDiscDLLs\DLLs\Release\SD0816.pdb" (Redump entry 65569).
// Found in Redump entries 20729 and 65569.
- new PathMatchSet(new PathMatch("SD040e.dll", useEndsWith: true), "SafeDisc"),
+ new(new FilePathMatch("SD040e.dll"), "SafeDisc"),
// Found in Redump entry 65569.
- new PathMatchSet(new PathMatch("SD0c0a.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD040b.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD040c.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0419.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD041d.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD041e.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0404.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0405.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0406.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0407.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0409.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0410.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0411.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0412.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0413.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0414.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0415.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0416.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0804.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0809.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0816.dll", useEndsWith: true), "SafeDisc"),
+ new(new FilePathMatch("SD0c0a.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD040b.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD040c.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0419.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD041d.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD041e.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0404.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0405.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0406.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0407.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0409.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0410.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0411.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0412.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0413.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0414.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0415.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0416.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0804.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0809.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0816.dll"), "SafeDisc"),
// Used to distribute SafeDisc driver updates over the internet. Two distinct versions known to exist, with Microsoft also having distributed the later update as well.
// Version 1: https://web.archive.org/web/20040614184055/http://www.macrovision.com:80/products/safedisc/safedisc.exe
// Version 2: https://web.archive.org/web/20051104123646/http://www.macrovision.com/products/safedisc/safedisc.exe
// Microsoft download page: https://web.archive.org/web/20080204081329/http://www.microsoft.com/downloads/details.aspx?FamilyID=eae20f0f-c41c-44fe-84ce-1df707d7a2e9&DisplayLang=en
- new PathMatchSet(new PathMatch("safedisc.exe", useEndsWith: true), "SafeDisc Driver Installer"),
+ new(new FilePathMatch("safedisc.exe"), "SafeDisc Driver Installer"),
// Found in Redump entries 28810 and 30555.
// Name check overmatches with a seemingly completely unrelated application, ironically included on at least one SafeDisc game (Redump entry 34828).
- // new PathMatchSet(new PathMatch("mcp.dll", useEndsWith: true), "SafeDisc (Version 1.45.011-1.50.020)"),
+ // new(new FilePathMatch("mcp.dll"), "SafeDisc (Version 1.45.011-1.50.020)"),
// Found in Redump entry 58455 and 65569.
// Unknown if it's a game specific file, but it contains the stxt371 and stxt774 sections.
- // new PathMatchSet(new PathMatch("CoreDLL.dll", useEndsWith: true), "SafeDisc"),
+ // new(new FilePathMatch("CoreDLL.dll"), "SafeDisc"),
// Found in seemingly every SafeDisc Lite disc. (CD: Redump entries 25579 and 57986. DVD: Redump entry 63941).
- new PathMatchSet(new PathMatch("00000001.LT1", useEndsWith: true), "SafeDisc Lite"),
- new PathMatchSet(new PathMatch("LTDLL.DLL", useEndsWith: true), "SafeDisc Lite"),
+ new(new FilePathMatch("00000001.LT1"), "SafeDisc Lite"),
+ new(new FilePathMatch("LTDLL.DLL"), "SafeDisc Lite"),
// Found on Redump entry 42762.
- new PathMatchSet(".SafeDiscDVD.bundle", "SafeDisc for Macintosh"),
+ new(".SafeDiscDVD.bundle", "SafeDisc for Macintosh"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -227,17 +227,17 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("CLCD16.DLL", useEndsWith: true), GetSafeDiscCLCD16Version, "SafeDisc"),
- new PathMatchSet(new PathMatch("CLCD32.DLL", useEndsWith: true), GetSafeDiscCLCD32Version, "SafeDisc"),
- new PathMatchSet(new PathMatch("CLOKSPL.EXE", useEndsWith: true), GetSafeDiscCLOKSPLVersion, "SafeDisc"),
+ new(new FilePathMatch("CLCD16.DLL"), GetSafeDiscCLCD16Version, "SafeDisc"),
+ new(new FilePathMatch("CLCD32.DLL"), GetSafeDiscCLCD32Version, "SafeDisc"),
+ new(new FilePathMatch("CLOKSPL.EXE"), GetSafeDiscCLOKSPLVersion, "SafeDisc"),
- //new PathMatchSet(new PathMatch("00000001.TMP", useEndsWith: true), GetSafeDisc00000001TMPVersion, "SafeDisc"),
- new PathMatchSet(new PathMatch("00000002.TMP", useEndsWith: true), "SafeDisc 2+"),
+ //new(new FilePathMatch("00000001.TMP"), GetSafeDisc00000001TMPVersion, "SafeDisc"),
+ new(new FilePathMatch("00000002.TMP"), "SafeDisc 2+"),
// TODO: Research "splash16.bmp" and "splash256.bmp".
- new PathMatchSet(new FilePathMatch("DPLAYERX.DLL"), GetSafeDiscDPlayerXVersion, "SafeDisc"),
- new PathMatchSet(new FilePathMatch("drvmgt.dll"), GetSafeDiscDrvmgtVersion, "SafeDisc"),
+ new(new FilePathMatch("DPLAYERX.DLL"), GetSafeDiscDPlayerXVersion, "SafeDisc"),
+ new(new FilePathMatch("drvmgt.dll"), GetSafeDiscDrvmgtVersion, "SafeDisc"),
// The SD0XXX.dll files appear to solely contain custom strings that allowed the publisher to customize the SafeDisc error messages. They are currently only known to be used by EA.
// Each file appears to contain strings for a specific language each.
@@ -246,54 +246,54 @@ namespace BinaryObjectScanner.Protection
// "d:\DiceCanada\BoosterPack2\Installers\BF2XpackInstaller\Safedisk\SafeDiscDLLs\DLLs\Release\SD0816.pdb" (Redump entry 65569).
// Found in Redump entries 20729 and 65569.
- new PathMatchSet(new PathMatch("SD040e.dll", useEndsWith: true), "SafeDisc"),
+ new(new FilePathMatch("SD040e.dll"), "SafeDisc"),
// Found in Redump entry 65569.
- new PathMatchSet(new PathMatch("SD0c0a.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD040b.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD040c.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0419.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD041d.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD041e.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0404.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0405.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0406.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0407.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0409.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0410.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0411.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0412.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0413.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0414.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0415.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0416.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0804.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0809.dll", useEndsWith: true), "SafeDisc"),
- new PathMatchSet(new PathMatch("SD0816.dll", useEndsWith: true), "SafeDisc"),
+ new(new FilePathMatch("SD0c0a.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD040b.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD040c.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0419.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD041d.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD041e.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0404.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0405.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0406.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0407.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0409.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0410.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0411.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0412.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0413.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0414.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0415.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0416.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0804.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0809.dll"), "SafeDisc"),
+ new(new FilePathMatch("SD0816.dll"), "SafeDisc"),
// Found in Redump entries 28810 and 30555.
// Name check overmatches with a seemingly completely unrelated application, ironically included on at least one SafeDisc game (Redump entry 34828).
- // new PathMatchSet(new PathMatch("mcp.dll", useEndsWith: true), "SafeDisc (Version 1.45.011-1.50.020)"),
+ // new(new FilePathMatch("mcp.dll"), "SafeDisc (Version 1.45.011-1.50.020)"),
// Found in Redump entry 58455 and 65569.
// Unknown if it's a game specific file, but it contains the stxt371 and stxt774 sections.
- // new PathMatchSet(new PathMatch("CoreDLL.dll", useEndsWith: true), "SafeDisc"),
+ // new(new FilePathMatch("CoreDLL.dll"), "SafeDisc"),
// Found in Redump entry 58990.
- new PathMatchSet(new PathMatch("SafediskSplash.bmp", useEndsWith: true), "SafeDisc"),
+ new(new FilePathMatch("SafediskSplash.bmp"), "SafeDisc"),
// Used to distribute SafeDisc driver updates over the internet. Two distinct versions known to exist, with Microsoft also having distributed the later update as well.
// Version 1: https://web.archive.org/web/20040614184055/http://www.macrovision.com:80/products/safedisc/safedisc.exe
// Version 2: https://web.archive.org/web/20051104123646/http://www.macrovision.com/products/safedisc/safedisc.exe
// Microsoft download page: https://web.archive.org/web/20080204081329/http://www.microsoft.com/downloads/details.aspx?FamilyID=eae20f0f-c41c-44fe-84ce-1df707d7a2e9&DisplayLang=en
- new PathMatchSet(new PathMatch("safedisc.exe", useEndsWith: true), "SafeDisc Driver Installer"),
+ new(new FilePathMatch("safedisc.exe"), "SafeDisc Driver Installer"),
// Found in seemingly every SafeDisc Lite disc. (CD: Redump entries 25579 and 57986. DVD: Redump entry 63941).
- new PathMatchSet(new PathMatch("00000001.LT1", useEndsWith: true), "SafeDisc Lite"),
- new PathMatchSet(new PathMatch("LTDLL.DLL", useEndsWith: true), "SafeDisc Lite"),
+ new(new FilePathMatch("00000001.LT1"), "SafeDisc Lite"),
+ new(new FilePathMatch("LTDLL.DLL"), "SafeDisc Lite"),
// Found in Redump entry 42762.
- new PathMatchSet(".SafeDiscDVD.bundle", "SafeDisc for Macintosh"),
+ new(".SafeDiscDVD.bundle", "SafeDisc for Macintosh"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -306,21 +306,20 @@ namespace BinaryObjectScanner.Protection
// The hash of the file CLCD16.dll is able to provide a broad version range that appears to be consistent, but it seems it was rarely updated so these checks are quite broad.
var sha1 = GetFileSHA1(firstMatchedString);
- switch (sha1)
+ return sha1 switch
{
// Found in Redump entries 61731 and 66005.
- case "C13493AB753891B8BEE9E4E014896B026C01AC92":
- return "1.00.025-1.01.044";
+ "C13493AB753891B8BEE9E4E014896B026C01AC92" => "1.00.025-1.01.044",
+
// Found in Redump entries 1882 and 30049.
// It is currently unknown why the previous hash covers both the version before this one, and several afterwards, with this one being a consistent outlier between these versions.
- case "2418D791C7B9D4F05BCB01FAF98F770CDF798464":
- return "1.00.026";
+ "2418D791C7B9D4F05BCB01FAF98F770CDF798464" => "1.00.026",
+
// Found in Redump entries 31149 and 28810.
- case "848EDF9F45A8437438B7289BB4D2D1BCF752FD4A":
- return "1.06.000-1.50.020/Lite";
- default:
- return "Unknown Version (Report this to us on GitHub)";
- }
+ "848EDF9F45A8437438B7289BB4D2D1BCF752FD4A" => "1.06.000-1.50.020/Lite",
+
+ _ => "Unknown Version (Report this to us on GitHub)",
+ };
}
internal static string GetSafeDiscCLCD32Version(string firstMatchedString, IEnumerable? files)
@@ -330,86 +329,85 @@ namespace BinaryObjectScanner.Protection
// The hash of the file CLCD32.dll so far appears to be a solid indicator of version for versions it was used with. It appears to have been updated with every release, unlike its counterpart, CLCD16.dll.
var sha1 = GetFileSHA1(firstMatchedString);
- switch (sha1)
+ return sha1 switch
{
// Found in Redump entry 66005.
- case "BAD49BA0DEA041E85EF1CABAA9F0ECD822CE1376":
- return "1.00.025";
+ "BAD49BA0DEA041E85EF1CABAA9F0ECD822CE1376" => "1.00.025",
+
// Found in Redump entry 34828.
- case "6137C7E789A329865649FCB8387B963FC8C763C6":
- return "1.00.026 (pre-10/1998)";
+ "6137C7E789A329865649FCB8387B963FC8C763C6" => "1.00.026 (pre-10/1998)",
+
// Found in Redump entries 1882 and 30049.
- case "AFEFBBF1033EA65C366A1156E21566DB419CFD7B":
- return "1.00.026 (post-10/1998)";
+ "AFEFBBF1033EA65C366A1156E21566DB419CFD7B" => "1.00.026 (post-10/1998)",
+
// Found in Redump entries 31575 and 41923.
- case "6E54AC24C344E4A132D1B7A6A61B2EC824DE5092":
- return "1.00.030";
+ "6E54AC24C344E4A132D1B7A6A61B2EC824DE5092" => "1.00.030",
+
// Found in Redump entries 1883 and 42114.
- case "23DAA95DAF75732C27CEB133A00F7E10D1D482D3":
- return "1.00.032";
+ "23DAA95DAF75732C27CEB133A00F7E10D1D482D3" => "1.00.032",
+
// Found in Redump entries 36223 and 40771.
- case "C8F609DDFC3E1CF69FADD60B7AED7A63B4B1DA62":
- return "1.00.035";
+ "C8F609DDFC3E1CF69FADD60B7AED7A63B4B1DA62" => "1.00.035",
+
// Found in Redump entries 42155 and 47574.
- case "39CC3C053702D9F6EFF0DF6535E54F6C78CEA639":
- return "1.01.034";
+ "39CC3C053702D9F6EFF0DF6535E54F6C78CEA639" => "1.01.034",
+
// Found in Redump entry 51459.
- case "BC476F625A4A7A89AE50E2A4CD0F248D6CEB5A84":
- return "1.01.038";
+ "BC476F625A4A7A89AE50E2A4CD0F248D6CEB5A84" => "1.01.038",
+
// Found in Redump entries 34562 and 63304.
- case "1AB79AA78F706A1A24C02CE2B9398EC78249700B":
- return "1.01.043";
+ "1AB79AA78F706A1A24C02CE2B9398EC78249700B" => "1.01.043",
+
// Found in Redump entries 61731 and 81619.
- case "E2326F66EA9C2E5153EC619EEE424D83E2FD4CA4":
- return "1.01.044";
+ "E2326F66EA9C2E5153EC619EEE424D83E2FD4CA4" => "1.01.044",
+
// Found in Redump entries 29073 and 31149.
- case "AEDE9939C4B62AC6DCCE3A771919B23A661247B3":
- return "1.06.000";
+ "AEDE9939C4B62AC6DCCE3A771919B23A661247B3" => "1.06.000",
+
// Found in Redump entries 9718 and 46756.
- case "B5503E2222B3DA387BB5D7150A4A32A47824988F":
- return "1.07.000";
+ "B5503E2222B3DA387BB5D7150A4A32A47824988F" => "1.07.000",
+
// Found in Redump entries 12885 and 66210.
- case "7D33EA7B241245182FFB7A392873079B6183050B":
- return "1.09.000";
+ "7D33EA7B241245182FFB7A392873079B6183050B" => "1.09.000",
+
// Found in Redump entries 37523 and 66586.
- case "61A4A5A758A5CFFB226CE2AE96E55A40AB073AC6":
- return "1.11.000";
+ "61A4A5A758A5CFFB226CE2AE96E55A40AB073AC6" => "1.11.000",
+
// Found in Redump entries 21154 and 37982.
- case "14D3267C1D5C925F6DA44F1B19CB14F6DFCA73E3":
- return "1.20.000";
+ "14D3267C1D5C925F6DA44F1B19CB14F6DFCA73E3" => "1.20.000",
+
// Found in Redump entry 37920.
- case "CB4570F3F37E0FA70D7B9F3211FDC2105864C664":
- return "1.20.001";
+ "CB4570F3F37E0FA70D7B9F3211FDC2105864C664" => "1.20.001",
+
// Found in Redump entries 31526 and 55080.
- case "1B5FD2D3DFBD89574D602DA9AE317C55F24902F0":
- return "1.30.010";
+ "1B5FD2D3DFBD89574D602DA9AE317C55F24902F0" => "1.30.010",
+
// Found in Redump entries 9617 and 49552.
- case "CC73C219BFC2D729515D25CA1B93D53672153175":
- return "1.35.000";
+ "CC73C219BFC2D729515D25CA1B93D53672153175" => "1.35.000",
+
// Found in Redump entries 2595 and 30121.
- case "5825FF56B50114CD5D82BD4667D7097B29973197":
- return "1.40.004";
+ "5825FF56B50114CD5D82BD4667D7097B29973197" => "1.40.004",
+
// Found in Redump entries 44350 and 63323.
- case "38DE3C6CF8FA89E5E99C359AA8ABFC65ADE396A5":
- return "1.41.000";
+ "38DE3C6CF8FA89E5E99C359AA8ABFC65ADE396A5" => "1.41.000",
+
// Found in Redump entries 37832 and 42091.
- case "894D38AD949576928F67FF1595DC9C877A34A91C":
- return "1.41.001";
+ "894D38AD949576928F67FF1595DC9C877A34A91C" => "1.41.001",
+
// Found in Redump entries 30555 and 55078.
- case "0235E03CA78232417C93FBB5F56B1BE819926B0C":
- return "1.45.011";
+ "0235E03CA78232417C93FBB5F56B1BE819926B0C" => "1.45.011",
+
// Found in Redump entries 28810 and 62935.
- case "331B777A0BA2A358982575EA3FAA2B59ECAEA404":
- return "1.50.020";
+ "331B777A0BA2A358982575EA3FAA2B59ECAEA404" => "1.50.020",
+
// Found in Redump entries 57986 and 63941.
- case "85A92DC1D9CCBA6349D70F489043E649A8C21F2B":
- return "Lite";
+ "85A92DC1D9CCBA6349D70F489043E649A8C21F2B" => "Lite",
+
// Found in Redump entry 14928.
- case "538351FF5955A3D8438E8C278E9D6D6274CF13AB":
- return "Lite";
- default:
- return "Unknown Version (Report this to us on GitHub)";
- }
+ "538351FF5955A3D8438E8C278E9D6D6274CF13AB" => "Lite",
+
+ _ => "Unknown Version (Report this to us on GitHub)",
+ };
}
internal static string GetSafeDiscCLOKSPLVersion(string firstMatchedString, IEnumerable? files)
@@ -430,80 +428,79 @@ namespace BinaryObjectScanner.Protection
// The hash of every "CLOKSPL.EXE" correlates directly to a specific SafeDisc version.
var sha1 = GetFileSHA1(firstMatchedString);
- switch (sha1)
+ return sha1 switch
{
// Found in Redump entry 66005.
- case "DD131A7B988065764E2A0F20B66C89049B20A7DE":
- return "1.00.025";
+ "DD131A7B988065764E2A0F20B66C89049B20A7DE" => "1.00.025",
+
// Found in Redump entry 34828.
- case "41C8699A6E0F046EB7A21984441B555237DA4758":
- return "1.00.026 (pre-10/1998)";
+ "41C8699A6E0F046EB7A21984441B555237DA4758" => "1.00.026 (pre-10/1998)",
+
// Found in Redump entries 1882 and 30049.
- case "D1C19C26DEC7C33825FFC59AD02B0EBA782643FA":
- return "1.00.026 (post-10/1998)";
+ "D1C19C26DEC7C33825FFC59AD02B0EBA782643FA" => "1.00.026 (post-10/1998)",
+
// Found in Redump entries 31575 and 41923.
- case "B7C6C61688B354AB5D4E20CDEB36C992F203289B":
- return "1.00.030";
+ "B7C6C61688B354AB5D4E20CDEB36C992F203289B" => "1.00.030",
+
// Found in Redump entries 1883 and 42114.
- case "7445CD9FB49C322D18E92CC457DD880967C2B010":
- return "1.00.032";
+ "7445CD9FB49C322D18E92CC457DD880967C2B010" => "1.00.032",
+
// Found in Redump entries 36223 and 40771.
- case "50D4466F55BEDB3FE0E262235A6BAC751CA26599":
- return "1.00.035";
+ "50D4466F55BEDB3FE0E262235A6BAC751CA26599" => "1.00.035",
+
// Found in Redump entries 42155 and 47574.
- case "8C2F792326856C6D326707F76823FC7430AC86D5":
- return "1.01.034";
+ "8C2F792326856C6D326707F76823FC7430AC86D5" => "1.01.034",
+
// Found in Redump entry 51459.
- case "107BF8077255FD4CA0875FB7C306F0B427E66800":
- return "1.01.038";
+ "107BF8077255FD4CA0875FB7C306F0B427E66800" => "1.01.038",
+
// Found in Redump entries 34562 and 63304.
- case "E8F4BA30376FCDAE00E7B88312300172674ABFA9":
- return "1.01.043";
+ "E8F4BA30376FCDAE00E7B88312300172674ABFA9" => "1.01.043",
+
// Found in Redump entries 61731 and 81619.
- case "CAB911C5CFC0A13C822DBFE0F0E1570C09F211FB":
- return "1.01.044";
+ "CAB911C5CFC0A13C822DBFE0F0E1570C09F211FB" => "1.01.044",
+
// Found in Redump entries 29073 and 31149.
- case "43C1318B38742E05E7C858A02D64EEA13D9DFB9B":
- return "1.06.000";
+ "43C1318B38742E05E7C858A02D64EEA13D9DFB9B" => "1.06.000",
+
// Found in Redump entries 9718 and 46756.
- case "451BD4C60AB826C16840815996A5DF03672666A8":
- return "1.07.000";
+ "451BD4C60AB826C16840815996A5DF03672666A8" => "1.07.000",
+
// Found in Redump entries 12885 and 66210.
- case "6C02A20A521112777D4843B8ACD9278F34314A35":
- return "1.09.000";
+ "6C02A20A521112777D4843B8ACD9278F34314A35" => "1.09.000",
+
// Found in Redump entries 37523 and 66586.
- case "0548F1B12F60395C9394DDB7BED5E3E65E09D72E":
- return "1.11.000";
+ "0548F1B12F60395C9394DDB7BED5E3E65E09D72E" => "1.11.000",
+
// Found in Redump entries 21154 and 37982.
- case "64A406FE640F2AC86A0E23F619F6EBE63BFFB8A1":
- return "1.20.000";
+ "64A406FE640F2AC86A0E23F619F6EBE63BFFB8A1" => "1.20.000",
+
// Found in Redump entry 37920.
- case "8E874C9AF4CE5A9F1CBE96FCC761AA1C201C6938":
- return "1.20.001";
+ "8E874C9AF4CE5A9F1CBE96FCC761AA1C201C6938" => "1.20.001",
+
// Found in Redump entries 31526 and 55080.
- case "766EC536A10E68513138D1183705F5F19B9B8091":
- return "1.30.010";
+ "766EC536A10E68513138D1183705F5F19B9B8091" => "1.30.010",
+
// Found in Redump entries 9617 and 49552.
- case "1F1460FD66DD518159CCCDC99C12252EA0B2EEC4":
- return "1.35.000";
+ "1F1460FD66DD518159CCCDC99C12252EA0B2EEC4" => "1.35.000",
+
// Found in Redump entries 2595 and 30121.
- case "B1CF007BA36BA1B207DE334635F7BCEC146F8E35":
- return "1.40.004";
+ "B1CF007BA36BA1B207DE334635F7BCEC146F8E35" => "1.40.004",
+
// Found in Redump entries 44350 and 63323.
- case "90F92A6DB15387F4C7619C442493791EBFC1041B":
- return "1.41.000";
+ "90F92A6DB15387F4C7619C442493791EBFC1041B" => "1.41.000",
+
// Found in Redump entries 37832 and 42091.
- case "836D42BF7B7AD719AB67682CF8D6B2D9C07AD218":
- return "1.41.001";
+ "836D42BF7B7AD719AB67682CF8D6B2D9C07AD218" => "1.41.001",
+
// Found in Redump entries 30555 and 55078.
- case "24DE959BC4484CD95DAA26947670C63A161E64AE":
- return "1.45.011";
+ "24DE959BC4484CD95DAA26947670C63A161E64AE" => "1.45.011",
+
// Found in Redump entries 28810 and 62935.
- case "9758F0637184816D02049A53CD2653F0BFFE92C9":
- return "1.50.020";
- default:
- return "Unknown Version (Report this to us on GitHub)";
- }
+ "9758F0637184816D02049A53CD2653F0BFFE92C9" => "1.50.020",
+
+ _ => "Unknown Version (Report this to us on GitHub)",
+ };
}
internal static string GetSafeDiscDPlayerXVersion(string firstMatchedString, IEnumerable? files)
@@ -511,48 +508,39 @@ namespace BinaryObjectScanner.Protection
if (string.IsNullOrEmpty(firstMatchedString) || !File.Exists(firstMatchedString))
return string.Empty;
- FileInfo fi = new FileInfo(firstMatchedString);
- switch (fi.Length)
+ var fi = new FileInfo(firstMatchedString);
+ return fi.Length switch
{
// File size of "dplayerx.dll" and others is a commonly used indicator of SafeDisc version, though it has been found to not be completely consistent.
// Checks for versions 1.2X have been commented out, due to these versions already being detected via more accurate checks.
// Examples of "dplayerx.dll" that are detected using these more accurate checks can be found in Redump entries 28810, 30121, and 37982.
// Found in Redump entry 34828.
- case 81_408:
- return "1.00.026 (pre-10/1998)";
+ 81_408 => "1.00.026 (pre-10/1998)",
// Found in Redump entries 21154, 41923, 42114, and 66005.
- case 78_848:
- return "1.00.025-1.00.032";
+ 78_848 => "1.00.025-1.00.032",
// Found in Redump entries 36223 and 40771.
- case 77_824:
- return "1.00.035";
+ 77_824 => "1.00.035",
// Found in Redump entries 42155 and 47574.
- case 115_712:
- return "1.01.034";
+ 115_712 => "1.01.034",
// Found in Redump entry 42155.
- case 116_736:
- return "1.01.038";
+ 116_736 => "1.01.038",
// Found in Redump entries 34562 and 63304.
- case 124_416:
- return "1.01.043";
+ 124_416 => "1.01.043",
// Found in Redump entries 61731 and 81619.
- case 125_952:
- return "1.01.044";
+ 125_952 => "1.01.044",
// Found in Redump entries 29073 and 31149.
- case 155_648:
- return "1.06.000";
+ 155_648 => "1.06.000",
// Found in Redump entries 9718, 12885, and 37523.
- case 156_160:
- return "1.07.000-1.11.000";
+ 156_160 => "1.07.000-1.11.000",
// File size checks for versions 1.2X+ are superceded by executable string checks, which are more accurate. For reference, the previously used file sizes are kept as comments.
// 157,184 bytes corresponds to SafeDisc 1.20.000-1.20.001 (Redump entries 21154 and 37920).
@@ -563,9 +551,8 @@ namespace BinaryObjectScanner.Protection
// 136,704 bytes corresponds to SafeDisc 1.45.011 (Redump entries 30555 and 55078).
// 138,752 bytes corresponds to SafeDisc 1.50.020 (Redump entries 28810 and 62935).
- default:
- return "1";
- }
+ _ => "1",
+ };
}
internal static string GetSafeDiscDrvmgtVersion(string firstMatchedString, IEnumerable? files)
@@ -578,200 +565,169 @@ namespace BinaryObjectScanner.Protection
// Particularly interesting inconsistencies will be noted below:
// Redump entry 73786 has an EXE with a scrubbed version, a DIAG.exe with a version of 4.60.000, and a copy of drvmgt.dll belonging to version 3.10.020. This seems like an accidental(?) distribution of older drivers, as this game was released 3 years after the use of 3.10.020.
var sha1 = GetFileSHA1(firstMatchedString);
- switch (sha1)
+ return sha1 switch
{
// Found in Redump entry 102979.
- case "B858CB282617FB0956D960215C8E84D1CCF909C6":
- return "(Empty File)";
+ "B858CB282617FB0956D960215C8E84D1CCF909C6" => "(Empty File)",
+
// Found in Redump entries 29073 and 31149.
- case "33434590D7DE4EEE2C35FCC98B0BF141F422B26D":
- return "1.06.000";
+ "33434590D7DE4EEE2C35FCC98B0BF141F422B26D" => "1.06.000",
+
// Found in Redump entries 9718 and 46756.
- case "D5E4C99CDCA8091EC8010FCB96C5534A8BE35B43":
- return "1.07.000";
+ "D5E4C99CDCA8091EC8010FCB96C5534A8BE35B43" => "1.07.000",
+
// Found in Redump entries 12885 and 66210.
- case "412067F80F6B644EDFB25932EA34A7E92AD4FC21":
- return "1.09.000";
+ "412067F80F6B644EDFB25932EA34A7E92AD4FC21" => "1.09.000",
+
// Found in Redump entries 37523 and 66586.
- case "87C0DA1B52681FA8052A915E85699738993BEA72":
- return "1.11.000";
+ "87C0DA1B52681FA8052A915E85699738993BEA72" => "1.11.000",
+
// Found in Redump entries 21154 and 37982.
- case "3569FE747311265FDC83CBDF13361B4E06484725":
- return "1.20.000";
+ "3569FE747311265FDC83CBDF13361B4E06484725" => "1.20.000",
+
// Found in Redump entry 37920.
- case "89795A34A2CAD4602713524365F710948F7367D0":
- return "1.20.001";
+ "89795A34A2CAD4602713524365F710948F7367D0" => "1.20.001",
+
// Found in Redump entries 31526 and 55080.
- case "D31725FF99BE44BC1BFFF171F4C4705F786B8E91":
- return "1.30.010";
+ "D31725FF99BE44BC1BFFF171F4C4705F786B8E91" => "1.30.010",
+
// Found in Redump entries 9617 and 49552.
- case "2A86168FE8EFDFC31ABCC7C5D55A1A693F2483CD":
- return "1.35.000";
+ "2A86168FE8EFDFC31ABCC7C5D55A1A693F2483CD" => "1.35.000",
+
// Found in Redump entries 2595 and 30121.
- case "8E41DB1C60BBAC631B06AD4F94ADB4214A0E65DC":
- return "1.40.004";
+ "8E41DB1C60BBAC631B06AD4F94ADB4214A0E65DC" => "1.40.004",
+
// Found in Redump entries 44350 and 63323.
- case "833EA803FB5B0FA22C9CF4DD840F0B7DE31D24FE":
- return "1.41.000";
+ "833EA803FB5B0FA22C9CF4DD840F0B7DE31D24FE" => "1.41.000",
+
// Found in Redump entries 37832 and 42091.
- case "1A9C8F6A5BD68F23CA0C8BCB890991AB214F14E0":
- return "1.41.001";
+ "1A9C8F6A5BD68F23CA0C8BCB890991AB214F14E0" => "1.41.001",
+
// Found in Redump entries 30555 and 55078.
- case "0BF4574813EA92FEE373481CA11DF220B6C4F61A":
- return "1.45.011";
+ "0BF4574813EA92FEE373481CA11DF220B6C4F61A" => "1.45.011",
+
// Found in Redump entries 28810 and 62935.
- case "812121D39D6DCC4947E177240655903DEC4DA15A":
- return "1.50.020";
+ "812121D39D6DCC4947E177240655903DEC4DA15A" => "1.50.020",
+
// Found in Redump entries 72195 and 73502.
- case "04ED7AC39FE7A6FAB497A498CBCFF7DA19BF0556":
- return "2.05.030";
+ "04ED7AC39FE7A6FAB497A498CBCFF7DA19BF0556" => "2.05.030",
+
// Found in Redump entries 38541 and 59462 and 81096.
- case "0AB8330A33E188A29E8CE1EA9625AA5935D7E8CE":
- return "2.10.030";
+ "0AB8330A33E188A29E8CE1EA9625AA5935D7E8CE" => "2.10.030",
+
// Found in Redump entries 55823 and 79476.
- case "5198DA51184CA9F3A8096C6136F645B454A85F6C":
- return "2.30.030";
+ "5198DA51184CA9F3A8096C6136F645B454A85F6C" => "2.30.030",
+
// Found in Redump entries 15312 and 48863.
- case "414CAC2BE3D9BE73796D51A15076A5A323ABBF2C":
- return "2.30.031";
+ "414CAC2BE3D9BE73796D51A15076A5A323ABBF2C" => "2.30.031",
+
// Found in Redump entries 9819 and 53658.
- case "126DCA2317DA291CBDE13A91B3FE47BA4719446A":
- return "2.30.033";
+ "126DCA2317DA291CBDE13A91B3FE47BA4719446A" => "2.30.033",
+
// Found in Redump entries 9846 and 65642.
- case "1437C8C149917C76F741C6DBEE6B6B0CC0664F13":
- return "2.40.010";
+ "1437C8C149917C76F741C6DBEE6B6B0CC0664F13" => "2.40.010",
+
// Found in Redump entries 23786 and 37478.
- case "10FAD492991C251C9C9394A2B746C1BF48A18173":
- return "2.40.011";
+ "10FAD492991C251C9C9394A2B746C1BF48A18173" => "2.40.011",
+
// Found in Redump entries 30022 and 75014.
- case "94267BB97C418A6AA22C1354E38136F889EB0B6A":
- return "2.51.020";
+ "94267BB97C418A6AA22C1354E38136F889EB0B6A" => "2.51.020",
+
// Found in Redump entries 31666 and 66852.
- case "27D5E7F7EEE1F22EBDAA903A9E58A7FDB50EF82C":
- return "2.51.021";
+ "27D5E7F7EEE1F22EBDAA903A9E58A7FDB50EF82C" => "2.51.021",
+
// Found in Redump entries 2064 and 47047.
- case "F346F4D0CAB4775041AD692A6A49C47D34D46571":
- return "2.60.052";
+ "F346F4D0CAB4775041AD692A6A49C47D34D46571" => "2.60.052",
+
// Found in Redump entries 13048 and 35385.
- case "88C7AA6E91C9BA5F2023318048E3C3571088776F":
- return "2.70.030";
+ "88C7AA6E91C9BA5F2023318048E3C3571088776F" => "2.70.030",
+
// Found in Redump entries 48101 and 64198.
- case "544EE77889092129E9818B5086E19197E5771C7F":
- return "2.72.000";
+ "544EE77889092129E9818B5086E19197E5771C7F" => "2.72.000",
+
// Found in Redump entries 32783 and 72743.
- case "EA6E24B1F306391CD78A1E7C2F2C0C31828EF004":
- return "2.80.010";
+ "EA6E24B1F306391CD78A1E7C2F2C0C31828EF004" => "2.80.010",
+
// Found in Redump entries 39273 and 59351.
- case "1BF885FDEF8A1824C34C10E2729AD133F70E1516":
- return "2.80.011";
+ "1BF885FDEF8A1824C34C10E2729AD133F70E1516" => "2.80.011",
+
// Found in Redump entries 11638, 52606, and 62505.
- case "B824ED257946EEE93F438B25C855E9DDE7A3671A":
- return "2.90.010-2.90.040";
+ "B824ED257946EEE93F438B25C855E9DDE7A3671A" => "2.90.010-2.90.040",
+
// Found in Redump entries 13230 and 68204.
- case "CDA56FD150C9E9A19D7AF484621352122431F029":
- return "3.10.020";
+ "CDA56FD150C9E9A19D7AF484621352122431F029" => "3.10.020",
+
// Found in Redump entries 36511 and 74338.
- case "E5504C4C31561D38C1F626C851A8D06212EA13E0":
- return "3.15.010";
+ "E5504C4C31561D38C1F626C851A8D06212EA13E0" => "3.15.010",
+
// Found in Redump entries 15383 and 35512.
- case "AABA7B3EF08E80BC55282DA3C3B7AA598379D385":
- return "3.15.011";
+ "AABA7B3EF08E80BC55282DA3C3B7AA598379D385" => "3.15.011",
+
// Found in Redump entries 58625, 75782, and 84586.
// The presence of any drvmgt.dll file at all is notably missing in several games with SafeDisc versions 3.20.020-3.20.024, including Redump entries 20729, 30404, and 56748.
// TODO: Further investigate versions 3.20.020-3.20.024, and verify that 3.20.024 doesn't use drvmgt.dll at all.
- case "ECB341AB36C5B3B912F568D347368A6A2DEF8D5F":
- return "3.20.020-3.20.022";
+ "ECB341AB36C5B3B912F568D347368A6A2DEF8D5F" => "3.20.020-3.20.022",
+
// Found in Redump entries 53666, 76775, and 102301.
- case "69C776F67EBD53CB5FD760B498B4A491BF22F293":
- return "3.20.022";
+ "69C776F67EBD53CB5FD760B498B4A491BF22F293" => "3.20.022",
+
// Found in Redump entry 102806.
- case "2BD7CD06CED6F6FB1A31AAE2D6C403C166366C6F":
- return "3.20.022";
+ "2BD7CD06CED6F6FB1A31AAE2D6C403C166366C6F" => "3.20.022",
+
// Found in Redump entries 15614, 79729, 83408, and 86196.
// The presence of any drvmgt.dll file at all is notably missing in several games with SafeDisc versions 4.00.001-4.00.003, including Redump entries 33326, 51597, and 67927.
- case "E21FF43C2E663264D6CB11FBBC31EB1DCEE42B1A":
- return "4.00.000-4.00.003";
+ "E21FF43C2E663264D6CB11FBBC31EB1DCEE42B1A" => "4.00.000-4.00.003",
+
// Found in Redump entry 49677.
- case "7C5AB9BDF965B70E60B99086519327168F43F362":
- return "4.00.002";
+ "7C5AB9BDF965B70E60B99086519327168F43F362" => "4.00.002",
+
// Found in Redump entries 46765 and 78980.
- case "A5247EC0EC50B8F470C93BF23E3F2514C402D5AD":
- return "4.00.002+";
+ "A5247EC0EC50B8F470C93BF23E3F2514C402D5AD" => "4.00.002+",
+
// Found in Redump entries 74564 and 80776.
// The presence of any drvmgt.dll file at all is notably missing in several games with SafeDisc versions 4.50.000, including Redump entries 58990 and 65569.
- case "C658E0B4992903D5E8DD9B235C25CB07EE5BFEEB":
- return "4.50.000";
- // Found in Redump entry 20092.
- case "02F373C1D246DBEFBFD5F39B6D0E40E2964B0027":
- return "4.60.000";
- // Found in Redump entry 56320.
- case "84480ABCE4676EEB9C43DFF7C5C49F0D574FAC25":
- return "4.70.000";
- // Found distributed in https://web.archive.org/web/20040614184055/http://www.macrovision.com:80/products/safedisc/safedisc.exe and https://web.archive.org/web/20010707163339/http://www.macrovision.com:80/demos/safedisc.exe, but unknown what version it is associated with.
- case "8426690FA43076EE466FD1B2D1F2F1267F9CC3EC":
- return "Unknown Version (Report this to us on GitHub)";
- default:
- return "Unknown Version (Report this to us on GitHub)";
+ "C658E0B4992903D5E8DD9B235C25CB07EE5BFEEB" => "4.50.000",
- // File size of drvmgt.dll and others is a commonly used indicator of SafeDisc version, though it has been found to not be completely consistent, and is completely replaced by hash checks.
- // 34,816 bytes corresponds to SafeDisc 1.0x
- // 32,256 bytes corresponds to SafeDisc 1.1x-1.3x
- // 31,744 bytes corresponds to SafeDisc 1.4x
- // 34,304 bytes corresponds to SafeDisc 1.5x-2.40
- // 35,840 bytes corresponds to SafeDisc 2.51-2.60
- // 40,960 bytes corresponds to SafeDisc 2.70
- // 23,552 bytes corresponds to SafeDisc 2.80
- // 41,472 bytes corresponds to SafeDisc 2.90-3.10
- // 24,064 bytes corresponds to SafeDisc 3.15-3.20;
- }
+ // Found in Redump entry 20092.
+ "02F373C1D246DBEFBFD5F39B6D0E40E2964B0027" => "4.60.000",
+
+ // Found in Redump entry 56320.
+ "84480ABCE4676EEB9C43DFF7C5C49F0D574FAC25" => "4.70.000",
+
+ // Found distributed in https://web.archive.org/web/20040614184055/http://www.macrovision.com:80/products/safedisc/safedisc.exe and https://web.archive.org/web/20010707163339/http://www.macrovision.com:80/demos/safedisc.exe, but unknown what version it is associated with.
+ "8426690FA43076EE466FD1B2D1F2F1267F9CC3EC" => "Unknown Version (Report this to us on GitHub)",
+
+ _ => "Unknown Version (Report this to us on GitHub)",
+ };
}
private string? GetVersionFromSHA1Hash(string sha1Hash)
{
- switch (sha1Hash.ToLowerInvariant())
+ return sha1Hash.ToLowerInvariant() switch
{
// dplayerx.dll
- case "f7a57f83bdc29040e20fd37cd0c6d7e6b2984180":
- return "1.00.030";
- case "a8ed1613d47d1b5064300ff070484528ebb20a3b":
- return "1.11.000";
- case "ed680e9a13f593e7a80a69ee1035d956ab62212b":
- return "1.3x";
- case "66d8589343e00fa3e11bbf462e38c6f502515bea":
- return "1.30.010";
- case "5751ae2ee805d31227cfe7680f3c8be4ab8945a3":
- return "1.40";
+ "f7a57f83bdc29040e20fd37cd0c6d7e6b2984180" => "1.00.030",
+ "a8ed1613d47d1b5064300ff070484528ebb20a3b" => "1.11.000",
+ "ed680e9a13f593e7a80a69ee1035d956ab62212b" => "1.3x",
+ "66d8589343e00fa3e11bbf462e38c6f502515bea" => "1.30.010",
+ "5751ae2ee805d31227cfe7680f3c8be4ab8945a3" => "1.40",
// secdrv.sys
- case "b64ad3ec82f2eb9fb854512cb59c25a771322181":
- return "1.11.000";
- case "ebf69b0a96adfc903b7e486708474dc864cc0c7c":
- return "1.40.004";
- case "f68a1370660f8b94f896bbba8dc6e47644d19092":
- return "2.30";
- case "60bc8c3222081bf76466c521474d63714afd43cd":
- return "2.40";
- case "08ceca66432278d8c4e0f448436b77583c3c61c8":
- return "2.50";
- case "10080eb46bf76ac9cf9ea74372cfa4313727f0ca":
- return "2.51";
- case "832d359a6de191c788b0e61e33f3d01f8d793d3c":
- return "2.70";
- case "afcfaac945a5b47712719a5e6a7eb69e36a5a6e0":
- case "cb24fbe8aa23a49e95f3c83fb15123ffb01f43f4":
- return "2.80";
- case "0383b69f98d0a9c0383c8130d52d6b431c79ac48":
- return "2.90";
- case "d7c9213cc78ff57f2f655b050c4d5ac065661aa9":
- return "3.20";
- case "fc6fedacc21a7244975b8f410ff8673285374cc2":
- return "4.00.002"; // Also 4.60.000, might be a fluke
- case "2d9f54f35f5bacb8959ef3affdc3e4209a4629cb":
- return "1-4";
+ "b64ad3ec82f2eb9fb854512cb59c25a771322181" => "1.11.000",
+ "ebf69b0a96adfc903b7e486708474dc864cc0c7c" => "1.40.004",
+ "f68a1370660f8b94f896bbba8dc6e47644d19092" => "2.30",
+ "60bc8c3222081bf76466c521474d63714afd43cd" => "2.40",
+ "08ceca66432278d8c4e0f448436b77583c3c61c8" => "2.50",
+ "10080eb46bf76ac9cf9ea74372cfa4313727f0ca" => "2.51",
+ "832d359a6de191c788b0e61e33f3d01f8d793d3c" => "2.70",
+ "afcfaac945a5b47712719a5e6a7eb69e36a5a6e0" or "cb24fbe8aa23a49e95f3c83fb15123ffb01f43f4" => "2.80",
+ "0383b69f98d0a9c0383c8130d52d6b431c79ac48" => "2.90",
+ "d7c9213cc78ff57f2f655b050c4d5ac065661aa9" => "3.20",
+ "fc6fedacc21a7244975b8f410ff8673285374cc2" => "4.00.002",// Also 4.60.000, might be a fluke
+ "2d9f54f35f5bacb8959ef3affdc3e4209a4629cb" => "1-4",
- default:
- return null;
- }
+ _ => null,
+ };
}
private string GetSafeDiscDiagExecutableVersion(PortableExecutable pex)
@@ -780,23 +736,22 @@ namespace BinaryObjectScanner.Protection
var version = pex.FileVersion;
if (!string.IsNullOrEmpty(version))
{
- switch (version)
+ return version switch
{
// Found to be in Redump entry 65569.
// The product version is "4.50.00.1619 2005/06/08".
- case "4.50.00.1619":
- return "4.50.0.1619 / SafeDisc 4.50.000";
+ "4.50.00.1619" => "4.50.0.1619 / SafeDisc 4.50.000",
+
// Found to be in Redump entry 20092.
// The product version is "4.60.00.1702 2005/08/03".
- case "4.60.00.1702":
- return "4.60.0.1702 / SafeDisc 4.60.000";
+ "4.60.00.1702" => "4.60.0.1702 / SafeDisc 4.60.000",
+
// Found to be in Redump entry 34783.
// The product version is "4.70.00.1941 2006/04/26".
- case "4.70.00.1941":
- return "4.70.0.1941 / SafeDisc 4.70.000";
- default:
- return $"Unknown Version {version} (Report this to us on GitHub)";
- }
+ "4.70.00.1941" => "4.70.0.1941 / SafeDisc 4.70.000",
+
+ _ => $"Unknown Version {version} (Report this to us on GitHub)",
+ };
}
return "Unknown Version (Report this to us on GitHub)";
diff --git a/BinaryObjectScanner/Protection/Macrovision.cs b/BinaryObjectScanner/Protection/Macrovision.cs
index bf699284..9325fe42 100644
--- a/BinaryObjectScanner/Protection/Macrovision.cs
+++ b/BinaryObjectScanner/Protection/Macrovision.cs
@@ -38,7 +38,7 @@ namespace BinaryObjectScanner.Protection
resultsList.Add(safeCast!);
if (resultsList != null && resultsList.Count > 0)
- return string.Join(", ", resultsList.ToArray());
+ return string.Join(", ", [.. resultsList]);
return null;
}
@@ -158,7 +158,7 @@ namespace BinaryObjectScanner.Protection
// Clean the result list
resultsList = CleanResultList(resultsList);
if (resultsList != null && resultsList.Count > 0)
- return string.Join(", ", resultsList.ToArray());
+ return string.Join(", ", [.. resultsList]);
return null;
}
@@ -276,7 +276,7 @@ namespace BinaryObjectScanner.Protection
resultsList.Add(safeDisc!);
if (resultsList != null && resultsList.Count > 0)
- return string.Join(", ", resultsList.ToArray());
+ return string.Join(", ", [.. resultsList]);
return null;
}
@@ -290,8 +290,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("00000001.TMP", useEndsWith: true), Get00000001TMPVersion, string.Empty),
- new PathMatchSet(new FilePathMatch("secdrv.sys"), GetSecdrvFileSizeVersion, "Macrovision Security Driver"),
+ new(new PathMatch("00000001.TMP", useEndsWith: true), Get00000001TMPVersion, string.Empty),
+ new(new FilePathMatch("secdrv.sys"), GetSecdrvFileSizeVersion, "Macrovision Security Driver"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -302,8 +302,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("00000001.TMP", useEndsWith: true), Get00000001TMPVersion, string.Empty),
- new PathMatchSet(new FilePathMatch("secdrv.sys"), GetSecdrvFileSizeVersion, "Macrovision Security Driver"),
+ new(new PathMatch("00000001.TMP", useEndsWith: true), Get00000001TMPVersion, string.Empty),
+ new(new FilePathMatch("secdrv.sys"), GetSecdrvFileSizeVersion, "Macrovision Security Driver"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -317,21 +317,20 @@ namespace BinaryObjectScanner.Protection
// This file is present in most, if not all, SafeDisc protected discs. It seems to have very consistent file sizes, only being found to use three different file sizes in it's entire run.
// A rough estimate of the product and version can be gotten by checking the file size.
// One filesize is known to overlap with both SafeDisc and CDS-300, and so is detected separately here.
- FileInfo fi = new FileInfo(firstMatchedString);
- switch (fi.Length)
+ var fi = new FileInfo(firstMatchedString);
+ return fi.Length switch
{
// Found in Redump entries 37832 and 66005.
- case 20:
- return "SafeDisc 1.00.025-1.41.001";
+ 20 => "SafeDisc 1.00.025-1.41.001",
+
// Found in Redump entries 30555 and 58573.
- case 2_048:
- return "Macrovision Protection File [Likely indicates either SafeDisc 1.45.011+ (CD) or CDS-300]";
+ 2_048 => "Macrovision Protection File [Likely indicates either SafeDisc 1.45.011+ (CD) or CDS-300]",
+
// Found in Redump entries 11347 and 64255.
- case 20_482_048:
- return "SafeDisc 3+ (DVD)";
- default:
- return "(Unknown Version - Report this to us on GitHub)";
- }
+ 20_482_048 => "SafeDisc 3+ (DVD)",
+
+ _ => "(Unknown Version - Report this to us on GitHub)",
+ };
}
// TODO: Verify these checks and remove any that may not be needed, file version checks should remove the need for any checks for 2.80+.
@@ -340,74 +339,73 @@ namespace BinaryObjectScanner.Protection
if (string.IsNullOrEmpty(firstMatchedString) || !File.Exists(firstMatchedString))
return string.Empty;
- FileInfo fi = new FileInfo(firstMatchedString);
- switch (fi.Length)
+ var fi = new FileInfo(firstMatchedString);
+ return fi.Length switch
{
// Found in Redump entry 102979.
- case 1:
- return "(Empty File)";
+ 1 => "(Empty File)",
+
// Found in Redump entries 9718, 12885, 21154, 31149, 37523, 37920.
- case 14_304:
- return "/ SafeDisc 1.06.000-1.20.001";
+ 14_304 => "/ SafeDisc 1.06.000-1.20.001",
+
// Found in Redump entries 9617 and 31526.
- case 14_368:
- return "/ SafeDisc 1.30.010-1.35.000";
+ 14_368 => "/ SafeDisc 1.30.010-1.35.000",
+
// Found in Redump entries 2595, 37832, and 44350.
- case 10_848:
- return "/ SafeDisc 1.40.004-1.41.001";
+ 10_848 => "/ SafeDisc 1.40.004-1.41.001",
+
// Found in Redump entries 30555 and 55078.
- case 11_968:
- return "/ SafeDisc 1.45.011";
+ 11_968 => "/ SafeDisc 1.45.011",
+
// Found in Redump entries 28810 and 62935.
- case 11_616:
- return "/ SafeDisc 1.50.020";
+ 11_616 => "/ SafeDisc 1.50.020",
+
// Found in Redump entries 72195 and 73502.
- case 18_768:
- return "/ SafeDisc 2.05.030";
+ 18_768 => "/ SafeDisc 2.05.030",
+
// Found in Redump entries 38541 and 59462.
- case 20_128:
- return "/ SafeDisc 2.10.030";
+ 20_128 => "/ SafeDisc 2.10.030",
+
// Found in Redump entries 9819, 15312, 55823.
- case 27_440:
- return "/ SafeDisc 2.30.030-2.30.033";
+ 27_440 => "/ SafeDisc 2.30.030-2.30.033",
+
// Found in Redump entries 9846 and 23786.
- case 28_624:
- return "/ SafeDisc 2.40.010-2.40.011";
+ 28_624 => "/ SafeDisc 2.40.010-2.40.011",
+
// Found in Redump entries 30022 and 31666.
- case 28_400:
- return "/ SafeDisc 2.51.020-2.51.021";
+ 28_400 => "/ SafeDisc 2.51.020-2.51.021",
+
// Found in Redump entries 2064 and 47047.
- case 29_392:
- return "/ SafeDisc 2.60.052";
+ 29_392 => "/ SafeDisc 2.60.052",
+
// Found in Redump entries 13048 and 48101.
- case 11_376:
- return "/ SafeDisc 2.70.030-2.72.000";
+ 11_376 => "/ SafeDisc 2.70.030-2.72.000",
+
// Found in Redump entries 32783 and 39273.
- case 12_464:
- return "3.17.000 / SafeDisc 2.80.010-2.80.011";
+ 12_464 => "3.17.000 / SafeDisc 2.80.010-2.80.011",
+
// Found in Redump entries 11638 and 52606.
- case 12_400:
- return "3.18.000 / SafeDisc 2.90.010-2.90.040";
+ 12_400 => "3.18.000 / SafeDisc 2.90.010-2.90.040",
+
// Found in Redump entries 13230, 15383, and 36511.
- case 12_528:
- return "3.19.000 / SafeDisc 3.10.020-3.15.011";
+ 12_528 => "3.19.000 / SafeDisc 3.10.020-3.15.011",
+
// Found in Redump entries 58625 and 84586.
- case 11_973:
- return "3.22.000 / SafeDisc 3.20.020-3.20.022";
+ 11_973 => "3.22.000 / SafeDisc 3.20.020-3.20.022",
+
// Found in Redump entries 15614, 42034, 45686, 56320, 60021, 79729, and 80776.
- case 163_644:
- return "4.00.060 / SafeDisc 4.00.000-4.70.000";
+ 163_644 => "4.00.060 / SafeDisc 4.00.000-4.70.000",
+
// Found distributed online, but so far not in a game release. TODO: Discover original source.
// Can be found at https://github.com/ericwj/PsSecDrv/blob/master/tools/SECDRV/SECDRV.sys, and the file is confirmed to be distributed officialy by Microsoft: https://www.virustotal.com/gui/file/34bbb0459c96b3de94ccb0d73461562935c583d7bf93828da4e20a6bc9b7301d/.
- case 23_040:
- return "4.03.086 / Product Unknown";
+ 23_040 => "4.03.086 / Product Unknown",
+
// Found in https://web.archive.org/web/20010417215205/http://www.macrovision.com:80/demos/Trialware.exe.
- case 10_784:
- return "/ SafeCast ESD 2.02.040";
+ 10_784 => "/ SafeCast ESD 2.02.040",
+
// This file is not currently known to be used in versions past 4.70.000.
- default:
- return "/ Product Unknown (Report this to us on GitHub)";
- }
+ _ => "/ Product Unknown (Report this to us on GitHub)",
+ };
}
// TODO: Combine with filesize version checks if possible.
@@ -418,36 +416,35 @@ namespace BinaryObjectScanner.Protection
var version = pex.FileVersion;
if (!string.IsNullOrEmpty(version))
{
- switch (version)
+ return version switch
{
// Found in Redump entries 32783 and 39273.
// The product version is "3.17.000 Windows NT 2002/07/01".
- case "3.17.000":
- return "3.17.000 / SafeDisc 2.80.010-2.80.011";
+ "3.17.000" => "3.17.000 / SafeDisc 2.80.010-2.80.011",
+
// Found in Redump entries 11638 and 52606.
// The product version is "3.18.000 Windows NT 2002/11/14".
- case "3.18.000":
- return "3.18.000 / SafeDisc 2.90.010-2.90.040";
+ "3.18.000" => "3.18.000 / SafeDisc 2.90.010-2.90.040",
+
// Found in Redump entries 13230, 15383, and 36511.
// The product version is "3.19.000 Windows NT/2K/XP 2003/03/19".
- case "3.19.000":
- return "3.19.000 / SafeDisc 3.10.020-3.15.011";
+ "3.19.000" => "3.19.000 / SafeDisc 3.10.020-3.15.011",
+
// Found in Redump entries 58625 and 84586.
// The product version is "SECURITY Driver 3.22.000 2004/01/16".
- case "3.22.000":
- return "3.22.000 / SafeDisc 3.20.020-3.20.022";
+ "3.22.000" => "3.22.000 / SafeDisc 3.20.020-3.20.022",
+
// Found in Redump entries 15614, 42034, 45686, 56320, 60021, 79729, and 80776.
// The product version is "SECURITY Driver 4.00.060 2004/08/31".
- case "4.00.060":
- return "4.00.060 / SafeDisc 4.00.000-4.70.000";
+ "4.00.060" => "4.00.060 / SafeDisc 4.00.000-4.70.000",
+
// Found distributed online, but so far not in a game release. TODO: Discover original source.
// Can be found at https://github.com/ericwj/PsSecDrv/blob/master/tools/SECDRV/SECDRV.sys, and the file is confirmed to be distributed officialy by Microsoft: https://www.virustotal.com/gui/file/34bbb0459c96b3de94ccb0d73461562935c583d7bf93828da4e20a6bc9b7301d/.
// The product version is "SECURITY Driver 4.03.086 2006/09/13".
- case "4.03.086":
- return "4.03.086 / Unknown Product";
- default:
- return $"Unknown Version {version} (Report this to us on GitHub)";
- }
+ "4.03.086" => "4.03.086 / Unknown Product",
+
+ _ => $"Unknown Version {version} (Report this to us on GitHub)",
+ };
}
return "Unknown Version (Report this to us on GitHub)";
@@ -474,7 +471,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// BoG_ *90.0&!! Yy>
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x42, 0x6F, 0x47, 0x5F, 0x20, 0x2A, 0x39, 0x30,
0x2E, 0x30, 0x26, 0x21, 0x21, 0x20, 0x20, 0x59,
@@ -523,102 +520,101 @@ namespace BinaryObjectScanner.Protection
private static string MacrovisionVersionToProductName(string version)
{
- switch (version)
+ return version switch
{
// CDS-300 (Confirmed)
- case "2.90.044": // Found in "American Made World Played" by Les Paul & Friends (Japan) (https://www.discogs.com/release/18934432-Les-Paul-Friends-American-Made-World-Played) and "X&Y" by Coldplay (Japan) (https://www.discogs.com/release/822378-Coldplay-XY).
- return "CDS-300";
+ // Found in "American Made World Played" by Les Paul & Friends (Japan) (https://www.discogs.com/release/18934432-Les-Paul-Friends-American-Made-World-Played) and "X&Y" by Coldplay (Japan) (https://www.discogs.com/release/822378-Coldplay-XY).
+ "2.90.044" => "CDS-300",
// SafeCast (Confirmed)
// Version 1.04.000/1.4.0.0 can be found in "cdac01aa.dll" and "cdac01ba.dll" from IA item "ejay_nestle_trial", but needs further research.
- case "2.11.010": // Found in Redump entry 83145.
- case "2.11.020": // Found in IA item "microsoft-software-jukebox-for-toshiba-1.0".
- case "2.11.060": // Found in Redump entry 102979.
- case "2.16.050": // Found in IA items "cdrom-turbotax-2002", "TurboTax_Deluxe_Tax_Year_2002_for_Wndows_2.00R_Intuit_2002_352282", and "TurboTax_Premier_Tax_Year_2002_for_Windows_v02.00Z-R_Intuit_352283_2002".
- case "2.60.030": // Found in Redump entry 74384 (Semi-confirmed) and "Data Becker Web To Date v3.1" according to https://web.archive.org/web/20210331144912/https://protectionid.net/ (Unconfirmed).
- case "2.67.010": // Found in "[Win] Photoshop CS2.7z" in IA item "Adobe-CS2".
- return "SafeCast";
+ // Found in Redump entry 83145.
+ "2.11.010"
+ or "2.11.020"
+ or "2.11.060"
+ or "2.16.050"
+ or "2.60.030"
+ or "2.67.010" => "SafeCast",
// SafeCast (Unconfirmed)
- case "2.41.000": // Found in Adobe Photoshop according to http://www.reversing.be/article.php?story=2006102413541932
- case "2.42.000": // Found in "Dreamweaver MX 2004 v7.0.1" according to https://web.archive.org/web/20210331144912/https://protectionid.net/.
- case "2.50.030": // Found in "ArcSoft Media Card Companion v1.0" according to https://web.archive.org/web/20210331144912/https://protectionid.net/.
- case "2.51.000": // Found in "Autodesk Inventor Professional v9.0" according to https://web.archive.org/web/20210331144912/https://protectionid.net/.
- return "SafeCast (Unconfirmed - Please report to us on GitHub)";
+ // Found in Adobe Photoshop according to http://www.reversing.be/article.php?story=2006102413541932
+ "2.41.000"
+ or "2.42.000"
+ or "2.50.030"
+ or "2.51.000" => "SafeCast (Unconfirmed - Please report to us on GitHub)",
// SafeCast ESD (Confirmed)
- case "2.02.040": // Found in https://web.archive.org/web/20010417215205/http://www.macrovision.com:80/demos/Trialware.exe.
- return "SafeCast ESD";
+ // Found in https://web.archive.org/web/20010417215205/http://www.macrovision.com:80/demos/Trialware.exe.
+ "2.02.040" => "SafeCast ESD",
// SafeDisc (Confirmed)
- case "1.00.025": // Found in Redump entry 66005.
- case "1.00.026": // Found in Redump entries 1882 and 30049.
- case "1.00.030": // Found in Redump entries 31575 and 41923.
- case "1.00.032": // Found in Redump entries 1883 and 42114.
- case "1.00.035": // Found in Redump entries 36223 and 40771.
- case "1.01.034": // Found in Redump entries 42155 and 47574.
- case "1.01.038": // Found in Redump entry 51459.
- case "1.01.043": // Found in Redump entries 34562 and 63304.
- case "1.01.044": // Found in Redump entries 61731 and 81619.
- case "1.06.000": // Found in Redump entries 29073 and 31149.
- case "1.07.000": // Found in Redump entries 9718 and 46756.
- case "1.09.000": // Found in Redump entries 12885 and 66210.
- case "1.11.000": // Found in Redump entries 37523 and 66586.
- case "1.20.000": // Found in Redump entries 21154 and 37982.
- case "1.20.001": // Found in Redump entry 37920.
- case "1.30.010": // Found in Redump entries 31526 and 55080.
- case "1.35.000": // Found in Redump entries 9617 and 49552.
- case "1.40.004": // Found in Redump entries 2595 and 30121.
- case "1.41.000": // Found in Redump entries 44350 and 63323.
- case "1.41.001": // Found in Redump entries 37832 and 42091.
- case "1.45.011": // Found in Redump entries 30555 and 55078.
- case "1.50.020": // Found in Redump entries 28810 and 62935.
- case "2.05.030": // Found in Redump entries 72195 and 73502.
- case "2.10.030": // Found in Redump entries 38541, 59462, and 81096.
- case "2.30.030": // Found in Redump entries 55823 and 79476.
- case "2.30.031": // Found in Redump entries 15312 and 48863.
- case "2.30.033": // Found in Redump entries 9819 and 53658.
- case "2.40.010": // Found in Redump entries 9846 and 65642.
- case "2.40.011": // Found in Redump entries 23786 and 37478.
- case "2.51.020": // Found in Redump entries 30022 and 75014.
- case "2.51.021": // Found in Redump entries 31666 and 66852.
- case "2.60.052": // Found in Redump entries 2064 and 47047.
- case "2.70.030": // Found in Redump entries 13048 and 35385.
- case "2.72.000": // Found in Redump entries 48101 and 64198.
- case "2.80.010": // Found in Redump entries 32783 and 72743.
- case "2.80.011": // Found in Redump entries 39273 and 59351.
- case "2.90.040": // Found in Redump entries 52606 and 62505.
- case "3.10.020": // Found in Redump entries 13230 and 68204.
- case "3.15.010": // Found in Redump entries 36511 and 74338.
- case "3.15.011": // Found in Redump entries 15383 and 35512.
- case "3.20.020": // Found in Redump entries 30404 and 56748.
- case "3.20.022": // Found in Redump entries 58625 and 91552.
- case "3.20.024": // Found in Redump entries 20729 and 63813 (CD) and Redump entries 20728 and 64255 (DVD).
- case "4.00.000": // Found in Redump entries 35382 and 79729 (CD) and Redump entry 74520 (DVD).
- case "4.00.001": // Found in Redump entries 8842 and 83017 (CD) and Redump entries 15614 and 38143 (DVD).
- case "4.00.002": // Found in Redump entries 42034 and 71646 (CD) and Redump entries 78980 and 86196 (DVD).
- case "4.00.003": // Found in Redump entries 60021 and 68551 (CD) and Redump entries 51597 and 83408 (DVD).
- case "4.50.000": // Found in Redump entries 58990 and 80776 (CD) and Redump entries 65569 and 76813 (DVD).
- case "4.60.000": // Found in Redump entries 45686 and 46765 (CD) and Redump entries 45469 and 50682 (DVD).
- case "4.70.000": // Found in Redump entry 56320 (CD) and Redump entries 34783 and 66403 (DVD).
- case "4.80.000": // Found in Redump entries 64145 and 78543 (CD only).
- case "4.81.000": // Found in Redump entries 52523 and 76346 (DVD only).
- case "4.85.000": // Found in Redump entries 20434 and 31766 (DVD only).
- case "4.90.000": // Found in Redump entries 56319 and 66333 (DVD only).
- case "4.90.010": // Found in Redump entries 58573 and 78976 (CD) and Redump entries 11347 and 29069 (DVD).
- return "SafeDisc";
+ // Found in Redump entry 66005.
+ "1.00.025"
+ or "1.00.026"
+ or "1.00.030"
+ or "1.00.032"
+ or "1.00.035"
+ or "1.01.034"
+ or "1.01.038"
+ or "1.01.043"
+ or "1.01.044"
+ or "1.06.000"
+ or "1.07.000"
+ or "1.09.000"
+ or "1.11.000"
+ or "1.20.000"
+ or "1.20.001"
+ or "1.30.010"
+ or "1.35.000"
+ or "1.40.004"
+ or "1.41.000"
+ or "1.41.001"
+ or "1.45.011"
+ or "1.50.020"
+ or "2.05.030"
+ or "2.10.030"
+ or "2.30.030"
+ or "2.30.031"
+ or "2.30.033"
+ or "2.40.010"
+ or "2.40.011"
+ or "2.51.020"
+ or "2.51.021"
+ or "2.60.052"
+ or "2.70.030"
+ or "2.72.000"
+ or "2.80.010"
+ or "2.80.011"
+ or "2.90.040"
+ or "3.10.020"
+ or "3.15.010"
+ or "3.15.011"
+ or "3.20.020"
+ or "3.20.022"
+ or "3.20.024"
+ or "4.00.000"
+ or "4.00.001"
+ or "4.00.002"
+ or "4.00.003"
+ or "4.50.000"
+ or "4.60.000"
+ or "4.70.000"
+ or "4.80.000"
+ or "4.81.000"
+ or "4.85.000"
+ or "4.90.000"
+ or "4.90.010" => "SafeDisc",
// SafeDisc (Unconfirmed)
- case "1.01.045": // Currently only found in a pirate compilation disc: IA item "cdrom-classic-fond-58".
- return "SafeDisc (Unconfirmed - Please report to us on GitHub)";
+ // Currently only found in a pirate compilation disc: IA item "cdrom-classic-fond-58".
+ "1.01.045" => "SafeDisc (Unconfirmed - Please report to us on GitHub)",
// SafeDisc Lite (Confirmed)
- case "2.60.020": // Found in Redump entry 14928.
- return "SafeDisc Lite";
+ // Found in Redump entry 14928.
+ "2.60.020" => "SafeDisc Lite",
- default:
- return "Macrovision Protected Application (Generic detection - Report to us on GitHub)";
- }
+ _ => "Macrovision Protected Application (Generic detection - Report to us on GitHub)",
+ };
}
private List? CleanResultList(List? resultsList)
@@ -628,7 +624,7 @@ namespace BinaryObjectScanner.Protection
return resultsList;
// Get distinct and order
- return resultsList.Distinct().OrderBy(s => s).ToList();
+ return [.. resultsList.Distinct().OrderBy(s => s)];
}
}
}
diff --git a/BinaryObjectScanner/Protection/MediaCloQ.cs b/BinaryObjectScanner/Protection/MediaCloQ.cs
index f1c0fd60..82c794d3 100644
--- a/BinaryObjectScanner/Protection/MediaCloQ.cs
+++ b/BinaryObjectScanner/Protection/MediaCloQ.cs
@@ -50,7 +50,7 @@ namespace BinaryObjectScanner.Protection
// The file "sunncomm.ico" was a previously used file check, but since it's just an icon of the SunnComm logo, it seems too likely to result in false positives.
// Found on "Charley Pride - A Tribute to Jim Reeves" (barcode "7 816190222-2 4").
- new PathMatchSet(new PathMatch("scvfy.exe", useEndsWith: true), "MediaCloQ"),
+ new(new PathMatch("scvfy.exe", useEndsWith: true), "MediaCloQ"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -64,7 +64,7 @@ namespace BinaryObjectScanner.Protection
// The file "sunncomm.ico" was a previously used file check, but since it's just an icon of the SunnComm logo, it seems too likely to result in false positives.
// Found on "Charley Pride - A Tribute to Jim Reeves" (barcode "7 816190222-2 4").
- new PathMatchSet(new PathMatch("scvfy.exe", useEndsWith: true), "MediaCloQ"),
+ new(new PathMatch("scvfy.exe", useEndsWith: true), "MediaCloQ"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/MediaMaxCD3.cs b/BinaryObjectScanner/Protection/MediaMaxCD3.cs
index 91081991..e1a6251e 100644
--- a/BinaryObjectScanner/Protection/MediaMaxCD3.cs
+++ b/BinaryObjectScanner/Protection/MediaMaxCD3.cs
@@ -74,21 +74,21 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found on "All That I Am" by Santana (Barcode 8 2876-59773-2 6)
- new PathMatchSet(new List
+ new(new List
{
// TODO: Verify if these are OR or AND
// TODO: Verify that this is directly related to MediaMax CD-3.
- new PathMatch("PlayDisc.exe", useEndsWith: true),
- new PathMatch("PlayDisc.xml", useEndsWith: true),
+ new FilePathMatch("PlayDisc.exe"),
+ new FilePathMatch("PlayDisc.xml"),
}, "MediaMax CD-3"),
// Found on "Contraband" by Velvet Revolver (Barcode 8 28766 05242 8)
// "SCCD3X01.dll" should already be detected by the content checks, but not "SCCD3X02.dll".
- new PathMatchSet(new List
+ new(new List
{
// TODO: Verify if these are OR or AND
- new PathMatch("SCCD3X01.dll", useEndsWith: true),
- new PathMatch("SCCD3X02.dll", useEndsWith: true),
+ new FilePathMatch("SCCD3X01.dll"),
+ new FilePathMatch("SCCD3X02.dll"),
}, "MediaMax CD-3"),
};
@@ -101,8 +101,8 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found on "Contraband" by Velvet Revolver (Barcode 8 28766 05242 8)
- new PathMatchSet(new PathMatch("SCCD3X01.dll", useEndsWith: true), "MediaMax CD-3"),
- new PathMatchSet(new PathMatch("SCCD3X02.dll", useEndsWith: true), "MediaMax CD-3"),
+ new(new FilePathMatch("SCCD3X01.dll"), "MediaMax CD-3"),
+ new(new FilePathMatch("SCCD3X02.dll"), "MediaMax CD-3"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/NEACProtect.cs b/BinaryObjectScanner/Protection/NEACProtect.cs
index 3ada6f57..f1646107 100644
--- a/BinaryObjectScanner/Protection/NEACProtect.cs
+++ b/BinaryObjectScanner/Protection/NEACProtect.cs
@@ -61,12 +61,12 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found installed in the main game folder.
- new PathMatchSet(new PathMatch("NeacClient.exe", useEndsWith: true), "NEAC Protect"),
- new PathMatchSet(new PathMatch("NeacInterface.dll", useEndsWith: true), "NEAC Protect"),
- new PathMatchSet(new PathMatch("NeacSafe64.sys", useEndsWith: true), "NEAC Protect"),
+ new(new FilePathMatch("NeacClient.exe"), "NEAC Protect"),
+ new(new FilePathMatch("NeacInterface.dll"), "NEAC Protect"),
+ new(new FilePathMatch("NeacSafe64.sys"), "NEAC Protect"),
// Found installed in "System32\drivers".
- new PathMatchSet(new PathMatch("NeacSafe.sys", useEndsWith: true), "NEAC Protect"),
+ new(new FilePathMatch("NeacSafe.sys"), "NEAC Protect"),
// Known associated log files: "NeacSafe.log", "Neac.log", "NeacDll.log", "NeacLoader.log", and "NeacBak.log".
};
@@ -80,12 +80,12 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found installed in the main game folder.
- new PathMatchSet(new PathMatch("NeacClient.exe", useEndsWith: true), "NEAC Protect"),
- new PathMatchSet(new PathMatch("NeacInterface.dll", useEndsWith: true), "NEAC Protect"),
- new PathMatchSet(new PathMatch("NeacSafe64.sys", useEndsWith: true), "NEAC Protect"),
+ new(new FilePathMatch("NeacClient.exe"), "NEAC Protect"),
+ new(new FilePathMatch("NeacInterface.dll"), "NEAC Protect"),
+ new(new FilePathMatch("NeacSafe64.sys"), "NEAC Protect"),
// Found installed in "System32\drivers".
- new PathMatchSet(new PathMatch("NeacSafe.sys", useEndsWith: true), "NEAC Protect"),
+ new(new FilePathMatch("NeacSafe.sys"), "NEAC Protect"),
// Known associated log files: "NeacSafe.log", "Neac.log", "NeacDll.log", "NeacLoader.log", and "NeacBak.log".
};
diff --git a/BinaryObjectScanner/Protection/OpenMG.cs b/BinaryObjectScanner/Protection/OpenMG.cs
index a9f35464..e5516aaa 100644
--- a/BinaryObjectScanner/Protection/OpenMG.cs
+++ b/BinaryObjectScanner/Protection/OpenMG.cs
@@ -77,16 +77,16 @@ namespace BinaryObjectScanner.Protection
// So far found in every known release that uses OpenMG ("Touch" by Amerie, Redump entry 95010, and product ID SVWC-7185).
// Files with the extension ".OMA" in the directory "OMGAUDIO" are the encrypted audio files, and files with in the directory "OMGEXTRA" the extension ".000" are bonus content.
// TODO: Investigate the consistency of "\OMGEXTRA\INDX0000.XML" and "\OMGEXTRA\INDX0001.XML", they seem to only appear when bonus content is present ("Touch" by Amerie).
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch(Path.Combine("OMGAUDIO", "00AUDTOC.DAT").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine("OMGAUDIO", "01AUDSTR.DAT").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine("OMGAUDIO", "05SRPCDS.DAT").Replace("\\", "/"), useEndsWith: true),
- new PathMatch(Path.Combine("OMGEXTRA", "OMGSVC.DAT").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("OMGAUDIO", "00AUDTOC.DAT").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("OMGAUDIO", "01AUDSTR.DAT").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("OMGAUDIO", "05SRPCDS.DAT").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("OMGEXTRA", "OMGSVC.DAT").Replace("\\", "/"), useEndsWith: true),
}, "OpenMG"),
// Always found together on OpenMG releases ("Touch" by Amerie, Redump entry 95010, and product ID SVWC-7185).
- new PathMatchSet(new List
+ new(new List
{
new FilePathMatch("SDKHM.DLL"),
new FilePathMatch("SDKHM.EXE"),
@@ -102,22 +102,22 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// So far found in every known release that uses OpenMG ("Touch" by Amerie, Redump entry 95010, and product ID SVWC-7185).
- new PathMatchSet(new PathMatch("00AUDTOC.DAT", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("01AUDSTR.DAT", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("05SRPCDS.DAT", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("OMGSVC.DAT", useEndsWith: true), "OpenMG"),
+ new(new FilePathMatch("00AUDTOC.DAT"), "OpenMG"),
+ new(new FilePathMatch("01AUDSTR.DAT"), "OpenMG"),
+ new(new FilePathMatch("05SRPCDS.DAT"), "OpenMG"),
+ new(new FilePathMatch("OMGSVC.DAT"), "OpenMG"),
// Always found together on OpenMG releases ("Touch" by Amerie, Redump entry 95010, and product ID SVWC-7185).
- new PathMatchSet(new PathMatch("SDKHM.DLL", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("SDKHM.EXE", useEndsWith: true), "OpenMG"),
+ new(new FilePathMatch("SDKHM.DLL"), "OpenMG"),
+ new(new FilePathMatch("SDKHM.EXE"), "OpenMG"),
// Found together on one specific release ("Touch" by Amerie).
// TODO: Verify if these are OR or AND
- new PathMatchSet(new PathMatch("OMGDBP.OCX", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("OMGDWRAP.DLL", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("OMGLGD.DLL", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("OMGUTILS.DLL", useEndsWith: true), "OpenMG"),
- new PathMatchSet(new PathMatch("SALWRAP.DLL", useEndsWith: true), "OpenMG"),
+ new(new FilePathMatch("OMGDBP.OCX"), "OpenMG"),
+ new(new FilePathMatch("OMGDWRAP.DLL"), "OpenMG"),
+ new(new FilePathMatch("OMGLGD.DLL"), "OpenMG"),
+ new(new FilePathMatch("OMGUTILS.DLL"), "OpenMG"),
+ new(new FilePathMatch("SALWRAP.DLL"), "OpenMG"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Origin.cs b/BinaryObjectScanner/Protection/Origin.cs
index 5aa9d095..98077a05 100644
--- a/BinaryObjectScanner/Protection/Origin.cs
+++ b/BinaryObjectScanner/Protection/Origin.cs
@@ -39,7 +39,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("OriginSetup.exe", useEndsWith: true), "Origin"),
+ new(new FilePathMatch("OriginSetup.exe"), "Origin"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -50,7 +50,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("OriginSetup.exe", useEndsWith: true), "Origin"),
+ new(new FilePathMatch("OriginSetup.exe"), "Origin"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/PSXAntiModchip.cs b/BinaryObjectScanner/Protection/PSXAntiModchip.cs
index aacc6bc5..62ac21f2 100644
--- a/BinaryObjectScanner/Protection/PSXAntiModchip.cs
+++ b/BinaryObjectScanner/Protection/PSXAntiModchip.cs
@@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Protection
var contentMatchSets = new List
{
// SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x4F, 0x46,
0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x54, 0x45,
@@ -32,7 +32,7 @@ namespace BinaryObjectScanner.Protection
}, "PlayStation Anti-modchip (English)"),
// 強制終了しました。\n本体が改造されている\nおそれがあります。
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x5F, 0x37, 0x52, 0x36, 0x7D, 0x42, 0x4E, 0x86,
0x30, 0x57, 0x30, 0x7E, 0x30, 0x57, 0x30, 0x5F,
diff --git a/BinaryObjectScanner/Protection/PlayJ.cs b/BinaryObjectScanner/Protection/PlayJ.cs
index d0fe56a7..949b7705 100644
--- a/BinaryObjectScanner/Protection/PlayJ.cs
+++ b/BinaryObjectScanner/Protection/PlayJ.cs
@@ -52,11 +52,11 @@ namespace BinaryObjectScanner.Protection
{
// Found in https://web.archive.org/web/20010417025347/http://dlp.playj.com:80/playj/PlayJIns266.exe.
// The files "Data8.bml" and "Data16.bml" are also present in the installation directory, but it is currently unknown if they are specific to this DRM or not.
- new PathMatchSet(new PathMatch("PlayJ.exe", useEndsWith: true), "PlayJ Music Player"),
- new PathMatchSet(new PathMatch("PLJFilter.ax", useEndsWith: true), "PlayJ Windows Media Player Plug-in"),
+ new(new FilePathMatch("PlayJ.exe"), "PlayJ Music Player"),
+ new(new FilePathMatch("PLJFilter.ax"), "PlayJ Windows Media Player Plug-in"),
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]).
- new PathMatchSet(new PathMatch("PJSTREAM.DLL", useEndsWith: true), "PlayJ Music Player Component"),
+ new(new FilePathMatch("PJSTREAM.DLL"), "PlayJ Music Player Component"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -69,11 +69,11 @@ namespace BinaryObjectScanner.Protection
{
// Found in https://web.archive.org/web/20010417025347/http://dlp.playj.com:80/playj/PlayJIns266.exe.
// The files "Data8.bml" and "Data16.bml" are also present in the installation directory, but it is currently unknown if they are specific to this DRM or not.
- new PathMatchSet(new PathMatch("PlayJ.exe", useEndsWith: true), "PlayJ Music Player"),
- new PathMatchSet(new PathMatch("PLJFilter.ax", useEndsWith: true), "PlayJ Windows Media Player Plug-in"),
+ new(new FilePathMatch("PlayJ.exe"), "PlayJ Music Player"),
+ new(new FilePathMatch("PLJFilter.ax"), "PlayJ Windows Media Player Plug-in"),
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]).
- new PathMatchSet(new PathMatch("PJSTREAM.DLL", useEndsWith: true), "PlayJ Music Player Component"),
+ new(new FilePathMatch("PJSTREAM.DLL"), "PlayJ Music Player Component"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/ProtectDVDVideo.cs b/BinaryObjectScanner/Protection/ProtectDVDVideo.cs
index d4834f0c..2c454f4c 100644
--- a/BinaryObjectScanner/Protection/ProtectDVDVideo.cs
+++ b/BinaryObjectScanner/Protection/ProtectDVDVideo.cs
@@ -31,7 +31,7 @@ namespace BinaryObjectScanner.Protection
string[] ifofiles = files.Where(s => s.EndsWith(".ifo")).ToArray();
for (int i = 0; i < ifofiles.Length; i++)
{
- FileInfo ifofile = new FileInfo(ifofiles[i]);
+ var ifofile = new FileInfo(ifofiles[i]);
if (ifofile.Length == 0)
{
protections.Enqueue("Protect DVD-Video (Unconfirmed - Please report to us on Github)");
diff --git a/BinaryObjectScanner/Protection/ProtectDisc.cs b/BinaryObjectScanner/Protection/ProtectDisc.cs
index 45205002..9bd37eeb 100644
--- a/BinaryObjectScanner/Protection/ProtectDisc.cs
+++ b/BinaryObjectScanner/Protection/ProtectDisc.cs
@@ -28,7 +28,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// ACE-PCD
- new ContentMatchSet(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDISC"),
+ new(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDISC"),
};
var match = MatchUtil.GetFirstMatch(file, nthSectionData, matchers, includeDebug);
@@ -43,7 +43,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// DCP-BOV + (char)0x00 + (char)0x00
- new ContentMatchSet(new byte?[] { 0x44, 0x43, 0x50, 0x2D, 0x42, 0x4F, 0x56, 0x00, 0x00 }, GetVersion3till6, "VOB ProtectCD/DVD"),
+ new(new byte?[] { 0x44, 0x43, 0x50, 0x2D, 0x42, 0x4F, 0x56, 0x00, 0x00 }, GetVersion3till6, "VOB ProtectCD/DVD"),
};
var match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug);
@@ -73,10 +73,10 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// HúMETINF
- new ContentMatchSet(new byte?[] { 0x48, 0xFA, 0x4D, 0x45, 0x54, 0x49, 0x4E, 0x46 }, GetVersion76till10, "ProtectDISC"),
+ new(new byte?[] { 0x48, 0xFA, 0x4D, 0x45, 0x54, 0x49, 0x4E, 0x46 }, GetVersion76till10, "ProtectDISC"),
// DCP-BOV + (char)0x00 + (char)0x00
- new ContentMatchSet(new byte?[] { 0x44, 0x43, 0x50, 0x2D, 0x42, 0x4F, 0x56, 0x00, 0x00 }, GetVersion3till6, "VOB ProtectCD/DVD"),
+ new(new byte?[] { 0x44, 0x43, 0x50, 0x2D, 0x42, 0x4F, 0x56, 0x00, 0x00 }, GetVersion3till6, "VOB ProtectCD/DVD"),
};
var match = MatchUtil.GetFirstMatch(file, lastSectionData, matchers, includeDebug);
diff --git a/BinaryObjectScanner/Protection/RainbowSentinel.cs b/BinaryObjectScanner/Protection/RainbowSentinel.cs
index 9564d995..b9ba0338 100644
--- a/BinaryObjectScanner/Protection/RainbowSentinel.cs
+++ b/BinaryObjectScanner/Protection/RainbowSentinel.cs
@@ -108,28 +108,28 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in BA entry "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("SENTINEL.VXD", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTSTRT.EXE", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTW95.DLL", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTW95.EXE", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTW95.HLP", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTINEL.VXD"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTSTRT.EXE"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTW95.DLL"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTW95.EXE"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTW95.HLP"), "Rainbow Sentinel"),
// Found in BA entry "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and in IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("SNTI386.DLL", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("SNTI386.DLL"), "Rainbow Sentinel"),
// Found in BA entry "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and in IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("RNBOVTMP.DLL", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTINEL.HLP", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTTEMP.SYS", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("RNBOVTMP.DLL"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTINEL.HLP"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTTEMP.SYS"), "Rainbow Sentinel"),
// Found in BA entries "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and "Autodesk AutoCAD r14 (1997)", and IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("RAINB95.Z", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("RAINBNT.Z", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("RAINB95.Z"), "Rainbow Sentinel"),
+ new(new FilePathMatch("RAINBNT.Z"), "Rainbow Sentinel"),
// Found in "wd126.zip/WDSHARE.EXE" in IA item "ASMEsMechanicalEngineeringToolkit1997December" and "WDSHARE.ZIP/WDSHARE.EXE/SX32W.DL_" in IA item "aplicaciones-windows".
- new PathMatchSet(new PathMatch("RainbowSentinel.386", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SX32W.DL_", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SX32W.DLL", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("RainbowSentinel.386"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SX32W.DL_"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SX32W.DLL"), "Rainbow Sentinel"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -141,28 +141,28 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in BA entry "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("SENTINEL.VXD", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTSTRT.EXE", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTW95.DLL", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTW95.EXE", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTW95.HLP", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTINEL.VXD"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTSTRT.EXE"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTW95.DLL"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTW95.EXE"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTW95.HLP"), "Rainbow Sentinel"),
// Found in BA entry "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and in IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("SNTI386.DLL", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("SNTI386.DLL"), "Rainbow Sentinel"),
// Found in BA entry "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and in IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("RNBOVTMP.DLL", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTINEL.HLP", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SENTTEMP.SYS", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("RNBOVTMP.DLL"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTINEL.HLP"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SENTTEMP.SYS"), "Rainbow Sentinel"),
// Found in BA entries "Autodesk AutoCAD LT 98 (1998) (CD) [English] [Dutch]" and "Autodesk AutoCAD r14 (1997)", and IA item "auto-cad-r14-cdrom".
- new PathMatchSet(new PathMatch("RAINB95.Z", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("RAINBNT.Z", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("RAINB95.Z"), "Rainbow Sentinel"),
+ new(new FilePathMatch("RAINBNT.Z"), "Rainbow Sentinel"),
// Found in "wd126.zip/WDSHARE.EXE" in IA item "ASMEsMechanicalEngineeringToolkit1997December" and "WDSHARE.ZIP/WDSHARE.EXE/SX32W.DL_" in IA item "aplicaciones-windows".
- new PathMatchSet(new PathMatch("RainbowSentinel.386", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SX32W.DL_", useEndsWith: true), "Rainbow Sentinel"),
- new PathMatchSet(new PathMatch("SX32W.DLL", useEndsWith: true), "Rainbow Sentinel"),
+ new(new FilePathMatch("RainbowSentinel.386"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SX32W.DL_"), "Rainbow Sentinel"),
+ new(new FilePathMatch("SX32W.DLL"), "Rainbow Sentinel"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/RingPROTECH.cs b/BinaryObjectScanner/Protection/RingPROTECH.cs
index 64146e95..8fd911a7 100644
--- a/BinaryObjectScanner/Protection/RingPROTECH.cs
+++ b/BinaryObjectScanner/Protection/RingPROTECH.cs
@@ -20,7 +20,7 @@ namespace BinaryObjectScanner.Protection
var contentMatchSets = new List
{
// (char)0x00 + Allocator + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00
- new ContentMatchSet(new byte?[]
+ new(new byte?[]
{
0x00, 0x41, 0x6C, 0x6C, 0x6F, 0x63, 0x61, 0x74,
0x6F, 0x72, 0x00, 0x00, 0x00, 0x00
@@ -45,7 +45,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in Redump entry 94161
- new PathMatchSet(new PathMatch("protect.pro", useEndsWith: true), "Ring PROTECH / ProRing [Check disc for physical ring]"),
+ new(new PathMatch("protect.pro", useEndsWith: true), "Ring PROTECH / ProRing [Check disc for physical ring]"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -57,7 +57,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in Redump entry 94161
- new PathMatchSet(new PathMatch("protect.pro", useEndsWith: true), "Ring PROTECH / ProRing [Check disc for physical ring]"),
+ new(new PathMatch("protect.pro", useEndsWith: true), "Ring PROTECH / ProRing [Check disc for physical ring]"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/SVKP.cs b/BinaryObjectScanner/Protection/SVKP.cs
index 14421410..b840d8a2 100644
--- a/BinaryObjectScanner/Protection/SVKP.cs
+++ b/BinaryObjectScanner/Protection/SVKP.cs
@@ -101,11 +101,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in the SVKP 1.05-1.32 demos.
- new PathMatchSet(new FilePathMatch("svkp.exe"), "SVKP"),
- new PathMatchSet(new FilePathMatch("svkp.key"), "SVKP"),
+ new(new FilePathMatch("svkp.exe"), "SVKP"),
+ new(new FilePathMatch("svkp.key"), "SVKP"),
// Found in the SVKP 1.32 demo.
- new PathMatchSet(new FilePathMatch("svkpnd.dll"), "SVKP"),
+ new(new FilePathMatch("svkpnd.dll"), "SVKP"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -117,11 +117,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in the SVKP 1.05-1.32 demos.
- new PathMatchSet(new FilePathMatch("svkp.exe"), "SVKP"),
- new PathMatchSet(new FilePathMatch("svkp.key"), "SVKP"),
+ new(new FilePathMatch("svkp.exe"), "SVKP"),
+ new(new FilePathMatch("svkp.key"), "SVKP"),
// Found in the SVKP 1.32 demo.
- new PathMatchSet(new FilePathMatch("svkpnd.dll"), "SVKP"),
+ new(new FilePathMatch("svkpnd.dll"), "SVKP"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/SafeLock.cs b/BinaryObjectScanner/Protection/SafeLock.cs
index b1438c6e..4352fcd7 100644
--- a/BinaryObjectScanner/Protection/SafeLock.cs
+++ b/BinaryObjectScanner/Protection/SafeLock.cs
@@ -31,11 +31,11 @@ namespace BinaryObjectScanner.Protection
// Technically all need to exist but some might be renamed
var matchers = new List
{
- new PathMatchSet(new FilePathMatch("SafeLock.DAT"), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.001", useEndsWith: true), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.002", useEndsWith: true), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.128", useEndsWith: true), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.256", useEndsWith: true), "SafeLock"),
+ new(new FilePathMatch("SafeLock.DAT"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.001"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.002"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.128"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.256"), "SafeLock"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -46,11 +46,11 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new FilePathMatch("SafeLock.DAT"), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.001", useEndsWith: true), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.002", useEndsWith: true), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.128", useEndsWith: true), "SafeLock"),
- new PathMatchSet(new PathMatch("SafeLock.256", useEndsWith: true), "SafeLock"),
+ new(new FilePathMatch("SafeLock.DAT"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.001"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.002"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.128"), "SafeLock"),
+ new(new FilePathMatch("SafeLock.256"), "SafeLock"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/SecuROM.cs b/BinaryObjectScanner/Protection/SecuROM.cs
index 38fd4b49..6b13188b 100644
--- a/BinaryObjectScanner/Protection/SecuROM.cs
+++ b/BinaryObjectScanner/Protection/SecuROM.cs
@@ -81,7 +81,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// (char)0xCA + (char)0xDD + (char)0xDD + (char)0xAC + (char)0x03
- new ContentMatchSet(new byte?[] { 0xCA, 0xDD, 0xDD, 0xAC, 0x03 }, GetV5Version, "SecuROM"),
+ new(new byte?[] { 0xCA, 0xDD, 0xDD, 0xAC, 0x03 }, GetV5Version, "SecuROM"),
};
var match = MatchUtil.GetFirstMatch(file, nthSectionData, matchers, includeDebug);
@@ -120,23 +120,23 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// TODO: Verify if these are OR or AND
- new PathMatchSet(new PathMatch("CMS16.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS_95.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS_NT.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS32_95.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS32_NT.DLL", useEndsWith: true), "SecuROM"),
+ new(new FilePathMatch("CMS16.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS_95.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS_NT.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS32_95.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS32_NT.DLL"), "SecuROM"),
// TODO: Verify if these are OR or AND
- new PathMatchSet(new PathMatch("SINTF32.DLL", useEndsWith: true), "SecuROM New"),
- new PathMatchSet(new PathMatch("SINTF16.DLL", useEndsWith: true), "SecuROM New"),
- new PathMatchSet(new PathMatch("SINTFNT.DLL", useEndsWith: true), "SecuROM New"),
+ new(new FilePathMatch("SINTF32.DLL"), "SecuROM New"),
+ new(new FilePathMatch("SINTF16.DLL"), "SecuROM New"),
+ new(new FilePathMatch("SINTFNT.DLL"), "SecuROM New"),
// TODO: Find more samples of this for different versions
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("securom_v7_01.bak", useEndsWith: true),
- new PathMatch("securom_v7_01.dat", useEndsWith: true),
- new PathMatch("securom_v7_01.tmp", useEndsWith: true),
+ new FilePathMatch("securom_v7_01.bak"),
+ new FilePathMatch("securom_v7_01.dat"),
+ new FilePathMatch("securom_v7_01.tmp"),
}, "SecuROM 7.01"),
};
@@ -148,19 +148,19 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("CMS16.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS_95.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS_NT.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS32_95.DLL", useEndsWith: true), "SecuROM"),
- new PathMatchSet(new PathMatch("CMS32_NT.DLL", useEndsWith: true), "SecuROM"),
+ new(new FilePathMatch("CMS16.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS_95.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS_NT.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS32_95.DLL"), "SecuROM"),
+ new(new FilePathMatch("CMS32_NT.DLL"), "SecuROM"),
- new PathMatchSet(new PathMatch("SINTF32.DLL", useEndsWith: true), "SecuROM New"),
- new PathMatchSet(new PathMatch("SINTF16.DLL", useEndsWith: true), "SecuROM New"),
- new PathMatchSet(new PathMatch("SINTFNT.DLL", useEndsWith: true), "SecuROM New"),
+ new(new FilePathMatch("SINTF32.DLL"), "SecuROM New"),
+ new(new FilePathMatch("SINTF16.DLL"), "SecuROM New"),
+ new(new FilePathMatch("SINTFNT.DLL"), "SecuROM New"),
- new PathMatchSet(new PathMatch("securom_v7_01.bak", useEndsWith: true), "SecuROM 7.01"),
- new PathMatchSet(new PathMatch("securom_v7_01.dat", useEndsWith: true), "SecuROM 7.01"),
- new PathMatchSet(new PathMatch("securom_v7_01.tmp", useEndsWith: true), "SecuROM 7.01"),
+ new(new FilePathMatch("securom_v7_01.bak"), "SecuROM 7.01"),
+ new(new FilePathMatch("securom_v7_01.dat"), "SecuROM 7.01"),
+ new(new FilePathMatch("securom_v7_01.tmp"), "SecuROM 7.01"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -262,15 +262,15 @@ namespace BinaryObjectScanner.Protection
return "8";
// Search .data for the version indicator
- var matcher = new ContentMatch(new byte?[]
- {
+ var matcher = new ContentMatch(
+ [
0x29, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
0x82, 0xD8, 0x0C, 0xAC
- });
+ ]);
(bool success, int position) = matcher.Match(dataSectionRaw);
diff --git a/BinaryObjectScanner/Protection/SmartE.cs b/BinaryObjectScanner/Protection/SmartE.cs
index 30f0b7b3..27d7a13a 100644
--- a/BinaryObjectScanner/Protection/SmartE.cs
+++ b/BinaryObjectScanner/Protection/SmartE.cs
@@ -39,7 +39,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new List
+ new(new List
{
new FilePathMatch("00001.TMP"),
new FilePathMatch("00002.TMP")
@@ -54,8 +54,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new FilePathMatch("00001.TMP"), "SmartE"),
- new PathMatchSet(new FilePathMatch("00002.TMP"), "SmartE"),
+ new(new FilePathMatch("00001.TMP"), "SmartE"),
+ new(new FilePathMatch("00002.TMP"), "SmartE"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/SoftLock.cs b/BinaryObjectScanner/Protection/SoftLock.cs
index 66239c79..0a3b6d0c 100644
--- a/BinaryObjectScanner/Protection/SoftLock.cs
+++ b/BinaryObjectScanner/Protection/SoftLock.cs
@@ -92,10 +92,10 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch(needle: "SOFTLOCKC.dat", useEndsWith: true),
- new PathMatch("SOFTLOCKI.dat", useEndsWith: true),
+ new FilePathMatch("SOFTLOCKC.dat"),
+ new FilePathMatch("SOFTLOCKI.dat"),
}, "SoftLock"),
};
@@ -107,8 +107,8 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("SOFTLOCKC.dat", useEndsWith: true), "SoftLock"),
- new PathMatchSet(new PathMatch("SOFTLOCKI.dat", useEndsWith: true), "SoftLock"),
+ new(new FilePathMatch("SOFTLOCKC.dat"), "SoftLock"),
+ new(new FilePathMatch("SOFTLOCKI.dat"), "SoftLock"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/SolidShield.cs b/BinaryObjectScanner/Protection/SolidShield.cs
index 6f3ad8b8..eba74a35 100644
--- a/BinaryObjectScanner/Protection/SolidShield.cs
+++ b/BinaryObjectScanner/Protection/SolidShield.cs
@@ -61,10 +61,10 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// (char)0xAD + (char)0xDE + (char)0xFE + (char)0xCA
- new ContentMatchSet(new byte?[] { 0xAD, 0xDE, 0xFE, 0xCA }, GetVersionPlusTages, "SolidShield"),
+ new(new byte?[] { 0xAD, 0xDE, 0xFE, 0xCA }, GetVersionPlusTages, "SolidShield"),
// (char)0xEF + (char)0xBE + (char)0xAD + (char)0xDE
- new ContentMatchSet(new byte?[] { 0xEF, 0xBE, 0xAD, 0xDE }, GetExeWrapperVersion, "SolidShield EXE Wrapper"),
+ new(new byte?[] { 0xEF, 0xBE, 0xAD, 0xDE }, GetExeWrapperVersion, "SolidShield EXE Wrapper"),
};
var match = MatchUtil.GetFirstMatch(file, initData, matchers, includeDebug);
@@ -120,14 +120,14 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// Found in Redump entry 68166.
- new PathMatchSet(new FilePathMatch("tdvm.dll"), "SolidShield"),
- new PathMatchSet(new FilePathMatch("tdvm.vds"), "SolidShield"),
- new PathMatchSet(new PathMatch("vfs20.dll", useEndsWith: true), "SolidShield"),
+ new(new FilePathMatch("tdvm.dll"), "SolidShield"),
+ new(new FilePathMatch("tdvm.vds"), "SolidShield"),
+ new(new PathMatch("vfs20.dll", useEndsWith: true), "SolidShield"),
- new PathMatchSet(new FilePathMatch("dvm.dll"), "SolidShield"),
- new PathMatchSet(new FilePathMatch("hc.dll"), "SolidShield"),
- new PathMatchSet(new PathMatch("solidshield-cd.dll", useEndsWith: true), "SolidShield"),
- new PathMatchSet(new PathMatch("c11prot.dll", useEndsWith: true), "SolidShield"),
+ new(new FilePathMatch("dvm.dll"), "SolidShield"),
+ new(new FilePathMatch("hc.dll"), "SolidShield"),
+ new(new PathMatch("solidshield-cd.dll", useEndsWith: true), "SolidShield"),
+ new(new PathMatch("c11prot.dll", useEndsWith: true), "SolidShield"),
};
// TODO: Verify if these are OR or AND
@@ -139,10 +139,10 @@ namespace BinaryObjectScanner.ProtectionType
{
var matchers = new List
{
- new PathMatchSet(new FilePathMatch("dvm.dll"), "SolidShield"),
- new PathMatchSet(new FilePathMatch("hc.dll"), "SolidShield"),
- new PathMatchSet(new PathMatch("solidshield-cd.dll", useEndsWith: true), "SolidShield"),
- new PathMatchSet(new PathMatch("c11prot.dll", useEndsWith: true), "SolidShield"),
+ new(new FilePathMatch("dvm.dll"), "SolidShield"),
+ new(new FilePathMatch("hc.dll"), "SolidShield"),
+ new(new PathMatch("solidshield-cd.dll", useEndsWith: true), "SolidShield"),
+ new(new PathMatch("c11prot.dll", useEndsWith: true), "SolidShield"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -206,13 +206,13 @@ namespace BinaryObjectScanner.ProtectionType
&& id2.SequenceEqual(new byte[] { 0x00, 0x00, 0x00, 0x00 }))
{
// "T" + (char)0x00 + "a" + (char)0x00 + "g" + (char)0x00 + "e" + (char)0x00 + "s" + (char)0x00 + "S" + (char)0x00 + "e" + (char)0x00 + "t" + (char)0x00 + "u" + (char)0x00 + "p" + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + "0" + (char)0x00 + (char)0x8 + (char)0x00 + (char)0x1 + (char)0x0 + "F" + (char)0x00 + "i" + (char)0x00 + "l" + (char)0x00 + "e" + (char)0x00 + "V" + (char)0x00 + "e" + (char)0x00 + "r" + (char)0x00 + "s" + (char)0x00 + "i" + (char)0x00 + "o" + (char)0x00 + "n" + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00
- byte?[] check2 = new byte?[]
- {
+ byte?[] check2 =
+ [
0x54, 0x61, 0x67, 0x65, 0x73, 0x53, 0x65, 0x74,
0x75, 0x70, 0x30, 0x08, 0x01, 0x00, 0x46, 0x69,
0x6C, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F,
0x6E, 0x00, 0x00, 0x00, 0x00
- };
+ ];
if (fileContent.FirstPosition(check2, out int position2))
{
position2--; // TODO: Verify this subtract
diff --git a/BinaryObjectScanner/Protection/StarForce.cs b/BinaryObjectScanner/Protection/StarForce.cs
index 0f703336..0086b8c7 100644
--- a/BinaryObjectScanner/Protection/StarForce.cs
+++ b/BinaryObjectScanner/Protection/StarForce.cs
@@ -111,30 +111,30 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// This file combination is found in Redump entry 21136.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("protect.x86", useEndsWith: true),
- new PathMatch("protect.x64", useEndsWith: true),
- new PathMatch("protect.dll", useEndsWith: true),
- new PathMatch("protect.exe", useEndsWith: true),
- new PathMatch("protect.msg", useEndsWith: true),
+ new FilePathMatch("protect.x86"),
+ new FilePathMatch("protect.x64"),
+ new FilePathMatch("protect.dll"),
+ new FilePathMatch("protect.exe"),
+ new FilePathMatch("protect.msg"),
}, "StarForce"),
// This file combination is found in multiple games, such as Redump entries 81756, 91336, and 93657.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("protect.x86", useEndsWith: true),
- new PathMatch("protect.x64", useEndsWith: true),
- new PathMatch("protect.dll", useEndsWith: true),
- new PathMatch("protect.exe", useEndsWith: true),
+ new FilePathMatch("protect.x86"),
+ new FilePathMatch("protect.x64"),
+ new FilePathMatch("protect.dll"),
+ new FilePathMatch("protect.exe"),
}, "StarForce"),
// This file combination is found in Redump entry 96137.
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("protect.x86", useEndsWith: true),
- new PathMatch("protect.dll", useEndsWith: true),
- new PathMatch("protect.exe", useEndsWith: true),
+ new FilePathMatch("protect.x86"),
+ new FilePathMatch("protect.dll"),
+ new FilePathMatch("protect.exe"),
}, "StarForce"),
};
diff --git a/BinaryObjectScanner/Protection/Steam.cs b/BinaryObjectScanner/Protection/Steam.cs
index d0003fc5..3aabf628 100644
--- a/BinaryObjectScanner/Protection/Steam.cs
+++ b/BinaryObjectScanner/Protection/Steam.cs
@@ -52,41 +52,41 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// These checks are grouped together due to the names being generic on their own (Redump entry 91450).
- new PathMatchSet(new List
+ new(new List
{
// TODO: Identify based on "Steam(TM)" being present in "Description" but not in "File Description".
- new PathMatch("steam.exe", useEndsWith: true),
+ new FilePathMatch("steam.exe"),
- new PathMatch("steam.ini", useEndsWith: true),
+ new FilePathMatch("steam.ini"),
// TODO: Identify file using MSI property parsing.
- new PathMatch("steam.msi", useEndsWith: true),
+ new FilePathMatch("steam.msi"),
}, "Steam"),
- new PathMatchSet(new PathMatch("steam_api.dll", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("steam_api64.dll", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("steam_install_agreement.rtf", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.bom", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.exe", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.info", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.ini", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.pax.gz", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.pkg", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.sizes", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Czech.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_English.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_French.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_German.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Italian.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Polish.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Russian.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Spanish.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamRetailInstaller", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamRetailInstaller.dmg", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamService.exe", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamSetup.exe", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("steamxboxutil64.exe", useEndsWith: true), "Steam"),
+ new(new FilePathMatch("steam_api.dll"), "Steam"),
+ new(new FilePathMatch("steam_api64.dll"), "Steam"),
+ new(new FilePathMatch("steam_install_agreement.rtf"), "Steam"),
+ new(new FilePathMatch("SteamInstall.bom"), "Steam"),
+ new(new FilePathMatch("SteamInstall.exe"), "Steam"),
+ new(new FilePathMatch("SteamInstall.info"), "Steam"),
+ new(new FilePathMatch("SteamInstall.ini"), "Steam"),
+ new(new FilePathMatch("SteamInstall.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall.pax.gz"), "Steam"),
+ new(new FilePathMatch("SteamInstall.pkg"), "Steam"),
+ new(new FilePathMatch("SteamInstall.sizes"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Czech.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_English.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_French.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_German.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Italian.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Polish.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Russian.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Spanish.msi"), "Steam"),
+ new(new FilePathMatch("SteamRetailInstaller"), "Steam"),
+ new(new FilePathMatch("SteamRetailInstaller.dmg"), "Steam"),
+ new(new FilePathMatch("SteamService.exe"), "Steam"),
+ new(new FilePathMatch("SteamSetup.exe"), "Steam"),
+ new(new FilePathMatch("steamxboxutil64.exe"), "Steam"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -97,30 +97,30 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("steam_api.dll", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("steam_api64.dll", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("steam_install_agreement.rtf", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.bom", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.exe", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.info", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.ini", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.pax.gz", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.pkg", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall.sizes", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Czech.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_English.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_French.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_German.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Italian.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Polish.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Russian.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamInstall_Spanish.msi", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamRetailInstaller", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamRetailInstaller.dmg", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamService.exe", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("SteamSetup.exe", useEndsWith: true), "Steam"),
- new PathMatchSet(new PathMatch("steamxboxutil64.exe", useEndsWith: true), "Steam"),
+ new(new FilePathMatch("steam_api.dll"), "Steam"),
+ new(new FilePathMatch("steam_api64.dll"), "Steam"),
+ new(new FilePathMatch("steam_install_agreement.rtf"), "Steam"),
+ new(new FilePathMatch("SteamInstall.bom"), "Steam"),
+ new(new FilePathMatch("SteamInstall.exe"), "Steam"),
+ new(new FilePathMatch("SteamInstall.info"), "Steam"),
+ new(new FilePathMatch("SteamInstall.ini"), "Steam"),
+ new(new FilePathMatch("SteamInstall.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall.pax.gz"), "Steam"),
+ new(new FilePathMatch("SteamInstall.pkg"), "Steam"),
+ new(new FilePathMatch("SteamInstall.sizes"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Czech.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_English.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_French.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_German.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Italian.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Polish.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Russian.msi"), "Steam"),
+ new(new FilePathMatch("SteamInstall_Spanish.msi"), "Steam"),
+ new(new FilePathMatch("SteamRetailInstaller"), "Steam"),
+ new(new FilePathMatch("SteamRetailInstaller.dmg"), "Steam"),
+ new(new FilePathMatch("SteamService.exe"), "Steam"),
+ new(new FilePathMatch("SteamSetup.exe"), "Steam"),
+ new(new FilePathMatch("steamxboxutil64.exe"), "Steam"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/TZCopyProtection.cs b/BinaryObjectScanner/Protection/TZCopyProtection.cs
index 2b1a79a6..a6336899 100644
--- a/BinaryObjectScanner/Protection/TZCopyProtection.cs
+++ b/BinaryObjectScanner/Protection/TZCopyProtection.cs
@@ -64,10 +64,10 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Unconfirmed, not sure where this is supposed to be found.
- new PathMatchSet(new PathMatch("_742893.016", useEndsWith: true), "TZCopyProtection (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("_742893.016"), "TZCopyProtection (Unconfirmed - Please report to us on Github)"),
// "Ghost" file used by newer versions of TZCopyProtection.
- new PathMatchSet(new PathMatch("ZakMcCrack.Ghost", useEndsWith: true), "TZCopyProtection V1.11+"),
+ new(new FilePathMatch("ZakMcCrack.Ghost"), "TZCopyProtection V1.11+"),
// Newer versions of TZCopyProtection also create files with a TZC extension, though their purpose is currently unknown.
};
@@ -81,10 +81,10 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Unconfirmed, not sure where this is supposed to be found.
- new PathMatchSet(new PathMatch("_742893.016", useEndsWith: true), "TZCopyProtection (Unconfirmed - Please report to us on Github)"),
+ new(new FilePathMatch("_742893.016"), "TZCopyProtection (Unconfirmed - Please report to us on Github)"),
// "Ghost" file used by newer versions of TZCopyProtection.
- new PathMatchSet(new PathMatch("ZakMcCrack.Ghost", useEndsWith: true), "TZCopyProtection V1.11+"),
+ new(new FilePathMatch("ZakMcCrack.Ghost"), "TZCopyProtection V1.11+"),
// Newer versions of TZCopyProtection also create files with a TZC extension, though their purpose is currently unknown.
};
diff --git a/BinaryObjectScanner/Protection/Tages.cs b/BinaryObjectScanner/Protection/Tages.cs
index d66a3131..84a629f2 100644
--- a/BinaryObjectScanner/Protection/Tages.cs
+++ b/BinaryObjectScanner/Protection/Tages.cs
@@ -52,7 +52,7 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// (char)0xE8 + u + (char)0x00 + (char)0x00 + (char)0x00 + (char)0xE8 + ?? + ?? + (char)0xFF + (char)0xFF + "h"
- new ContentMatchSet(new byte?[] { 0xE8, 0x75, 0x00, 0x00, 0x00, 0xE8, null, null, 0xFF, 0xFF, 0x68 }, GetVersion, "TAGES"),
+ new(new byte?[] { 0xE8, 0x75, 0x00, 0x00, 0x00, 0xE8, null, null, 0xFF, 0xFF, 0x68 }, GetVersion, "TAGES"),
};
var match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug);
@@ -73,87 +73,87 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// So far, only known to exist in early versions of "Moto Racer 3" (Redump entries 31578 and 34669).
- new PathMatchSet(new List
+ new(new List
{
// d37f70489207014d7d0fbaa43b081a93e8030498
- new PathMatch(Path.Combine("Sys", "Devx.sys").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("Sys", "Devx.sys").Replace("\\", "/"), useEndsWith: true),
// a0acbc2f8e321e4f30c913c095e28af444058249
- new PathMatch(Path.Combine("Sys", "VtPr.sys").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("Sys", "VtPr.sys").Replace("\\", "/"), useEndsWith: true),
// SHA-1 is variable, file size is 81,920 bytes
- new PathMatch("Wave.aif", useEndsWith: true),
+ new FilePathMatch("Wave.aif"),
// f82339d797be6da92f5d9dadeae9025385159057
- new PathMatch("Wave.alf", useEndsWith: true),
+ new FilePathMatch("Wave.alf"),
// 0351d0f3d4166362a1a9d838c9390a3d92945a44
- new PathMatch("Wave.apt", useEndsWith: true),
+ new FilePathMatch("Wave.apt"),
// SHA-1 is variable, file size is 61,440 bytes
- new PathMatch("Wave.axt", useEndsWith: true),
+ new FilePathMatch("Wave.axt"),
}, "TAGES"),
// Currently only found in "Robocop" (Redump entry 35932).
// Found in a directory named "System", with an executable named "Setup.exe".
- new PathMatchSet(new List
+ new(new List
{
// f82339d797be6da92f5d9dadeae9025385159057
- new PathMatch(Path.Combine("9x", "Tamlx.alf").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("9x", "Tamlx.alf").Replace("\\", "/"), useEndsWith: true),
// 933c004d3043863f019f5ffaf63402a30e65026c
- new PathMatch(Path.Combine("9x", "Tamlx.apt").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("9x", "Tamlx.apt").Replace("\\", "/"), useEndsWith: true),
// d45745fa6b0d23fe0ee12e330ab85d5bf4e0e776
- new PathMatch(Path.Combine("NT", "enodpl.sys").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("NT", "enodpl.sys").Replace("\\", "/"), useEndsWith: true),
// f111eba05ca6e9061c557547420847d7fdee657d
- new PathMatch(Path.Combine("NT", "litdpl.sys").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("NT", "litdpl.sys").Replace("\\", "/"), useEndsWith: true),
}, "TAGES"),
// Currently only known to exist in "XIII" and "Beyond Good & Evil" (Redump entries 8774-8776, 45940-45941, 18690-18693, and presumably 21320, 21321, 21323, and 36124).
- new PathMatchSet(new List
+ new(new List
{
- new PathMatch("enodpl.sys", useEndsWith: true),
- new PathMatch("ENODPL.VXD", useEndsWith: true),
- new PathMatch("tandpl.sys", useEndsWith: true),
- new PathMatch("TANDPL.VXD", useEndsWith: true),
+ new FilePathMatch("enodpl.sys"),
+ new FilePathMatch("ENODPL.VXD"),
+ new FilePathMatch("tandpl.sys"),
+ new FilePathMatch("TANDPL.VXD"),
}, "TAGES"),
// The directory of these files has been seen to be named two different things, with two different accompanying executables in the root of the directory.
// In the example where the directory is named "Drivers", the executable is named "Silent.exe" (Redump entry 51763).
// In the example where the directory is named "ELBdrivers", the executable is name "ELBDrivers.exe" (Redump entry 91090).
// The name and file size of the included executable vary, but there should always be one here.
- new PathMatchSet(new List
+ new(new List
{
// 40826e95f3ad8031b6debe15aca052c701288e04
- new PathMatch(Path.Combine("9x", "hwpsgt.vxd").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("9x", "hwpsgt.vxd").Replace("\\", "/"), useEndsWith: true),
// f82339d797be6da92f5d9dadeae9025385159057
- new PathMatch(Path.Combine("9x", "lemsgt.vxd").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("9x", "lemsgt.vxd").Replace("\\", "/"), useEndsWith: true),
// 43f407ecdc0d87a3713126b757ccaad07ade285f
- new PathMatch(Path.Combine("NT", "hwpsgt.sys").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("NT", "hwpsgt.sys").Replace("\\", "/"), useEndsWith: true),
// 548dd6359abbcc8c84ce346d078664eeedc716f7
- new PathMatch(Path.Combine("NT", "lemsgt.sys").Replace("\\", "/"), useEndsWith: true),
+ new(Path.Combine("NT", "lemsgt.sys").Replace("\\", "/"), useEndsWith: true),
}, "TAGES"),
// The following files are supposed to only be found inside the driver setup executables, and are present in at least version 5.2.0.1 (Redump entry 15976).
- new PathMatchSet(new PathMatch("ithsgt.sys", useEndsWith: true), "TAGES Driver"),
- new PathMatchSet(new PathMatch("lilsgt.sys", useEndsWith: true), "TAGES Driver"),
+ new(new FilePathMatch("ithsgt.sys"), "TAGES Driver"),
+ new(new FilePathMatch("lilsgt.sys"), "TAGES Driver"),
// The following files are supposed to only be found inside the driver setup executables in versions 5.5.0.1+.
- new PathMatchSet(new PathMatch("atksgt.sys", useEndsWith: true), "TAGES Driver"),
- new PathMatchSet(new PathMatch("lirsgt.sys", useEndsWith: true), "TAGES Driver"),
+ new(new FilePathMatch("atksgt.sys"), "TAGES Driver"),
+ new(new FilePathMatch("lirsgt.sys"), "TAGES Driver"),
// The following files appear to be container formats for TAGES, but little is currently known about them (Redump entries 85313 and 85315).
- new PathMatchSet(new PathMatch("GameModule.elb", useEndsWith: true), "TAGES/SolidShield Game Executable Container"),
- new PathMatchSet(new PathMatch("InstallModule.elb", useEndsWith: true), "TAGES/SolidShield Installer Container"),
+ new(new FilePathMatch("GameModule.elb"), "TAGES/SolidShield Game Executable Container"),
+ new(new FilePathMatch("InstallModule.elb"), "TAGES/SolidShield Installer Container"),
// Not much is known about this file, but it seems to be related to what PiD reports as "protection level: Tages BASIC" (Redump entry 85313).
// Seems to always be found with other KWN files.
- new PathMatchSet(new PathMatch("GAME.KWN", useEndsWith: true), "TAGES (BASIC?)"),
+ new(new FilePathMatch("GAME.KWN"), "TAGES (BASIC?)"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
@@ -165,52 +165,52 @@ namespace BinaryObjectScanner.ProtectionType
var matchers = new List
{
// So far, only known to exist in early versions of "Moto Racer 3" (Redump entries 31578 and 34669).
- new PathMatchSet(new PathMatch("Devx.sys", useEndsWith: true), "TAGES Driver"),
- new PathMatchSet(new PathMatch("VtPr.sys", useEndsWith: true), "TAGES Driver"),
+ new(new FilePathMatch("Devx.sys"), "TAGES Driver"),
+ new(new FilePathMatch("VtPr.sys"), "TAGES Driver"),
// These are removed because they can potentially overmatch
- // new PathMatchSet(new PathMatch("Wave.aif", useEndsWith: true), "TAGES Driver"),
- // new PathMatchSet(new PathMatch("Wave.alf", useEndsWith: true), "TAGES Driver"),
- // new PathMatchSet(new PathMatch("Wave.apt", useEndsWith: true), "TAGES Driver"),
- // new PathMatchSet(new PathMatch("Wave.axt", useEndsWith: true), "TAGES Driver"),
+ // new(new FilePathMatch("Wave.aif"), "TAGES Driver"),
+ // new(new FilePathMatch("Wave.alf"), "TAGES Driver"),
+ // new(new FilePathMatch("Wave.apt"), "TAGES Driver"),
+ // new(new FilePathMatch("Wave.axt"), "TAGES Driver"),
// Currently only found in "Robocop" (Redump entry 35932).
// Found in a directory named "System", with an executable named "Setup.exe".
- new PathMatchSet(new PathMatch("Tamlx.apt", useEndsWith: true), "TAGES 9x Driver"),
- new PathMatchSet(new PathMatch("Tamlx.alf", useEndsWith: true), "TAGES 9x Driver"),
- new PathMatchSet(new PathMatch("enodpl.sys", useEndsWith: true), "TAGES NT Driver"),
- new PathMatchSet(new PathMatch("litdpl.sys", useEndsWith: true), "TAGES NT Driver"),
+ new(new FilePathMatch("Tamlx.apt"), "TAGES 9x Driver"),
+ new(new FilePathMatch("Tamlx.alf"), "TAGES 9x Driver"),
+ new(new FilePathMatch("enodpl.sys"), "TAGES NT Driver"),
+ new(new FilePathMatch("litdpl.sys"), "TAGES NT Driver"),
// Currently only known to exist in "XIII" and "Beyond Good & Evil" (Redump entries 8774-8776, 45940-45941, 18690-18693, and presumably 21320, 21321, 21323, and 36124).
- new PathMatchSet(new PathMatch("enodpl.sys", useEndsWith: true), "TAGES NT Driver"),
- new PathMatchSet(new PathMatch("ENODPL.VXD", useEndsWith: true), "TAGES 9x Driver"),
- new PathMatchSet(new PathMatch("tandpl.sys", useEndsWith: true), "TAGES NT Driver"),
- new PathMatchSet(new PathMatch("TANDPL.VXD", useEndsWith: true), "TAGES 9x Driver"),
+ new(new FilePathMatch("enodpl.sys"), "TAGES NT Driver"),
+ new(new FilePathMatch("ENODPL.VXD"), "TAGES 9x Driver"),
+ new(new FilePathMatch("tandpl.sys"), "TAGES NT Driver"),
+ new(new FilePathMatch("TANDPL.VXD"), "TAGES 9x Driver"),
// The directory of these files has been seen to be named two different things, with two different accompanying executables in the root of the directory.
// In the example where the directory is named "Drivers", the executable is named "Silent.exe" (Redump entry 51763).
// In the example where the directory is named "ELBdrivers", the executable is name "ELBDrivers.exe" (Redump entry 91090).
// The name and file size of the included executable vary, but there should always be one here.
- new PathMatchSet(new PathMatch("hwpsgt.vxd", useEndsWith: true), "TAGES 9x Driver"),
- new PathMatchSet(new PathMatch("lemsgt.vxd", useEndsWith: true), "TAGES 9x Driver"),
- new PathMatchSet(new PathMatch("hwpsgt.sys", useEndsWith: true), "TAGES NT Driver"),
- new PathMatchSet(new PathMatch("lemsgt.sys", useEndsWith: true), "TAGES NT Driver"),
+ new(new FilePathMatch("hwpsgt.vxd"), "TAGES 9x Driver"),
+ new(new FilePathMatch("lemsgt.vxd"), "TAGES 9x Driver"),
+ new(new FilePathMatch("hwpsgt.sys"), "TAGES NT Driver"),
+ new(new FilePathMatch("lemsgt.sys"), "TAGES NT Driver"),
// The following files are supposed to only be found inside the driver setup executables, and are present in at least version 5.2.0.1 (Redump entry 15976).
- new PathMatchSet(new PathMatch("ithsgt.sys", useEndsWith: true), "TAGES Driver"),
- new PathMatchSet(new PathMatch("lilsgt.sys", useEndsWith: true), "TAGES Driver"),
+ new(new FilePathMatch("ithsgt.sys"), "TAGES Driver"),
+ new(new FilePathMatch("lilsgt.sys"), "TAGES Driver"),
// The following files are supposed to only be found inside the driver setup executables in versions 5.5.0.1+.
- new PathMatchSet(new PathMatch("atksgt.sys", useEndsWith: true), "TAGES Driver"),
- new PathMatchSet(new PathMatch("lirsgt.sys", useEndsWith: true), "TAGES Driver"),
+ new(new FilePathMatch("atksgt.sys"), "TAGES Driver"),
+ new(new FilePathMatch("lirsgt.sys"), "TAGES Driver"),
// The following files appear to be container formats for TAGES, but little is currently known about them (Redump entries 85313 and 85315).
- new PathMatchSet(new PathMatch("GameModule.elb", useEndsWith: true), "TAGES/SolidShield Game Executable Container"),
- new PathMatchSet(new PathMatch("InstallModule.elb", useEndsWith: true), "TAGES/SolidShield Installer Container"),
+ new(new FilePathMatch("GameModule.elb"), "TAGES/SolidShield Game Executable Container"),
+ new(new FilePathMatch("InstallModule.elb"), "TAGES/SolidShield Installer Container"),
// Not much is known about this file, but it seems to be related to what PiD reports as "protection level: Tages BASIC" (Redump entry 85313).
// Seems to always be found with other KWN files.
- new PathMatchSet(new PathMatch("GAME.KWN", useEndsWith: true), "TAGES (BASIC?)"),
+ new(new FilePathMatch("GAME.KWN"), "TAGES (BASIC?)"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
@@ -236,19 +236,14 @@ namespace BinaryObjectScanner.ProtectionType
byte typeByte = fileContent[positions[0] + 6];
byte versionByte = fileContent[positions[0] + 7];
- switch (versionByte)
+ return versionByte switch
{
- case 0x1E:
- return "5.2";
- case 0x1B:
- return "5.3-5.4";
- case 0x14:
- return "5.5.0";
- case 0x04:
- return "5.5.2";
- default:
- return string.Empty;
- }
+ 0x1E => "5.2",
+ 0x1B => "5.3-5.4",
+ 0x14 => "5.5.0",
+ 0x04 => "5.5.2",
+ _ => string.Empty,
+ };
}
}
}
diff --git a/BinaryObjectScanner/Protection/TivolaRingProtection.cs b/BinaryObjectScanner/Protection/TivolaRingProtection.cs
index 1d7cc322..ea9ee03e 100644
--- a/BinaryObjectScanner/Protection/TivolaRingProtection.cs
+++ b/BinaryObjectScanner/Protection/TivolaRingProtection.cs
@@ -22,7 +22,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"),
+ new(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -33,7 +33,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"),
+ new(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Uplay.cs b/BinaryObjectScanner/Protection/Uplay.cs
index 352639b4..a14597de 100644
--- a/BinaryObjectScanner/Protection/Uplay.cs
+++ b/BinaryObjectScanner/Protection/Uplay.cs
@@ -54,15 +54,15 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("UbisoftConnect.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new PathMatch("UbisoftGameLauncher.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new PathMatch("UbisoftGameLauncher64.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new PathMatch("UbisoftGameLauncherInstaller.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("Uplay.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayCrashReporter.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayInstaller.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayService.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayWebCore.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftConnect.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftGameLauncher.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftGameLauncher64.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftGameLauncherInstaller.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("Uplay.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayCrashReporter.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayInstaller.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayService.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayWebCore.exe"), "Uplay / Ubisoft Connect"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -73,15 +73,15 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("UbisoftConnect.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new PathMatch("UbisoftGameLauncher.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new PathMatch("UbisoftGameLauncher64.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new PathMatch("UbisoftGameLauncherInstaller.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("Uplay.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayCrashReporter.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayInstaller.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayService.exe"), "Uplay / Ubisoft Connect"),
- new PathMatchSet(new FilePathMatch("UplayWebCore.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftConnect.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftGameLauncher.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftGameLauncher64.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UbisoftGameLauncherInstaller.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("Uplay.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayCrashReporter.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayInstaller.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayService.exe"), "Uplay / Ubisoft Connect"),
+ new(new FilePathMatch("UplayWebCore.exe"), "Uplay / Ubisoft Connect"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/WMDS.cs b/BinaryObjectScanner/Protection/WMDS.cs
index 4dd2194a..38e069c1 100644
--- a/BinaryObjectScanner/Protection/WMDS.cs
+++ b/BinaryObjectScanner/Protection/WMDS.cs
@@ -54,11 +54,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found on "All That I Am" by Santana (Barcode 8 2876-59773-2 6) and "Contraband" by Velvet Revolver (Barcode 8 28766 05242 8), "Touch" by Amerie, likely among others.
- new PathMatchSet(new List
+ new(new List
{
// These files always appear to be present together.
- new PathMatch("WMDS.dll", useEndsWith: true),
- new PathMatch("WMDS.ini", useEndsWith: true),
+ new FilePathMatch("WMDS.dll"),
+ new FilePathMatch("WMDS.ini"),
}, "Windows Media Data Session DRM"),
};
@@ -71,11 +71,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found on "All That I Am" by Santana (Barcode 8 2876-59773-2 6) and "Contraband" by Velvet Revolver (Barcode 8 28766 05242 8), "Touch" by Amerie, likely among others.
- new PathMatchSet(new PathMatch("WMDS.dll", useEndsWith: true), "Windows Media Data Session DRM"),
- new PathMatchSet(new PathMatch("WMDS.ini", useEndsWith: true), "Windows Media Data Session DRM"),
+ new(new FilePathMatch("WMDS.dll"), "Windows Media Data Session DRM"),
+ new(new FilePathMatch("WMDS.ini"), "Windows Media Data Session DRM"),
// Found on "Touch" by Amerie, along with "autorun.exe".
- new PathMatchSet(new PathMatch("WMDST.DAT", useEndsWith: true), "Windows Media Data Session DRM"),
+ new(new FilePathMatch("WMDST.DAT"), "Windows Media Data Session DRM"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/WTMCDProtect.cs b/BinaryObjectScanner/Protection/WTMCDProtect.cs
index 993ec7e6..9b03042f 100644
--- a/BinaryObjectScanner/Protection/WTMCDProtect.cs
+++ b/BinaryObjectScanner/Protection/WTMCDProtect.cs
@@ -61,7 +61,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new List
+ new(new List
{
new FilePathMatch("wtmfiles.dat"),
new FilePathMatch("Viewer.exe"),
@@ -77,10 +77,10 @@ namespace BinaryObjectScanner.Protection
// TODO: Add ImageX.imp as a wildcard, if possible
var matchers = new List
{
- new PathMatchSet(new FilePathMatch("Image.imp"), "WTM CD Protect"),
- new PathMatchSet(new FilePathMatch("Image1.imp"), "WTM CD Protect"),
- new PathMatchSet(new FilePathMatch("imp.dat"), "WTM CD Protect"),
- new PathMatchSet(new FilePathMatch("wtmfiles.dat"), "WTM Protection Viewer"),
+ new(new FilePathMatch("Image.imp"), "WTM CD Protect"),
+ new(new FilePathMatch("Image1.imp"), "WTM CD Protect"),
+ new(new FilePathMatch("imp.dat"), "WTM CD Protect"),
+ new(new FilePathMatch("wtmfiles.dat"), "WTM Protection Viewer"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/WinLock.cs b/BinaryObjectScanner/Protection/WinLock.cs
index d799d129..7b49e52d 100644
--- a/BinaryObjectScanner/Protection/WinLock.cs
+++ b/BinaryObjectScanner/Protection/WinLock.cs
@@ -30,7 +30,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// This is the temporary dummy file created in the C: drive.
- new PathMatchSet(new PathMatch("WinLock.PSX", useEndsWith: true), "WinLock"),
+ new(new FilePathMatch("WinLock.PSX"), "WinLock"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -42,7 +42,7 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// This is the temporary dummy file created in the C: drive.
- new PathMatchSet(new PathMatch("WinLock.PSX", useEndsWith: true), "WinLock"),
+ new(new FilePathMatch("WinLock.PSX"), "WinLock"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/Zzxzz.cs b/BinaryObjectScanner/Protection/Zzxzz.cs
index e9cffbbe..665ee0a1 100644
--- a/BinaryObjectScanner/Protection/Zzxzz.cs
+++ b/BinaryObjectScanner/Protection/Zzxzz.cs
@@ -21,11 +21,11 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
#if NET20 || NET35
- new PathMatchSet(Path.Combine(Path.Combine(path, "Zzxzz"), "Zzz.aze").Replace("\\", "/"), "Zzxzz"),
+ new(Path.Combine(Path.Combine(path, "Zzxzz"), "Zzz.aze").Replace("\\", "/"), "Zzxzz"),
#else
- new PathMatchSet(Path.Combine(path, "Zzxzz", "Zzz.aze").Replace("\\", "/"), "Zzxzz"),
+ new(Path.Combine(path, "Zzxzz", "Zzz.aze").Replace("\\", "/"), "Zzxzz"),
#endif
- new PathMatchSet($"Zzxzz/", "Zzxzz"),
+ new($"Zzxzz/", "Zzxzz"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -36,7 +36,7 @@ namespace BinaryObjectScanner.Protection
{
var matchers = new List
{
- new PathMatchSet(new PathMatch("Zzz.aze", useEndsWith: true), "Zzxzz"),
+ new(new PathMatch("Zzz.aze", useEndsWith: true), "Zzxzz"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Protection/nProtect.cs b/BinaryObjectScanner/Protection/nProtect.cs
index 61cc98c6..8509220c 100644
--- a/BinaryObjectScanner/Protection/nProtect.cs
+++ b/BinaryObjectScanner/Protection/nProtect.cs
@@ -89,14 +89,14 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in "MSSetup.exe" in Redump entry 90526 and "mhfSetup_f40_1000.exe" and Redump entry 99598.
- new PathMatchSet(new PathMatch("GameGuard.des", useEndsWith: true), "nProtect GameGuard"),
+ new(new FilePathMatch("GameGuard.des"), "nProtect GameGuard"),
// Found in "MSSetup.exe" in Redump entry 90526.
- new PathMatchSet(new PathMatch("npkcrypt.dll", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkcrypt.sys", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkcrypt.vxd", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkcusb.sys", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkpdb.dll", useEndsWith: true), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcrypt.dll"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcrypt.sys"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcrypt.vxd"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcusb.sys"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkpdb.dll"), "nProtect KeyCrypt"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -108,12 +108,12 @@ namespace BinaryObjectScanner.Protection
var matchers = new List
{
// Found in "MSSetup.exe" in Redump entry 90526.
- new PathMatchSet(new PathMatch("GameGuard.des", useEndsWith: true), "nProtect GameGuard"),
- new PathMatchSet(new PathMatch("npkcrypt.dll", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkcrypt.sys", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkcrypt.vxd", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkcusb.sys", useEndsWith: true), "nProtect KeyCrypt"),
- new PathMatchSet(new PathMatch("npkpdb.dll", useEndsWith: true), "nProtect KeyCrypt"),
+ new(new FilePathMatch("GameGuard.des"), "nProtect GameGuard"),
+ new(new FilePathMatch("npkcrypt.dll"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcrypt.sys"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcrypt.vxd"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkcusb.sys"), "nProtect KeyCrypt"),
+ new(new FilePathMatch("npkpdb.dll"), "nProtect KeyCrypt"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
diff --git a/BinaryObjectScanner/Scanner.cs b/BinaryObjectScanner/Scanner.cs
index ab41f7c8..e2c0a942 100644
--- a/BinaryObjectScanner/Scanner.cs
+++ b/BinaryObjectScanner/Scanner.cs
@@ -184,7 +184,7 @@ namespace BinaryObjectScanner
// Checkpoint
protections.TryGetValue(file, out var fullProtectionList);
- var fullProtection = (fullProtectionList != null && fullProtectionList.Any() ? string.Join(", ", fullProtectionList.ToArray()) : null);
+ var fullProtection = fullProtectionList != null && fullProtectionList.Any() ? string.Join(", ", [.. fullProtectionList]) : null;
this._fileProgress?.Report(new ProtectionProgress(reportableFileName, (i + 1) / (float)files.Count, fullProtection ?? string.Empty));
}
}
@@ -226,7 +226,7 @@ namespace BinaryObjectScanner
// Checkpoint
protections.TryGetValue(path, out var fullProtectionList);
- var fullProtection = (fullProtectionList != null && fullProtectionList.Any() ? string.Join(", ", fullProtectionList.ToArray()) : null);
+ var fullProtection = fullProtectionList != null && fullProtectionList.Any() ? string.Join(", ", [.. fullProtectionList]) : null;
this._fileProgress?.Report(new ProtectionProgress(reportableFileName, 1, fullProtection ?? string.Empty));
}
diff --git a/Test/Extractor.cs b/Test/Extractor.cs
index 9a3b321c..f48608ee 100644
--- a/Test/Extractor.cs
+++ b/Test/Extractor.cs
@@ -91,25 +91,23 @@ namespace Test
// If the 7-zip file itself fails
try
{
- using (SevenZipArchive sevenZipFile = SevenZipArchive.Open(stream))
+ using SevenZipArchive sevenZipFile = SevenZipArchive.Open(stream);
+ foreach (var entry in sevenZipFile.Entries)
{
- foreach (var entry in sevenZipFile.Entries)
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- // If we have a directory, skip it
- if (entry.IsDirectory)
- continue;
+ // If we have a directory, skip it
+ if (entry.IsDirectory)
+ continue;
- string tempFile = Path.Combine(outputDirectory, entry.Key);
- entry.WriteToFile(tempFile);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting 7-zip entry {entry.Key}: {ex}");
- Console.WriteLine();
- }
+ string tempFile = Path.Combine(outputDirectory, entry.Key);
+ entry.WriteToFile(tempFile);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting 7-zip entry {entry.Key}: {ex}");
+ Console.WriteLine();
}
}
}
@@ -187,22 +185,19 @@ namespace Test
Console.WriteLine("Extraction is not supported for this framework!");
Console.WriteLine();
#else
- using (var bz2File = new BZip2Stream(stream, CompressionMode.Decompress, true))
+ using var bz2File = new BZip2Stream(stream, CompressionMode.Decompress, true);
+
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- string tempFile = Path.Combine(outputDirectory, Guid.NewGuid().ToString());
- using (FileStream fs = File.OpenWrite(tempFile))
- {
- bz2File.CopyTo(fs);
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting bzip2: {ex}");
- Console.WriteLine();
- }
+ string tempFile = Path.Combine(outputDirectory, Guid.NewGuid().ToString());
+ using FileStream fs = File.OpenWrite(tempFile);
+ bz2File.CopyTo(fs);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting bzip2: {ex}");
+ Console.WriteLine();
}
#endif
}
@@ -295,26 +290,24 @@ namespace Test
Console.WriteLine("Extraction is not supported for this framework!");
Console.WriteLine();
#else
- using (var zipFile = GZipArchive.Open(stream))
+ using var zipFile = GZipArchive.Open(stream);
+ foreach (var entry in zipFile.Entries)
{
- foreach (var entry in zipFile.Entries)
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- // If we have a directory, skip it
- if (entry.IsDirectory)
- continue;
+ // If we have a directory, skip it
+ if (entry.IsDirectory)
+ continue;
- string tempFile = Path.Combine(outputDirectory, entry.Key);
- entry.WriteToFile(tempFile);
- }
+ string tempFile = Path.Combine(outputDirectory, entry.Key);
+ entry.WriteToFile(tempFile);
+ }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting gzip entry {entry.Key}: {ex}");
- Console.WriteLine();
- }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting gzip entry {entry.Key}: {ex}");
+ Console.WriteLine();
}
}
#endif
@@ -492,44 +485,43 @@ namespace Test
// If the MPQ file itself fails
try
{
- using (var mpqArchive = new StormLibSharp.MpqArchive(file, FileAccess.Read))
+ using var mpqArchive = new StormLibSharp.MpqArchive(file, FileAccess.Read);
+
+ // Try to open the listfile
+ string? listfile = null;
+ StormLibSharp.MpqFileStream listStream = mpqArchive.OpenFile("(listfile)");
+
+ // If we can't read the listfile, we just return
+ if (!listStream.CanRead)
{
- // Try to open the listfile
- string? listfile = null;
- StormLibSharp.MpqFileStream listStream = mpqArchive.OpenFile("(listfile)");
+ Console.WriteLine("Could not read the listfile, extraction halted!");
+ Console.WriteLine();
+ }
- // If we can't read the listfile, we just return
- if (!listStream.CanRead)
+ // Read the listfile in for processing
+ using (var sr = new StreamReader(listStream))
+ {
+ listfile = sr.ReadToEnd();
+ }
+
+ // Split the listfile by newlines
+ string[] listfileLines = listfile.Replace("\r\n", "\n").Split('\n');
+
+ // Loop over each entry
+ foreach (string sub in listfileLines)
+ {
+ // If an individual entry fails
+ try
{
- Console.WriteLine("Could not read the listfile, extraction halted!");
+ string tempFile = Path.Combine(outputDirectory, sub);
+ Directory.CreateDirectory(Path.GetDirectoryName(tempFile));
+ mpqArchive.ExtractFile(sub, tempFile);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting MoPaQ entry {sub}: {ex}");
Console.WriteLine();
}
-
- // Read the listfile in for processing
- using (StreamReader sr = new StreamReader(listStream))
- {
- listfile = sr.ReadToEnd();
- }
-
- // Split the listfile by newlines
- string[] listfileLines = listfile.Replace("\r\n", "\n").Split('\n');
-
- // Loop over each entry
- foreach (string sub in listfileLines)
- {
- // If an individual entry fails
- try
- {
- string tempFile = Path.Combine(outputDirectory, sub);
- Directory.CreateDirectory(Path.GetDirectoryName(tempFile));
- mpqArchive.ExtractFile(sub, tempFile);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting MoPaQ entry {sub}: {ex}");
- Console.WriteLine();
- }
- }
}
}
catch (Exception ex)
@@ -608,28 +600,26 @@ namespace Test
// If the zip file itself fails
try
{
- using (ZipArchive zipFile = ZipArchive.Open(stream))
+ using ZipArchive zipFile = ZipArchive.Open(stream);
+ foreach (var entry in zipFile.Entries)
{
- foreach (var entry in zipFile.Entries)
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- // If we have a directory, skip it
- if (entry.IsDirectory)
- continue;
+ // If we have a directory, skip it
+ if (entry.IsDirectory)
+ continue;
- string tempFile = Path.Combine(outputDirectory, entry.Key);
- string? directoryName = Path.GetDirectoryName(tempFile);
- if (directoryName != null)
- Directory.CreateDirectory(directoryName);
- entry.WriteToFile(tempFile);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting PKZIP entry {entry.Key}: {ex}");
- Console.WriteLine();
- }
+ string tempFile = Path.Combine(outputDirectory, entry.Key);
+ string? directoryName = Path.GetDirectoryName(tempFile);
+ if (directoryName != null)
+ Directory.CreateDirectory(directoryName);
+ entry.WriteToFile(tempFile);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting PKZIP entry {entry.Key}: {ex}");
+ Console.WriteLine();
}
}
}
@@ -682,25 +672,23 @@ namespace Test
// If the rar file itself fails
try
{
- using (RarArchive rarFile = RarArchive.Open(stream))
+ using RarArchive rarFile = RarArchive.Open(stream);
+ foreach (var entry in rarFile.Entries)
{
- foreach (var entry in rarFile.Entries)
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- // If we have a directory, skip it
- if (entry.IsDirectory)
- continue;
+ // If we have a directory, skip it
+ if (entry.IsDirectory)
+ continue;
- string tempFile = Path.Combine(outputDirectory, entry.Key);
- entry.WriteToFile(tempFile);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting RAR entry {entry.Key}: {ex}");
- Console.WriteLine();
- }
+ string tempFile = Path.Combine(outputDirectory, entry.Key);
+ entry.WriteToFile(tempFile);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting RAR entry {entry.Key}: {ex}");
+ Console.WriteLine();
}
}
}
@@ -753,25 +741,23 @@ namespace Test
// If the tar file itself fails
try
{
- using (TarArchive tarFile = TarArchive.Open(stream))
+ using TarArchive tarFile = TarArchive.Open(stream);
+ foreach (var entry in tarFile.Entries)
{
- foreach (var entry in tarFile.Entries)
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- // If we have a directory, skip it
- if (entry.IsDirectory)
- continue;
+ // If we have a directory, skip it
+ if (entry.IsDirectory)
+ continue;
- string tempFile = Path.Combine(outputDirectory, entry.Key);
- entry.WriteToFile(tempFile);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting Tape Archive entry {entry.Key}: {ex}");
- Console.WriteLine();
- }
+ string tempFile = Path.Combine(outputDirectory, entry.Key);
+ entry.WriteToFile(tempFile);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting Tape Archive entry {entry.Key}: {ex}");
+ Console.WriteLine();
}
}
}
@@ -875,22 +861,18 @@ namespace Test
Console.WriteLine("Extraction is not supported for this framework!");
Console.WriteLine();
#else
- using (var xzFile = new XZStream(stream))
+ using var xzFile = new XZStream(stream);
+ // If an individual entry fails
+ try
{
- // If an individual entry fails
- try
- {
- string tempFile = Path.Combine(outputDirectory, Guid.NewGuid().ToString());
- using (FileStream fs = File.OpenWrite(tempFile))
- {
- xzFile.CopyTo(fs);
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Something went wrong extracting xz: {ex}");
- Console.WriteLine();
- }
+ string tempFile = Path.Combine(outputDirectory, Guid.NewGuid().ToString());
+ using FileStream fs = File.OpenWrite(tempFile);
+ xzFile.CopyTo(fs);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Something went wrong extracting xz: {ex}");
+ Console.WriteLine();
}
#endif
}
diff --git a/Test/Printer.cs b/Test/Printer.cs
index 12a220d0..5964506d 100644
--- a/Test/Printer.cs
+++ b/Test/Printer.cs
@@ -27,7 +27,11 @@ namespace Test
}
else if (Directory.Exists(path))
{
+#if NET20 || NET35
+ foreach (string file in Directory.GetFiles(path, "*", SearchOption.AllDirectories))
+#else
foreach (string file in Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories))
+#endif
{
PrintFileInfo(file, json, debug);
}