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

@@ -10,9 +10,9 @@ namespace BurnOutSharp.ProtectionType
public class SecuROM : 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>
{
// AddD + (char)0x03 + (char)0x00 + (char)0x00 + (char)0x00)
new ContentMatchSet(new byte?[] { 0x41, 0x64, 0x64, 0x44, 0x03, 0x00, 0x00, 0x00 }, GetV4Version, "SecuROM"),
@@ -53,7 +53,12 @@ namespace BurnOutSharp.ProtectionType
// .cms_d + (char)0x00
new ContentMatchSet(new byte?[] { 0x2E, 0x63, 0x6D, 0x73, 0x5F, 0x64, 0x00 }, "SecuROM 1-3"),
};
}
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = GetContentMatchSets();
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}