Files
BinaryObjectScanner/BurnOutSharp/ProtectionType/MediaMaxCD3.cs

49 lines
1.5 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
2021-03-21 22:19:38 -07:00
using BurnOutSharp.Matching;
namespace BurnOutSharp.ProtectionType
{
2021-02-26 01:26:49 -08:00
public class MediaMaxCD3 : IContentCheck, IPathCheck
{
2021-02-26 01:26:49 -08:00
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
2020-11-03 14:41:05 -08:00
{
2021-03-21 22:19:38 -07:00
var matchers = new List<Matcher>
{
// Cd3Ctl
new Matcher(new byte?[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C }, "MediaMax CD-3"),
2020-11-03 14:41:05 -08:00
2021-03-21 22:19:38 -07:00
// DllInstallSbcp
new Matcher(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-21 22:37:16 -07:00
return Utilities.GetFirstContentMatch(file, fileContent, matchers, includePosition);
2020-11-03 14:41:05 -08:00
}
2021-02-26 00:32:09 -08:00
/// <inheritdoc/>
2021-03-19 15:41:49 -07:00
public string CheckDirectoryPath(string path, IEnumerable<string> files)
{
2021-03-19 15:41:49 -07:00
if (files.Any(f => Path.GetFileName(f).Equals("LaunchCd.exe", StringComparison.OrdinalIgnoreCase)))
return "MediaMax CD-3";
return null;
}
/// <inheritdoc/>
public string CheckFilePath(string path)
{
if (Path.GetFileName(path).Equals("LaunchCd.exe", StringComparison.OrdinalIgnoreCase))
return "MediaMax CD-3";
return null;
}
}
}