From e5d0c5bdc47c93c2d2b9b69f068a70deec13d3ab Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest <50224630+HeroponRikiBestest@users.noreply.github.com> Date: Sun, 27 Oct 2024 00:19:41 -0400 Subject: [PATCH] Replace tivola with copy-x. (#331) --- BinaryObjectScanner/Protection/CopyX.cs | 17 +++++--- .../Protection/TivolaRingProtection.cs | 43 ------------------- 2 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 BinaryObjectScanner/Protection/TivolaRingProtection.cs diff --git a/BinaryObjectScanner/Protection/CopyX.cs b/BinaryObjectScanner/Protection/CopyX.cs index 5d34117f..968a1f62 100644 --- a/BinaryObjectScanner/Protection/CopyX.cs +++ b/BinaryObjectScanner/Protection/CopyX.cs @@ -19,6 +19,9 @@ namespace BinaryObjectScanner.Protection // TODO: Figure out if Light and Professional are what designate rings and rings+disccheck public class CopyX : IPathCheck, IPortableExecutableCheck { + // Previous check 'Tivola Ring Protect' removed because it was found to actually be copy-x. + // The checks were for ZDAT/webmast.dxx and ZDAT/webmast.dxx, for Redump IDs 81628 and 116418. + // https://web.archive.org/web/20011016234742/http://www.optimal-online.de:80/product/copy_x.htm // There are four kinds of copy-X; Light, Profesisonal, audio, and Trial Maker. // Audio is for Audio CDs. Might be scannable, might not. Samples needed to confirm. @@ -76,7 +79,7 @@ namespace BinaryObjectScanner.Protection // TODO: TKKG also has an NE 3.1x executable with a reference. This can be added later. // Samples: Redump ID 108150 if (pex.OverlayStrings.Any(s => s.Contains("optgraph.dll"))) - return "copy-X"; + return "copy-X [Check disc for physical ring]"; } var strs = pex.GetFirstSectionStrings(".rdata"); @@ -84,7 +87,7 @@ namespace BinaryObjectScanner.Protection { // Samples: Redump ID 82475, German Emergency 2 Deluxe, Redump ID 48393 if (strs.Any(s => s.Contains("optgraph.dll"))) - return "copy-X"; + return "copy-X [Check disc for physical ring]"; } return null; @@ -147,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"), + ], "copy-X [Check disc for physical ring]"), }; var match = MatchUtil.GetFirstMatch(fileList[0], block, matchers, false); @@ -171,17 +174,17 @@ namespace BinaryObjectScanner.Protection // Samples: Redump ID 108150, Redump ID 48393 // File responsible for disc check - new(new FilePathMatch("optgraph.dll"), "copy-X"), + new(new FilePathMatch("optgraph.dll"), "copy-X [Check disc for physical ring]"), // Seemingly comorbid file, referenced in above file - new(new FilePathMatch("iofile.x64"), "copy-X"), + new(new FilePathMatch("iofile.x64"), "copy-X [Check disc for physical ring]"), // Seemingly comorbid file - new(new FilePathMatch("sound.x64"), "copy-X"), + new(new FilePathMatch("sound.x64"), "copy-X [Check disc for physical ring]"), // Seemingly comorbid file // Check commented out until implementation can be decided - // new(new FilePathMatch("gov_*.x64"), "copy-X"), + // new(new FilePathMatch("gov_*.x64"), "copy-X [Check disc for physical ring]"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); } diff --git a/BinaryObjectScanner/Protection/TivolaRingProtection.cs b/BinaryObjectScanner/Protection/TivolaRingProtection.cs deleted file mode 100644 index cbad75ae..00000000 --- a/BinaryObjectScanner/Protection/TivolaRingProtection.cs +++ /dev/null @@ -1,43 +0,0 @@ -#if NET40_OR_GREATER || NETCOREAPP -using System.Collections.Concurrent; -#endif -using System.Collections.Generic; -using System.IO; -using BinaryObjectScanner.Interfaces; -using SabreTools.Matching; -using SabreTools.Matching.Paths; - -namespace BinaryObjectScanner.Protection -{ - /// - /// This protection needs far more research - /// - public class TivolaRingProtection : IPathCheck - { - /// -#if NET20 || NET35 - public Queue CheckDirectoryPath(string path, IEnumerable? files) -#else - public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable? files) -#endif - { - var matchers = new List - { - new(Path.Combine("ZDAT", "webmast.dxx"), "Tivola Ring Protection [Check disc for physical ring]"), - }; - - return MatchUtil.GetAllMatches(files, matchers, any: true); - } - - /// - public string? CheckFilePath(string path) - { - var matchers = new List - { - new(Path.Combine("ZDAT", "webmast.dxx"), "Tivola Ring Protection [Check disc for physical ring]"), - }; - - return MatchUtil.GetFirstMatch(path, matchers, any: true); - } - } -}