using System.Collections.Generic; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { public class SmartE : IContentCheck, IPathCheck { /// /// Set of all ContentMatchSets for this protection /// private static readonly List contentMatchers = new List { // BITARTS new ContentMatchSet(new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }, "SmartE"), }; /// 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: Verify if these are OR or AND var matchers = new List { new PathMatchSet(new PathMatch("00001.TMP", useEndsWith: true), "SmartE"), new PathMatchSet(new PathMatch("00002.TMP", useEndsWith: true), "SmartE"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); } /// public string CheckFilePath(string path) { var matchers = new List { new PathMatchSet(new PathMatch("00001.TMP", useEndsWith: true), "SmartE"), new PathMatchSet(new PathMatch("00002.TMP", useEndsWith: true), "SmartE"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); } } }