ContentMatchSets are now expected in IContentCheck

This commit is contained in:
Matt Nadareski
2021-08-25 19:37:32 -07:00
parent 7548646ba2
commit 3ab0bcc0ae
63 changed files with 478 additions and 182 deletions

View File

@@ -7,14 +7,19 @@ namespace BurnOutSharp.ProtectionType
public class SafeLock : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
public List<ContentMatchSet> GetContentMatchSets()
{
var matchers = new List<ContentMatchSet>
return new List<ContentMatchSet>
{
// SafeLock
new ContentMatchSet(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B }, "SafeLock"),
};
}
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = GetContentMatchSets();
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}