From 4eff18bf3a168e307b89d7b0b20771b77954a307 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 1 Dec 2024 23:07:52 -0500 Subject: [PATCH] Update packages --- BinaryObjectScanner/BinaryObjectScanner.csproj | 8 ++++---- BinaryObjectScanner/Protection/CDDVDCops.cs | 16 ++++++++-------- .../Protection/CactusDataShield.cs | 4 ++-- BinaryObjectScanner/Protection/CopyX.cs | 4 ++-- BinaryObjectScanner/Protection/Denuvo.cs | 4 ++-- BinaryObjectScanner/Protection/LaserLok.cs | 10 +++++++--- BinaryObjectScanner/Protection/SolidShield.cs | 4 +++- BinaryObjectScanner/Protection/Steam.cs | 12 ++++++------ ExtractionTool/ExtractionTool.csproj | 4 ++-- 9 files changed, 36 insertions(+), 30 deletions(-) diff --git a/BinaryObjectScanner/BinaryObjectScanner.csproj b/BinaryObjectScanner/BinaryObjectScanner.csproj index c4c3629c..c41cb2a8 100644 --- a/BinaryObjectScanner/BinaryObjectScanner.csproj +++ b/BinaryObjectScanner/BinaryObjectScanner.csproj @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/BinaryObjectScanner/Protection/CDDVDCops.cs b/BinaryObjectScanner/Protection/CDDVDCops.cs index 5e264d27..1608e9f0 100644 --- a/BinaryObjectScanner/Protection/CDDVDCops.cs +++ b/BinaryObjectScanner/Protection/CDDVDCops.cs @@ -210,11 +210,11 @@ namespace BinaryObjectScanner.Protection // Found in Redump entry 84517. 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"), + new(new PathMatch(".W_X", matchCase: true, useEndsWith: true), "CD/DVD-Cops"), + new(new PathMatch(".QZ_", matchCase: true, useEndsWith: true), "CD/DVD-Cops"), - 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)"), + new(new PathMatch(".GZ_", matchCase: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"), + new(new PathMatch(".Qz", matchCase: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); @@ -230,11 +230,11 @@ namespace BinaryObjectScanner.Protection // Found in Redump entry 84517. 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"), + new(new PathMatch(".W_X", matchCase: true, useEndsWith: true), "CD/DVD-Cops"), + new(new PathMatch(".QZ_", matchCase: true, useEndsWith: true), "CD/DVD-Cops"), - 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)"), + new(new PathMatch(".GZ_", matchCase: true, useEndsWith: true), "CD-Cops (Unconfirmed - Please report to us on Github)"), + new(new PathMatch(".Qz", matchCase: true, useEndsWith: true), "CD-Cops (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 0d78ea36..8bca7634 100644 --- a/BinaryObjectScanner/Protection/CactusDataShield.cs +++ b/BinaryObjectScanner/Protection/CactusDataShield.cs @@ -19,10 +19,10 @@ namespace BinaryObjectScanner.Protection var contentMatchSets = new List { // CDSPlayer - new([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([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"), }; return MatchUtil.GetFirstMatch(file, fileContent, contentMatchSets, includeDebug); diff --git a/BinaryObjectScanner/Protection/CopyX.cs b/BinaryObjectScanner/Protection/CopyX.cs index 6dfef6c8..dc41fea3 100644 --- a/BinaryObjectScanner/Protection/CopyX.cs +++ b/BinaryObjectScanner/Protection/CopyX.cs @@ -141,7 +141,7 @@ namespace BinaryObjectScanner.Protection // Checks for whatever this data is. // Samples: Redump ID 84759, Redump ID 107929. Professional discs also have this data, hence the exclusion check. new( - [ + new byte[] { 0x02, 0xFE, 0x4A, 0x4F, 0x52, 0x4B, 0x1C, 0xE0, 0x79, 0x8C, 0x7F, 0x85, 0x04, 0x00, 0x46, 0x46, 0x49, 0x46, 0x07, 0xF9, 0x9F, 0xA0, 0xA1, 0x9D, @@ -150,7 +150,7 @@ namespace BinaryObjectScanner.Protection 0x65, 0x5F, 0xFB, 0x06, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x1D, 0x1D, 0x1F, 0x1D, 0xFE, 0xFD, 0x51, 0x57, 0x56, 0x51, 0xFB, 0x06, 0x33, 0x34, - ], "copy-X [Check disc for physical ring]"), + }, "copy-X [Check disc for physical ring]"), }; var match = MatchUtil.GetFirstMatch(lightFiles[0], block, matchers, false); diff --git a/BinaryObjectScanner/Protection/Denuvo.cs b/BinaryObjectScanner/Protection/Denuvo.cs index 6756b200..ddab30a9 100644 --- a/BinaryObjectScanner/Protection/Denuvo.cs +++ b/BinaryObjectScanner/Protection/Denuvo.cs @@ -86,10 +86,10 @@ namespace BinaryObjectScanner.Protection { // Denuvo Timing new( - [ + new byte[] { 0x44, 0x65, 0x6E, 0x75, 0x76, 0x6F, 0x20, 0x54, 0x69, 0x6D, 0x69, 0x6E, 0x67, - ], "Denuvo") + }, "Denuvo") }; var timingMatch = MatchUtil.GetFirstMatch(file, pex.EntryPointData, timingMatchers, includeDebug); diff --git a/BinaryObjectScanner/Protection/LaserLok.cs b/BinaryObjectScanner/Protection/LaserLok.cs index 56d9c782..96729616 100644 --- a/BinaryObjectScanner/Protection/LaserLok.cs +++ b/BinaryObjectScanner/Protection/LaserLok.cs @@ -68,7 +68,8 @@ namespace BinaryObjectScanner.Protection int position = -1; // Check the executable tables - bool containsCheck = pex.StubExecutableData?.FirstPosition(check, out position) ?? false; + position = pex.StubExecutableData?.FirstPosition(check) ?? -1; + bool containsCheck = position > -1; bool containsCheck2 = Array.Exists(pex.Model.ImportTable?.HintNameTable ?? [], hnte => hnte?.Name == "GetModuleHandleA") && Array.Exists(pex.Model.ImportTable?.HintNameTable ?? [], hnte => hnte?.Name == "GetProcAddress") && Array.Exists(pex.Model.ImportTable?.HintNameTable ?? [], hnte => hnte?.Name == "LoadLibraryA") @@ -92,7 +93,9 @@ namespace BinaryObjectScanner.Protection 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; + + position2 = pex.GetFirstSectionData(".text")?.FirstPosition(check2) ?? -1; + containsCheck2 = position2 > -1; } else { @@ -163,7 +166,8 @@ namespace BinaryObjectScanner.Protection 0x55, 0x6E, 0x6B, 0x6F, 0x77, 0x6E, 0x00, 0x55, 0x6E, 0x6B, 0x6F, 0x77, 0x6E ]; - if (!sectionContent.FirstPosition(check, out int position)) + int position = sectionContent.FirstPosition(check); + if (position == -1) return "(Build unknown)"; int index = versionTwo ? position + 14 : position + 13; diff --git a/BinaryObjectScanner/Protection/SolidShield.cs b/BinaryObjectScanner/Protection/SolidShield.cs index c60afd48..f512507a 100644 --- a/BinaryObjectScanner/Protection/SolidShield.cs +++ b/BinaryObjectScanner/Protection/SolidShield.cs @@ -200,7 +200,9 @@ namespace BinaryObjectScanner.Protection 0x6C, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00 ]; - if (fileContent.FirstPosition(check2, out int position2)) + + int position2 = fileContent.FirstPosition(check2); + if (position2 > -1) { position2--; // TODO: Verify this subtract return $"2 + Tagès {fileContent[position2 + 0x38]}.{fileContent[position2 + 0x38 + 4]}.{fileContent[position2 + 0x38 + 8]}.{fileContent[position + 0x38 + 12]}"; diff --git a/BinaryObjectScanner/Protection/Steam.cs b/BinaryObjectScanner/Protection/Steam.cs index c10d4244..7b31c831 100644 --- a/BinaryObjectScanner/Protection/Steam.cs +++ b/BinaryObjectScanner/Protection/Steam.cs @@ -48,17 +48,17 @@ namespace BinaryObjectScanner.Protection // (.sis/.sim/.sid) - Redump entry 12943 new( [ - new PathMatch(".sis", matchExact: false, useEndsWith: true), - new PathMatch(".sim", matchExact: false, useEndsWith: true), - new PathMatch(".sid", matchExact: false, useEndsWith: true), + new PathMatch(".sis", matchCase: false, useEndsWith: true), + new PathMatch(".sim", matchCase: false, useEndsWith: true), + new PathMatch(".sid", matchCase: false, useEndsWith: true), ], "Steam (.sis/.sim/.sid)"), // (.sis/.csm/.csd) - Redump entry 101916 new( [ - new PathMatch(".sis", matchExact: false, useEndsWith: true), - new PathMatch(".csm", matchExact: false, useEndsWith: true), - new PathMatch(".csd", matchExact: false, useEndsWith: true), + new PathMatch(".sis", matchCase: false, useEndsWith: true), + new PathMatch(".csm", matchCase: false, useEndsWith: true), + new PathMatch(".csd", matchCase: false, useEndsWith: true), ], "Steam (.sis/.csm/.csd)"), // These checks are grouped together due to the names being generic on their own (Redump entry 91450). diff --git a/ExtractionTool/ExtractionTool.csproj b/ExtractionTool/ExtractionTool.csproj index eeecff79..5b914d82 100644 --- a/ExtractionTool/ExtractionTool.csproj +++ b/ExtractionTool/ExtractionTool.csproj @@ -36,8 +36,8 @@ - - + + \ No newline at end of file