using System; using System.Collections.Concurrent; using System.Collections.Generic; using BinaryObjectScanner.Interfaces; using BinaryObjectScanner.Matching; using BinaryObjectScanner.Wrappers; namespace BinaryObjectScanner.Protection { /// /// MediaCloQ was a copy protection created by SunnComm to protect music CDs. It's a multisession CD, and all the audio tracks are erroneously marked as data tracks. /// public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible var sections = pex?.SectionTable; if (sections == null) return null; // Found in scvfy.exe on "Charley Pride - A Tribute to Jim Reeves" (barcode "7 816190222-2 4"). string name = pex.FileDescription; if (name?.StartsWith("scvfy MFC Application", StringComparison.OrdinalIgnoreCase) == true) return $"MediaCloQ"; // Found in scvfy.exe on "Charley Pride - A Tribute to Jim Reeves" (barcode "7 816190222-2 4"). name = pex.ProductName; if (name?.StartsWith("scvfy Application", StringComparison.OrdinalIgnoreCase) == true) return $"MediaCloQ"; return null; } /// public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable files) { var matchers = new List { // 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"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); } /// public string CheckFilePath(string path) { var matchers = new List { // 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"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); } } }