using System.Collections.Generic; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType { public class GFWL : IContentCheck, IPathCheck { /// /// Set of all ContentMatchSets for this protection /// private static readonly List contentMatchers = new List { // xlive.dll new ContentMatchSet(new byte?[] { 0x78, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x64, 0x6C, 0x6C }, "Games for Windows - Live"), }; /// public string CheckContents(string file, byte[] fileContent, bool includePosition = false) { return MatchUtil.GetFirstMatch(file, fileContent, contentMatchers, includePosition); } /// public List CheckDirectoryPath(string path, IEnumerable files) { var matchers = new List { new PathMatchSet(new PathMatch("XLiveRedist.msi", useEndsWith: true), "Games for Windows - Live"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); } /// public string CheckFilePath(string path) { var matchers = new List { new PathMatchSet(new PathMatch("XLiveRedist.msi", useEndsWith: true), "Games for Windows - Live"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); } } }