mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 14:54:56 +00:00
Static list of content matchers
This also includes some more path matcher conversions that I couldn't reasonably split out
This commit is contained in:
@@ -8,16 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
public class SafeLock : IContentCheck, IPathCheck
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of all ContentMatchSets for this protection
|
||||
/// </summary>
|
||||
private static List<ContentMatchSet> contentMatchers = 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 includePosition = false)
|
||||
{
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// SafeLock
|
||||
new ContentMatchSet(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B }, "SafeLock"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
|
||||
return MatchUtil.GetFirstMatch(file, fileContent, contentMatchers, includePosition);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
Reference in New Issue
Block a user