using System.Collections.Generic; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { public class CopyKiller : IContentCheck, IPathCheck { /// /// Set of all ContentMatchSets for this protection /// private static readonly List contentMatchers = new List { // Tom Commander new ContentMatchSet(new byte?[] { 0x54, 0x6F, 0x6D, 0x20, 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x65, 0x72 }, "CopyKiller"), }; /// public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { return MatchUtil.GetFirstMatch(file, fileContent, contentMatchers, includePosition); } /// public List CheckDirectoryPath(string path, IEnumerable files) { // TODO: The following checks are overly broad and should be refined var matchers = new List { //new PathMatchSet(new PathMatch("Autorun.dat", useEndsWith: true), "CopyKiller"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); } /// public string CheckFilePath(string path) { // TODO: The following checks are overly broad and should be refined var matchers = new List { //new PathMatchSet(new PathMatch("Autorun.dat", useEndsWith: true), "CopyKiller"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); } } }