Use content matching helper, part 3

This commit is contained in:
Matt Nadareski
2021-03-21 15:34:19 -07:00
parent 7e3ef544f0
commit d01826ffa4
23 changed files with 100 additions and 78 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using BurnOutSharp.Matching;
namespace BurnOutSharp.ProtectionType
{
@@ -10,13 +11,13 @@ namespace BurnOutSharp.ProtectionType
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
var mappings = new Dictionary<byte?[], string>
var matchers = new List<Matcher>
{
// BITARTS
[new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }] = "SmartE",
new Matcher(new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }, "SmartE"),
};
return Utilities.GetContentMatches(fileContent, mappings, includePosition);
return Utilities.GetContentMatches(file, fileContent, matchers, includePosition);
}
/// <inheritdoc/>