2021-03-23 09:52:09 -07:00
|
|
|
|
using System.Collections.Generic;
|
2021-03-21 22:19:38 -07:00
|
|
|
|
using BurnOutSharp.Matching;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
|
|
|
|
|
namespace BurnOutSharp.ProtectionType
|
|
|
|
|
|
{
|
2021-02-26 01:26:49 -08:00
|
|
|
|
public class MediaMaxCD3 : IContentCheck, IPathCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-03-23 09:52:09 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Set of all ContentMatchSets for this protection
|
|
|
|
|
|
/// </summary>
|
2021-03-23 16:43:23 -07:00
|
|
|
|
private static readonly List<ContentMatchSet> contentMatchers = new List<ContentMatchSet>
|
2020-11-03 14:41:05 -08:00
|
|
|
|
{
|
2021-03-23 09:52:09 -07:00
|
|
|
|
// Cd3Ctl
|
|
|
|
|
|
new ContentMatchSet(new byte?[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C }, "MediaMax CD-3"),
|
2020-11-03 14:41:05 -08:00
|
|
|
|
|
2021-03-23 09:52:09 -07:00
|
|
|
|
// DllInstallSbcp
|
|
|
|
|
|
new ContentMatchSet(new byte?[]
|
|
|
|
|
|
{
|
|
|
|
|
|
0x44, 0x6C, 0x6C, 0x49, 0x6E, 0x73, 0x74, 0x61,
|
|
|
|
|
|
0x6C, 0x6C, 0x53, 0x62, 0x63, 0x70
|
|
|
|
|
|
}, "MediaMax CD-3"),
|
|
|
|
|
|
};
|
2020-11-03 14:41:05 -08:00
|
|
|
|
|
2021-03-23 09:52:09 -07:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return MatchUtil.GetFirstMatch(file, fileContent, contentMatchers, includePosition);
|
2020-11-03 14:41:05 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-26 00:32:09 -08:00
|
|
|
|
/// <inheritdoc/>
|
2021-03-23 13:35:12 -07:00
|
|
|
|
public List<string> CheckDirectoryPath(string path, IEnumerable<string> files)
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-03-23 09:52:09 -07:00
|
|
|
|
var matchers = new List<PathMatchSet>
|
|
|
|
|
|
{
|
|
|
|
|
|
new PathMatchSet(new PathMatch("LaunchCd.exe", useEndsWith: true), "MediaMax CD-3"),
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2021-03-23 13:35:12 -07:00
|
|
|
|
return MatchUtil.GetAllMatches(files, matchers, any: true);
|
2021-03-19 15:41:49 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public string CheckFilePath(string path)
|
|
|
|
|
|
{
|
2021-03-23 09:52:09 -07:00
|
|
|
|
var matchers = new List<PathMatchSet>
|
|
|
|
|
|
{
|
|
|
|
|
|
new PathMatchSet(new PathMatch("LaunchCd.exe", useEndsWith: true), "MediaMax CD-3"),
|
|
|
|
|
|
};
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
2021-03-23 09:52:09 -07:00
|
|
|
|
return MatchUtil.GetFirstMatch(path, matchers, any: true);
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|