From 5587c79ac5ec4f29f0d06df5d672a01d6a485a67 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 31 Oct 2024 22:42:20 -0400 Subject: [PATCH] Reduce use of generic PathMatch --- BinaryObjectScanner/Protection/Bitpool.cs | 6 +-- BinaryObjectScanner/Protection/CDDVDCops.cs | 4 +- BinaryObjectScanner/Protection/CopyKiller.cs | 18 ++++----- BinaryObjectScanner/Protection/Denuvo.cs | 36 +++++++++--------- .../Protection/DinamicMultimedia.cs | 2 +- BinaryObjectScanner/Protection/DiscGuard.cs | 18 ++++----- BinaryObjectScanner/Protection/FreeLock.cs | 6 +-- BinaryObjectScanner/Protection/HexaLock.cs | 20 +++++----- BinaryObjectScanner/Protection/LabelGate.cs | 26 ++++++------- BinaryObjectScanner/Protection/LaserLok.cs | 24 ++++++------ .../Protection/Macrovision.FLEXnet.cs | 36 +++++++++--------- .../Protection/Macrovision.RipGuard.cs | 12 +++--- .../Protection/Macrovision.SafeDisc.cs | 38 +++++++++---------- BinaryObjectScanner/Protection/Macrovision.cs | 4 +- BinaryObjectScanner/Protection/MediaCloQ.cs | 4 +- BinaryObjectScanner/Protection/OpenMG.cs | 20 +++++----- BinaryObjectScanner/Protection/RingPROTECH.cs | 4 +- BinaryObjectScanner/Protection/SolidShield.cs | 15 +++++--- BinaryObjectScanner/Protection/Tages.cs | 36 +++++++++--------- BinaryObjectScanner/Protection/Zzxzz.cs | 2 +- 20 files changed, 168 insertions(+), 163 deletions(-) diff --git a/BinaryObjectScanner/Protection/Bitpool.cs b/BinaryObjectScanner/Protection/Bitpool.cs index 61c3f382..b09277f7 100644 --- a/BinaryObjectScanner/Protection/Bitpool.cs +++ b/BinaryObjectScanner/Protection/Bitpool.cs @@ -25,13 +25,13 @@ namespace BinaryObjectScanner.Protection // 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(new List - { + new( + [ new FilePathMatch("Crc_a"), new FilePathMatch("Crc_b"), new FilePathMatch("Crc_c"), new FilePathMatch("Crc_d"), - }, "Bitpool"), + ], "Bitpool"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/CDDVDCops.cs b/BinaryObjectScanner/Protection/CDDVDCops.cs index 1773824d..cacc9abf 100644 --- a/BinaryObjectScanner/Protection/CDDVDCops.cs +++ b/BinaryObjectScanner/Protection/CDDVDCops.cs @@ -191,7 +191,7 @@ 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(new PathMatch("CDCOPS.DLL", useEndsWith: true), "CD-Cops"), + new(new FilePathMatch("CDCOPS.DLL"), "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"), @@ -211,7 +211,7 @@ 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(new PathMatch("CDCOPS.DLL", useEndsWith: true), "CD-Cops"), + new(new FilePathMatch("CDCOPS.DLL"), "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"), diff --git a/BinaryObjectScanner/Protection/CopyKiller.cs b/BinaryObjectScanner/Protection/CopyKiller.cs index 2c43b1ab..93f0bdb3 100644 --- a/BinaryObjectScanner/Protection/CopyKiller.cs +++ b/BinaryObjectScanner/Protection/CopyKiller.cs @@ -45,8 +45,8 @@ namespace BinaryObjectScanner.Protection new(new FilePathMatch("CopyKillerV3"), "CopyKiller V3.62-3.64"), new(new FilePathMatch("CopyKillerV4"), "CopyKiller V3.99-3.99a"), - new(new List - { + new( + [ new FilePathMatch("ACK3900.ckt"), new FilePathMatch("ACK3999.ckt"), new FilePathMatch("CK100.wzc"), @@ -56,10 +56,10 @@ namespace BinaryObjectScanner.Protection new FilePathMatch("P261XP.tcck"), new FilePathMatch("WZ200.rwzc"), new FilePathMatch("XCK3900.ck2"), - }, "CopyKiller V3.99+"), + ], "CopyKiller V3.99+"), - new(new List - { + new( + [ new FilePathMatch("ACK3900.ckt"), new FilePathMatch("CK100.wzc"), new FilePathMatch("CK2500.ck"), @@ -68,13 +68,13 @@ namespace BinaryObjectScanner.Protection new FilePathMatch("P261XP.tcck"), new FilePathMatch("WZ200.rwzc"), new FilePathMatch("XCK3900.ck2"), - }, "CopyKiller V3.64+"), + ], "CopyKiller V3.64+"), - new(new List - { + new( + [ new FilePathMatch("CK100.wzc"), new FilePathMatch("Engine.wzc"), - }, "CopyKiller V3.62+"), + ], "CopyKiller V3.62+"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/Denuvo.cs b/BinaryObjectScanner/Protection/Denuvo.cs index da668b07..b9955065 100644 --- a/BinaryObjectScanner/Protection/Denuvo.cs +++ b/BinaryObjectScanner/Protection/Denuvo.cs @@ -270,21 +270,21 @@ 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(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"), + new(new FilePathMatch("denuvo-anti-cheat.sys"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-update-service.exe"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-runtime.dll"), "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(new PathMatch("Denuvo Anti-Cheat Installer.exe", useEndsWith: true), "Denuvo Anti-Cheat"), + new(new FilePathMatch("Denuvo Anti-Cheat Installer.exe"), "Denuvo Anti-Cheat"), // Found in the Denuvo Anti-Cheat installer on their support website. (https://web.archive.org/web/20240130142033/https://support.codefusion.technology/anti-cheat/?l=ja&s=ac&e=2009) - new(new PathMatch("denuvo-anti-cheat-installer.zip", useEndsWith: true), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-installer.zip"), "Denuvo Anti-Cheat"), // Found in "denuvo-anti-cheat-installer.zip". - new(new PathMatch("Denuvo-Anti-Cheat_install_run_as_Admin.bat", useEndsWith: true), "Denuvo Anti-Cheat"), - new(new PathMatch("denuvo-anti-cheat-crash-report.exe", useEndsWith: true), "Denuvo Anti-Cheat"), - new(new PathMatch("denuvo-anti-cheat-crash-report.exe.config", useEndsWith: true), "Denuvo Anti-Cheat"), - new(new PathMatch("denuvo-anti-cheat-update-service-launcher.dll", useEndsWith: true), "Denuvo Anti-Cheat"), + new(new FilePathMatch("Denuvo-Anti-Cheat_install_run_as_Admin.bat"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-crash-report.exe"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-crash-report.exe.config"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-update-service-launcher.dll"), "Denuvo Anti-Cheat"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); @@ -298,21 +298,21 @@ 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(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"), + new(new FilePathMatch("denuvo-anti-cheat.sys"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-update-service.exe"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-runtime.dll"), "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(new PathMatch("Denuvo Anti-Cheat Installer.exe", useEndsWith: true), "Denuvo Anti-Cheat"), + new(new FilePathMatch("Denuvo Anti-Cheat Installer.exe"), "Denuvo Anti-Cheat"), // Found in the Denuvo Anti-Cheat installer on their support website. (https://web.archive.org/web/20240130142033/https://support.codefusion.technology/anti-cheat/?l=ja&s=ac&e=2009) - new(new PathMatch("denuvo-anti-cheat-installer.zip", useEndsWith: true), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-installer.zip"), "Denuvo Anti-Cheat"), // Found in "denuvo-anti-cheat-installer.zip". - new(new PathMatch("Denuvo-Anti-Cheat_install_run_as_Admin.bat", useEndsWith: true), "Denuvo Anti-Cheat"), - new(new PathMatch("denuvo-anti-cheat-crash-report.exe", useEndsWith: true), "Denuvo Anti-Cheat"), - new(new PathMatch("denuvo-anti-cheat-crash-report.exe.config", useEndsWith: true), "Denuvo Anti-Cheat"), - new(new PathMatch("denuvo-anti-cheat-update-service-launcher.dll", useEndsWith: true), "Denuvo Anti-Cheat"), + new(new FilePathMatch("Denuvo-Anti-Cheat_install_run_as_Admin.bat"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-crash-report.exe"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-crash-report.exe.config"), "Denuvo Anti-Cheat"), + new(new FilePathMatch("denuvo-anti-cheat-update-service-launcher.dll"), "Denuvo Anti-Cheat"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/DinamicMultimedia.cs b/BinaryObjectScanner/Protection/DinamicMultimedia.cs index fc73bd24..9ebccc22 100644 --- a/BinaryObjectScanner/Protection/DinamicMultimedia.cs +++ b/BinaryObjectScanner/Protection/DinamicMultimedia.cs @@ -35,7 +35,7 @@ namespace BinaryObjectScanner.Protection new(new FilePathMatch(Path.Combine("XCONTROL", "XSMGOP.VBX")), "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(new PathMatch(Path.Combine("XCONTROL", "COMPSCO._01")), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"), + new(new FilePathMatch(Path.Combine("XCONTROL", "COMPSCO._01")), "Dinamic Multimedia Protection/LockBlocks [Check disc for 2 physical rings]"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/DiscGuard.cs b/BinaryObjectScanner/Protection/DiscGuard.cs index 51e19069..1c56dc61 100644 --- a/BinaryObjectScanner/Protection/DiscGuard.cs +++ b/BinaryObjectScanner/Protection/DiscGuard.cs @@ -143,25 +143,25 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found together in seemingly every DiscGuard game (Redump entries 31914, 46743, 46961, 79284, and 79374). - new(new List - { + new( + [ new FilePathMatch("IOSLINK.VXD"), new FilePathMatch("IOSLINK.SYS"), - }, "DiscGuard"), + ], "DiscGuard"), // Found together in one DiscGuard game (Redump entry 31914). - new(new List - { + new( + [ new FilePathMatch("TTR1.DLL"), new FilePathMatch("TTR2.DLL"), - }, "DiscGuard"), + ], "DiscGuard"), // Found together in most DiscGuard games (Redump entries 46743, 46961, 79284, and 79374). - new(new List - { + new( + [ new FilePathMatch("T111.DLL"), new FilePathMatch("T222.DLL"), - }, "DiscGuard"), + ], "DiscGuard"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); diff --git a/BinaryObjectScanner/Protection/FreeLock.cs b/BinaryObjectScanner/Protection/FreeLock.cs index 988d5c9d..0356b981 100644 --- a/BinaryObjectScanner/Protection/FreeLock.cs +++ b/BinaryObjectScanner/Protection/FreeLock.cs @@ -41,11 +41,11 @@ namespace BinaryObjectScanner.Protection new(new FilePathMatch("FREELOCK.13"), "Freelock 1.3"), // Found in "FREELOCK.IMG" From Freelock 1.3. - new(new List - { + new( + [ new FilePathMatch("FREELOCK.13"), new FilePathMatch("FL.DAT"), - }, "Freelock 1.3"), + ], "Freelock 1.3"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); diff --git a/BinaryObjectScanner/Protection/HexaLock.cs b/BinaryObjectScanner/Protection/HexaLock.cs index 80f9fbb0..946ea33e 100644 --- a/BinaryObjectScanner/Protection/HexaLock.cs +++ b/BinaryObjectScanner/Protection/HexaLock.cs @@ -73,30 +73,30 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // "Start_Here.exe" is the default name used in HexaLock AutoLock 4.5. - new(new List - { + new( + [ new FilePathMatch("Start_Here.exe"), new FilePathMatch("MFINT.DLL"), new FilePathMatch("MFIMP.DLL"), - }, "Hexalock AutoLock 4.5"), + ], "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(new List - { + new( + [ new FilePathMatch("kleft.ipf"), new FilePathMatch("ReadPFile.exe"), new FilePathMatch("Start.exe"), - }, "HexaLock AutoLock 4.7 PDF DRM"), + ], "HexaLock AutoLock 4.7 PDF DRM"), // Should be present in all known versions. - new(new List - { + new( + [ new FilePathMatch("MFINT.DLL"), new FilePathMatch("MFIMP.DLL"), - }, "HexaLock AutoLock"), + ], "HexaLock AutoLock"), // Found inside the file typically named "Start_Here.exe" in version 4.5. - new(new PathMatch("HCPSMng.exe"), "HexaLock AutoLock 4.5"), + new(new FilePathMatch("HCPSMng.exe"), "HexaLock AutoLock 4.5"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); diff --git a/BinaryObjectScanner/Protection/LabelGate.cs b/BinaryObjectScanner/Protection/LabelGate.cs index 9afbcdfa..2ade8975 100644 --- a/BinaryObjectScanner/Protection/LabelGate.cs +++ b/BinaryObjectScanner/Protection/LabelGate.cs @@ -54,24 +54,24 @@ 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(new List - { + new( + [ #if NET20 || NET35 - new(Path.Combine(Path.Combine("BIN", "WIN32"), "MQ2SETUP.EXE")), - new(Path.Combine(Path.Combine("BIN", "WIN32"), "MQSTART.EXE")), + new FilePathMatch(Path.Combine(Path.Combine("BIN", "WIN32"), "MQ2SETUP.EXE")), + new FilePathMatch(Path.Combine(Path.Combine("BIN", "WIN32"), "MQSTART.EXE")), #else - new(Path.Combine("BIN", "WIN32", "MQ2SETUP.EXE")), - new(Path.Combine("BIN", "WIN32", "MQSTART.EXE")), + new FilePathMatch(Path.Combine("BIN", "WIN32", "MQ2SETUP.EXE")), + new FilePathMatch(Path.Combine("BIN", "WIN32", "MQSTART.EXE")), #endif - }, "LabelGate CD2 Media Player"), + ], "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(new List - { - new(Path.Combine("MQDISC", "LICENSE.TXT")), - new(Path.Combine("MQDISC", "MQDISC.INI")), - new(Path.Combine("MQDISC", "START.INI")), - }, "LabelGate CD2"), + new( + [ + new FilePathMatch(Path.Combine("MQDISC", "LICENSE.TXT")), + new FilePathMatch(Path.Combine("MQDISC", "MQDISC.INI")), + new FilePathMatch(Path.Combine("MQDISC", "START.INI")), + ], "LabelGate CD2"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); diff --git a/BinaryObjectScanner/Protection/LaserLok.cs b/BinaryObjectScanner/Protection/LaserLok.cs index fdcdf3f1..0ae43d86 100644 --- a/BinaryObjectScanner/Protection/LaserLok.cs +++ b/BinaryObjectScanner/Protection/LaserLok.cs @@ -120,12 +120,12 @@ namespace BinaryObjectScanner.Protection // TODO: Verify if these are OR or AND 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]"), + new(new FilePathMatch("l16dll.dll"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.in"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.o10"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.o11"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.o12"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.out"), "LaserLok [Check disc for physical ring]"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); @@ -140,12 +140,12 @@ namespace BinaryObjectScanner.Protection // TODO: Verify if these are OR or AND 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]"), + new(new FilePathMatch("l16dll.dll"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.in"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.o10"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.o11"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.o12"), "LaserLok [Check disc for physical ring]"), + new(new FilePathMatch("laserlok.out"), "LaserLok [Check disc for physical ring]"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs b/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs index 7aeccfcd..720ba66c 100644 --- a/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs +++ b/BinaryObjectScanner/Protection/Macrovision.FLEXnet.cs @@ -74,15 +74,15 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found in IA item "prog-17_202403". - new(new PathMatch("FlexLM-6.1F", useEndsWith: true), "FlexLM 6.1f"), - new(new PathMatch("FlexLM", useEndsWith: true), "FlexLM"), - new(new PathMatch("FLexLM_Licensing.wri", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMGR326B.DLL", useEndsWith: true), "FlexLM"), - new(new PathMatch("FLEXLM.CPL", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMGRD.EXE", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMGRD95.EXE", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMUTIL.EXE", useEndsWith: true), "FlexLM"), - new(new PathMatch("READFLEX.WRI", useEndsWith: true), "FlexLM"), + new(new FilePathMatch("FlexLM-6.1F"), "FlexLM 6.1f"), + new(new FilePathMatch("FlexLM"), "FlexLM"), + new(new FilePathMatch("FLexLM_Licensing.wri"), "FlexLM"), + new(new FilePathMatch("LMGR326B.DLL"), "FlexLM"), + new(new FilePathMatch("FLEXLM.CPL"), "FlexLM"), + new(new FilePathMatch("LMGRD.EXE"), "FlexLM"), + new(new FilePathMatch("LMGRD95.EXE"), "FlexLM"), + new(new FilePathMatch("LMUTIL.EXE"), "FlexLM"), + new(new FilePathMatch("READFLEX.WRI"), "FlexLM"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); @@ -94,15 +94,15 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found in IA item "prog-17_202403". - new(new PathMatch("FlexLM-6.1F", useEndsWith: true), "FlexLM 6.1f"), - new(new PathMatch("FlexLM", useEndsWith: true), "FlexLM"), - new(new PathMatch("FLexLM_Licensing.wri", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMGR326B.DLL", useEndsWith: true), "FlexLM"), - new(new PathMatch("FLEXLM.CPL", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMGRD.EXE", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMGRD95.EXE", useEndsWith: true), "FlexLM"), - new(new PathMatch("LMUTIL.EXE", useEndsWith: true), "FlexLM"), - new(new PathMatch("READFLEX.WRI", useEndsWith: true), "FlexLM"), + new(new FilePathMatch("FlexLM-6.1F"), "FlexLM 6.1f"), + new(new FilePathMatch("FlexLM"), "FlexLM"), + new(new FilePathMatch("FLexLM_Licensing.wri"), "FlexLM"), + new(new FilePathMatch("LMGR326B.DLL"), "FlexLM"), + new(new FilePathMatch("FLEXLM.CPL"), "FlexLM"), + new(new FilePathMatch("LMGRD.EXE"), "FlexLM"), + new(new FilePathMatch("LMGRD95.EXE"), "FlexLM"), + new(new FilePathMatch("LMUTIL.EXE"), "FlexLM"), + new(new FilePathMatch("READFLEX.WRI"), "FlexLM"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs b/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs index 9239f2f8..a2aa0a71 100644 --- a/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs +++ b/BinaryObjectScanner/Protection/Macrovision.RipGuard.cs @@ -64,11 +64,11 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found in the Black Lagoon Season 1 DVD steelbook box set (Geneon ID 12970). - new(new PathMatch("G23YHWO1.EXE", useEndsWith: true), "RipGuard"), - new(new PathMatch("RGASDEV.SYS", useEndsWith: true), "RipGuard"), + new(new FilePathMatch("G23YHWO1.EXE"), "RipGuard"), + new(new FilePathMatch("RGASDEV.SYS"), "RipGuard"), // Mentioned online in https://forum.redfox.bz/threads/resolved-one-on-one-with-tony-horton-vol2-disc3.33901/. - new(new PathMatch("9KMJ9G4I.EXE", useEndsWith: true), "RipGuard (Unconfirmed - Please report to us on GitHub)"), + new(new FilePathMatch("9KMJ9G4I.EXE"), "RipGuard (Unconfirmed - Please report to us on GitHub)"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); @@ -80,11 +80,11 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found in the Black Lagoon Season 1 DVD steelbook box set (Geneon ID 12970). - new(new PathMatch("G23YHWO1.EXE", useEndsWith: true), "RipGuard"), - new(new PathMatch("RGASDEV.SYS", useEndsWith: true), "RipGuard"), + new(new FilePathMatch("G23YHWO1.EXE"), "RipGuard"), + new(new FilePathMatch("RGASDEV.SYS"), "RipGuard"), // Mentioned online in https://forum.redfox.bz/threads/resolved-one-on-one-with-tony-horton-vol2-disc3.33901/. - new(new PathMatch("9KMJ9G4I.EXE", useEndsWith: true), "RipGuard (Unconfirmed - Please report to us on GitHub)"), + new(new FilePathMatch("9KMJ9G4I.EXE"), "RipGuard (Unconfirmed - Please report to us on GitHub)"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs b/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs index 2187a9d7..971210d0 100644 --- a/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs +++ b/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs @@ -131,47 +131,47 @@ namespace BinaryObjectScanner.Protection { var matchers = new List { - new(new List - { + new( + [ new FilePathMatch("CLCD16.DLL"), new FilePathMatch("CLCD32.DLL"), new FilePathMatch("CLOKSPL.EXE"), - new(".icd", useEndsWith: true), - }, "SafeDisc 1/Lite"), + new PathMatch(".icd", useEndsWith: true), + ], "SafeDisc 1/Lite"), // Check for the original filename used for the SafeDisc splash-screens, new file names are used in later versions. - new(new List - { + new( + [ new FilePathMatch("00000001.TMP"), new FilePathMatch("SPLSH16.BMP"), new FilePathMatch("SPLSH256.BMP"), - }, "SafeDisc 1.00.025-1.01.044"), + ], "SafeDisc 1.00.025-1.01.044"), - new(new List - { + new( + [ 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(".016", useEndsWith: true), - new(".256", useEndsWith: true), - }, "SafeDisc 1.06.000-3.20.024"), + new PathMatch(".016", useEndsWith: true), + new PathMatch(".256", useEndsWith: true), + ], "SafeDisc 1.06.000-3.20.024"), - new(new List - { + new( + [ new FilePathMatch("00000001.TMP"), // The .016 files stop being used as of 4.00.000, while the .256 remain in fairly consistent use. - new(".256", useEndsWith: true), - }, "SafeDisc 1.06.000+"), + new PathMatch(".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(new List - { + new( + [ new FilePathMatch("00000001.TMP"), new FilePathMatch("drvmgt.dll"), new FilePathMatch("mcp.dll"), new FilePathMatch("secdrv.sys"), - }, "SafeDisc 1.45.011-1.50.020"), + ], "SafeDisc 1.45.011-1.50.020"), // Search for the splash screen files known to sometimes contain a generic SafeDisc splash-screen. new(new FilePathMatch("00000000.016"), GetSafeDiscSplshVersion, "SafeDisc"), diff --git a/BinaryObjectScanner/Protection/Macrovision.cs b/BinaryObjectScanner/Protection/Macrovision.cs index c2586855..1777a312 100644 --- a/BinaryObjectScanner/Protection/Macrovision.cs +++ b/BinaryObjectScanner/Protection/Macrovision.cs @@ -253,7 +253,7 @@ namespace BinaryObjectScanner.Protection { var matchers = new List { - new(new PathMatch("00000001.TMP", useEndsWith: true), Get00000001TMPVersion, string.Empty), + new(new FilePathMatch("00000001.TMP"), Get00000001TMPVersion, string.Empty), new(new FilePathMatch("secdrv.sys"), GetSecdrvFileSizeVersion, "Macrovision Security Driver"), }; @@ -265,7 +265,7 @@ namespace BinaryObjectScanner.Protection { var matchers = new List { - new(new PathMatch("00000001.TMP", useEndsWith: true), Get00000001TMPVersion, string.Empty), + new(new FilePathMatch("00000001.TMP"), Get00000001TMPVersion, string.Empty), new(new FilePathMatch("secdrv.sys"), GetSecdrvFileSizeVersion, "Macrovision Security Driver"), }; diff --git a/BinaryObjectScanner/Protection/MediaCloQ.cs b/BinaryObjectScanner/Protection/MediaCloQ.cs index 5f689c0e..ea9baec7 100644 --- a/BinaryObjectScanner/Protection/MediaCloQ.cs +++ b/BinaryObjectScanner/Protection/MediaCloQ.cs @@ -44,7 +44,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(new PathMatch("scvfy.exe", useEndsWith: true), "MediaCloQ"), + new(new FilePathMatch("scvfy.exe"), "MediaCloQ"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); @@ -58,7 +58,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(new PathMatch("scvfy.exe", useEndsWith: true), "MediaCloQ"), + new(new FilePathMatch("scvfy.exe"), "MediaCloQ"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/OpenMG.cs b/BinaryObjectScanner/Protection/OpenMG.cs index f50dcfc4..20879093 100644 --- a/BinaryObjectScanner/Protection/OpenMG.cs +++ b/BinaryObjectScanner/Protection/OpenMG.cs @@ -71,20 +71,20 @@ 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(new List - { - new(Path.Combine("OMGAUDIO", "00AUDTOC.DAT")), - new(Path.Combine("OMGAUDIO", "01AUDSTR.DAT")), - new(Path.Combine("OMGAUDIO", "05SRPCDS.DAT")), - new(Path.Combine("OMGEXTRA", "OMGSVC.DAT")), - }, "OpenMG"), + new( + [ + new FilePathMatch(Path.Combine("OMGAUDIO", "00AUDTOC.DAT")), + new FilePathMatch(Path.Combine("OMGAUDIO", "01AUDSTR.DAT")), + new FilePathMatch(Path.Combine("OMGAUDIO", "05SRPCDS.DAT")), + new FilePathMatch(Path.Combine("OMGEXTRA", "OMGSVC.DAT")), + ], "OpenMG"), // Always found together on OpenMG releases ("Touch" by Amerie, Redump entry 95010, and product ID SVWC-7185). - new(new List - { + new( + [ new FilePathMatch("SDKHM.DLL"), new FilePathMatch("SDKHM.EXE"), - }, "OpenMG"), + ], "OpenMG"), }; return MatchUtil.GetAllMatches(files, matchers, any: false); diff --git a/BinaryObjectScanner/Protection/RingPROTECH.cs b/BinaryObjectScanner/Protection/RingPROTECH.cs index 14968c75..93bbe099 100644 --- a/BinaryObjectScanner/Protection/RingPROTECH.cs +++ b/BinaryObjectScanner/Protection/RingPROTECH.cs @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found in Redump entry 94161 - new(new PathMatch("protect.pro", useEndsWith: true), "Ring PROTECH / ProRing [Check disc for physical ring]"), + new(new FilePathMatch("protect.pro"), "Ring PROTECH / ProRing [Check disc for physical ring]"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); @@ -52,7 +52,7 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // Found in Redump entry 94161 - new(new PathMatch("protect.pro", useEndsWith: true), "Ring PROTECH / ProRing [Check disc for physical ring]"), + new(new FilePathMatch("protect.pro"), "Ring PROTECH / ProRing [Check disc for physical ring]"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/SolidShield.cs b/BinaryObjectScanner/Protection/SolidShield.cs index 02212cdb..0479ac54 100644 --- a/BinaryObjectScanner/Protection/SolidShield.cs +++ b/BinaryObjectScanner/Protection/SolidShield.cs @@ -117,12 +117,12 @@ namespace BinaryObjectScanner.Protection // Found in Redump entry 68166. new(new FilePathMatch("tdvm.dll"), "SolidShield"), new(new FilePathMatch("tdvm.vds"), "SolidShield"), - new(new PathMatch("vfs20.dll", useEndsWith: true), "SolidShield"), + new(new FilePathMatch("vfs20.dll"), "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"), + new(new FilePathMatch("solidshield-cd.dll"), "SolidShield"), + new(new FilePathMatch("c11prot.dll"), "SolidShield"), }; // TODO: Verify if these are OR or AND @@ -134,10 +134,15 @@ namespace BinaryObjectScanner.Protection { var matchers = new List { + // Found in Redump entry 68166. + new(new FilePathMatch("tdvm.dll"), "SolidShield"), + new(new FilePathMatch("tdvm.vds"), "SolidShield"), + new(new FilePathMatch("vfs20.dll"), "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"), + new(new FilePathMatch("solidshield-cd.dll"), "SolidShield"), + new(new FilePathMatch("c11prot.dll"), "SolidShield"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BinaryObjectScanner/Protection/Tages.cs b/BinaryObjectScanner/Protection/Tages.cs index bc2dbbae..4bd53072 100644 --- a/BinaryObjectScanner/Protection/Tages.cs +++ b/BinaryObjectScanner/Protection/Tages.cs @@ -68,13 +68,13 @@ namespace BinaryObjectScanner.Protection var matchers = new List { // So far, only known to exist in early versions of "Moto Racer 3" (Redump entries 31578 and 34669). - new(new List - { + new( + [ // d37f70489207014d7d0fbaa43b081a93e8030498 - new(Path.Combine("Sys", "Devx.sys")), + new FilePathMatch(Path.Combine("Sys", "Devx.sys")), // a0acbc2f8e321e4f30c913c095e28af444058249 - new(Path.Combine("Sys", "VtPr.sys")), + new FilePathMatch(Path.Combine("Sys", "VtPr.sys")), // SHA-1 is variable, file size is 81,920 bytes new FilePathMatch("Wave.aif"), @@ -87,12 +87,12 @@ namespace BinaryObjectScanner.Protection // SHA-1 is variable, file size is 61,440 bytes new FilePathMatch("Wave.axt"), - }, "TAGES"), + ], "TAGES"), // Currently only found in "Robocop" (Redump entry 35932). // Found in a directory named "System", with an executable named "Setup.exe". - new(new List - { + new( + [ // f82339d797be6da92f5d9dadeae9025385159057 new FilePathMatch(Path.Combine("9x", "Tamlx.alf")), @@ -104,35 +104,35 @@ namespace BinaryObjectScanner.Protection // f111eba05ca6e9061c557547420847d7fdee657d new FilePathMatch(Path.Combine("NT", "litdpl.sys")), - }, "TAGES"), + ], "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(new List - { + new( + [ new FilePathMatch("enodpl.sys"), new FilePathMatch("ENODPL.VXD"), new FilePathMatch("tandpl.sys"), new FilePathMatch("TANDPL.VXD"), - }, "TAGES"), + ], "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(new List - { + new( + [ // 40826e95f3ad8031b6debe15aca052c701288e04 - new(Path.Combine("9x", "hwpsgt.vxd")), + new FilePathMatch(Path.Combine("9x", "hwpsgt.vxd")), // f82339d797be6da92f5d9dadeae9025385159057 - new(Path.Combine("9x", "lemsgt.vxd")), + new FilePathMatch(Path.Combine("9x", "lemsgt.vxd")), // 43f407ecdc0d87a3713126b757ccaad07ade285f - new(Path.Combine("NT", "hwpsgt.sys")), + new FilePathMatch(Path.Combine("NT", "hwpsgt.sys")), // 548dd6359abbcc8c84ce346d078664eeedc716f7 - new(Path.Combine("NT", "lemsgt.sys")), - }, "TAGES"), + new FilePathMatch(Path.Combine("NT", "lemsgt.sys")), + ], "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(new FilePathMatch("ithsgt.sys"), "TAGES Driver"), diff --git a/BinaryObjectScanner/Protection/Zzxzz.cs b/BinaryObjectScanner/Protection/Zzxzz.cs index aedbb23f..0d26652c 100644 --- a/BinaryObjectScanner/Protection/Zzxzz.cs +++ b/BinaryObjectScanner/Protection/Zzxzz.cs @@ -30,7 +30,7 @@ namespace BinaryObjectScanner.Protection { var matchers = new List { - new(new PathMatch("Zzz.aze", useEndsWith: true), "Zzxzz"), + new(new FilePathMatch("Zzz.aze"), "Zzxzz"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true);