mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-08-03 06:29:21 +00:00
Split matchers more cleanly, comment better
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
|
||||
namespace BurnOutSharp.Matching
|
||||
{
|
||||
/// <summary>
|
||||
/// Content matching criteria
|
||||
/// </summary>
|
||||
internal class ContentMatch
|
||||
internal class ContentMatch : IMatch<byte?[]>
|
||||
{
|
||||
/// <summary>
|
||||
/// Content to match
|
||||
@@ -22,6 +20,12 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
public int End { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="needle">Byte array representing the search</param>
|
||||
/// <param name="start">Optional starting index</param>
|
||||
/// <param name="end">Optional ending index</param>
|
||||
public ContentMatch(byte?[] needle, int start = -1, int end = -1)
|
||||
{
|
||||
Needle = needle;
|
||||
@@ -36,7 +40,8 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
/// <param name="stack">Array to search for the given content</param>
|
||||
/// <param name="reverse">True to search from the end of the array, false from the start</param>
|
||||
public (bool, int) Match(byte[] stack, bool reverse = false)
|
||||
/// <returns>Tuple of success and found position</returns>
|
||||
public (bool success, int position) Match(byte[] stack, bool reverse = false)
|
||||
{
|
||||
// If either array is null or empty, we can't do anything
|
||||
if (stack == null || stack.Length == 0 || Needle == null || Needle.Length == 0)
|
||||
@@ -66,6 +71,7 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
/// <param name="stack">Array to search for the given content</param>
|
||||
/// <param name="index">Starting index to check equality</param>
|
||||
/// <returns>True if the needle matches the stack at a given index</returns>
|
||||
private bool EqualAt(byte[] stack, int index)
|
||||
{
|
||||
// If the index is invalid, we can't do anything
|
||||
|
||||
109
BurnOutSharp/Matching/ContentMatchSet.cs
Normal file
109
BurnOutSharp/Matching/ContentMatchSet.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BurnOutSharp.Matching
|
||||
{
|
||||
/// <summary>
|
||||
/// A set of content matches that work together
|
||||
/// </summary>
|
||||
internal class ContentMatchSet : MatchSet<ContentMatch, byte?[]>
|
||||
{
|
||||
/// <summary>
|
||||
/// Function to get a content version
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A content version method takes the file path, the file contents,
|
||||
/// and a list of found positions and returns a single string. That
|
||||
/// string is either a version string, in which case it will be appended
|
||||
/// to the protection name, or `null`, in which case it will cause
|
||||
/// the protection to be omitted.
|
||||
/// </remarks>
|
||||
public Func<string, byte[], List<int>, string> GetVersion { get; set; }
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ContentMatchSet(byte?[] needle, string protectionName)
|
||||
: this(new List<byte?[]> { needle }, null, protectionName) { }
|
||||
|
||||
public ContentMatchSet(List<byte?[]> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public ContentMatchSet(byte?[] needle, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
: this(new List<byte?[]> { needle }, getVersion, protectionName) { }
|
||||
|
||||
public ContentMatchSet(List<byte?[]> needles, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
: this(needles.Select(n => new ContentMatch(n)).ToList(), getVersion, protectionName) { }
|
||||
|
||||
public ContentMatchSet(ContentMatch needle, string protectionName)
|
||||
: this(new List<ContentMatch>() { needle }, null, protectionName) { }
|
||||
|
||||
public ContentMatchSet(List<ContentMatch> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public ContentMatchSet(ContentMatch needle, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
: this(new List<ContentMatch>() { needle }, getVersion, protectionName) { }
|
||||
|
||||
public ContentMatchSet(List<ContentMatch> needles, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
{
|
||||
Matchers = needles;
|
||||
GetVersion = getVersion;
|
||||
ProtectionName = protectionName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Matching
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether all content matches pass
|
||||
/// </summary>
|
||||
/// <param name="fileContent">Byte array representing the file contents</param>
|
||||
/// <returns>Tuple of passing status and matching positions</returns>
|
||||
public (bool, List<int>) MatchesAll(byte[] fileContent)
|
||||
{
|
||||
// If no content matches are defined, we fail out
|
||||
if (Matchers == null || !Matchers.Any())
|
||||
return (false, null);
|
||||
|
||||
// Initialize the position list
|
||||
List<int> positions = new List<int>();
|
||||
|
||||
// Loop through all content matches and make sure all pass
|
||||
foreach (var contentMatch in Matchers)
|
||||
{
|
||||
(bool match, int position) = contentMatch.Match(fileContent);
|
||||
if (!match)
|
||||
return (false, null);
|
||||
else
|
||||
positions.Add(position);
|
||||
}
|
||||
|
||||
return (true, positions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether any content matches pass
|
||||
/// </summary>
|
||||
/// <param name="fileContent">Byte array representing the file contents</param>
|
||||
/// <returns>Tuple of passing status and first matching position</returns>
|
||||
public (bool, int) MatchesAny(byte[] fileContent)
|
||||
{
|
||||
// If no content matches are defined, we fail out
|
||||
if (Matchers == null || !Matchers.Any())
|
||||
return (false, -1);
|
||||
|
||||
// Loop through all content matches and make sure all pass
|
||||
foreach (var contentMatch in Matchers)
|
||||
{
|
||||
(bool match, int position) = contentMatch.Match(fileContent);
|
||||
if (match)
|
||||
return (true, position);
|
||||
}
|
||||
|
||||
return (false, -1);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
7
BurnOutSharp/Matching/IMatch.cs
Normal file
7
BurnOutSharp/Matching/IMatch.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace BurnOutSharp.Matching
|
||||
{
|
||||
internal interface IMatch<T>
|
||||
{
|
||||
T Needle { get; set; }
|
||||
}
|
||||
}
|
||||
20
BurnOutSharp/Matching/MatchSet.cs
Normal file
20
BurnOutSharp/Matching/MatchSet.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BurnOutSharp.Matching
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for a single set of matching criteria
|
||||
/// </summary>
|
||||
internal class MatchSet<T, U> where T : IMatch<U>
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of all matchers
|
||||
/// </summary>
|
||||
public IEnumerable<T> Matchers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the protection to show
|
||||
/// </summary>
|
||||
public string ProtectionName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -15,13 +15,13 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
/// <param name="file">File to check for matches</param>
|
||||
/// <param name="fileContent">Byte array representing the file contents</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of ContentMatchSets to be run on the file</param>
|
||||
/// <param name="includePosition">True to include positional data, false otherwise</param>
|
||||
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
|
||||
public static List<string> GetAllContentMatches(
|
||||
string file,
|
||||
byte[] fileContent,
|
||||
IEnumerable<Matcher> matchers,
|
||||
IEnumerable<ContentMatchSet> matchers,
|
||||
bool includePosition = false)
|
||||
{
|
||||
return FindAllContentMatches(file, fileContent, matchers, includePosition, false);
|
||||
@@ -32,13 +32,13 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
/// <param name="file">File to check for matches</param>
|
||||
/// <param name="fileContent">Byte array representing the file contents</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of ContentMatchSets to be run on the file</param>
|
||||
/// <param name="includePosition">True to include positional data, false otherwise</param>
|
||||
/// <returns>String representing the matched protection, null otherwise</returns>
|
||||
public static string GetFirstContentMatch(
|
||||
string file,
|
||||
byte[] fileContent,
|
||||
IEnumerable<Matcher> matchers,
|
||||
IEnumerable<ContentMatchSet> matchers,
|
||||
bool includePosition = false)
|
||||
{
|
||||
var contentMatches = FindAllContentMatches(file, fileContent, matchers, includePosition, true);
|
||||
@@ -53,14 +53,14 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
/// <param name="file">File to check for matches</param>
|
||||
/// <param name="fileContent">Byte array representing the file contents</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of ContentMatchSets to be run on the file</param>
|
||||
/// <param name="includePosition">True to include positional data, false otherwise</param>
|
||||
/// <param name="stopAfterFirst">True to stop after the first match, false otherwise</param>
|
||||
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
|
||||
private static List<string> FindAllContentMatches(
|
||||
string file,
|
||||
byte[] fileContent,
|
||||
IEnumerable<Matcher> matchers,
|
||||
IEnumerable<ContentMatchSet> matchers,
|
||||
bool includePosition,
|
||||
bool stopAfterFirst)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ namespace BurnOutSharp.Matching
|
||||
string positionsString = string.Join(", ", positions);
|
||||
|
||||
// If we there is no version method, just return the protection name
|
||||
if (matcher.GetContentVersion == null)
|
||||
if (matcher.GetVersion == null)
|
||||
{
|
||||
matchedProtections.Add((matcher.ProtectionName ?? "Unknown Protection") + (includePosition ? $" (Index {positionsString})" : string.Empty));
|
||||
}
|
||||
@@ -92,7 +92,7 @@ namespace BurnOutSharp.Matching
|
||||
else
|
||||
{
|
||||
// A null version returned means the check didn't pass at the version step
|
||||
string version = matcher.GetContentVersion(file, fileContent, positions);
|
||||
string version = matcher.GetVersion(file, fileContent, positions);
|
||||
if (version == null)
|
||||
continue;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace BurnOutSharp.Matching
|
||||
|
||||
return matchedProtections;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Path Matching
|
||||
@@ -115,10 +115,10 @@ namespace BurnOutSharp.Matching
|
||||
/// Get all path matches for a given list of matchers
|
||||
/// </summary>
|
||||
/// <param name="file">File path to check for matches</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of PathMatchSets to be run on the file</param>
|
||||
/// <param name="any">True if any path match is a success, false if all have to match</param>
|
||||
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
|
||||
public static List<string> GetAllPathMatches(string file, IEnumerable<Matcher> matchers, bool any = false)
|
||||
public static List<string> GetAllPathMatches(string file, IEnumerable<PathMatchSet> matchers, bool any = false)
|
||||
{
|
||||
return FindAllPathMatches(new List<string> { file }, matchers, any, false);
|
||||
}
|
||||
@@ -127,10 +127,10 @@ namespace BurnOutSharp.Matching
|
||||
/// Get all path matches for a given list of matchers
|
||||
/// </summary>
|
||||
/// <param name="files">File paths to check for matches</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of PathMatchSets to be run on the file</param>
|
||||
/// <param name="any">True if any path match is a success, false if all have to match</param>
|
||||
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
|
||||
public static List<string> GetAllPathMatches(List<string> files, IEnumerable<Matcher> matchers, bool any = false)
|
||||
public static List<string> GetAllPathMatches(List<string> files, IEnumerable<PathMatchSet> matchers, bool any = false)
|
||||
{
|
||||
return FindAllPathMatches(files, matchers, any, false);
|
||||
}
|
||||
@@ -139,10 +139,10 @@ namespace BurnOutSharp.Matching
|
||||
/// Get first path match for a given list of matchers
|
||||
/// </summary>
|
||||
/// <param name="file">File path to check for matches</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of PathMatchSets to be run on the file</param>
|
||||
/// <param name="any">True if any path match is a success, false if all have to match</param>
|
||||
/// <returns>String representing the matched protection, null otherwise</returns>
|
||||
public static string GetFirstPathMatch(string file, IEnumerable<Matcher> matchers, bool any = false)
|
||||
public static string GetFirstPathMatch(string file, IEnumerable<PathMatchSet> matchers, bool any = false)
|
||||
{
|
||||
var contentMatches = FindAllPathMatches(new List<string> { file }, matchers, any, true);
|
||||
if (contentMatches == null || !contentMatches.Any())
|
||||
@@ -155,10 +155,10 @@ namespace BurnOutSharp.Matching
|
||||
/// Get first path match for a given list of matchers
|
||||
/// </summary>
|
||||
/// <param name="files">File paths to check for matches</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of PathMatchSets to be run on the file</param>
|
||||
/// <param name="any">True if any path match is a success, false if all have to match</param>
|
||||
/// <returns>String representing the matched protection, null otherwise</returns>
|
||||
public static string GetFirstPathMatch(List<string> files, IEnumerable<Matcher> matchers, bool any = false)
|
||||
public static string GetFirstPathMatch(List<string> files, IEnumerable<PathMatchSet> matchers, bool any = false)
|
||||
{
|
||||
var contentMatches = FindAllPathMatches(files, matchers, any, true);
|
||||
if (contentMatches == null || !contentMatches.Any())
|
||||
@@ -171,11 +171,11 @@ namespace BurnOutSharp.Matching
|
||||
/// Get the required set of path matches on a per Matcher basis
|
||||
/// </summary>
|
||||
/// <param name="files">File paths to check for matches</param>
|
||||
/// <param name="matchers">Enumerable of matchers to be run on the file</param>
|
||||
/// <param name="matchers">Enumerable of PathMatchSets to be run on the file</param>
|
||||
/// <param name="any">True if any path match is a success, false if all have to match</param>
|
||||
/// <param name="stopAfterFirst">True to stop after the first match, false otherwise</param>
|
||||
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
|
||||
private static List<string> FindAllPathMatches(List<string> files, IEnumerable<Matcher> matchers, bool any, bool stopAfterFirst)
|
||||
private static List<string> FindAllPathMatches(List<string> files, IEnumerable<PathMatchSet> matchers, bool any, bool stopAfterFirst)
|
||||
{
|
||||
// If there's no mappings, we can't match
|
||||
if (matchers == null || !matchers.Any())
|
||||
@@ -189,17 +189,26 @@ namespace BurnOutSharp.Matching
|
||||
{
|
||||
// Determine if the matcher passes
|
||||
bool passes;
|
||||
string firstMatchedString;
|
||||
if (any)
|
||||
(passes, _) = matcher.MatchesAny(files);
|
||||
{
|
||||
(bool anyPasses, string matchedString) = matcher.MatchesAny(files);
|
||||
passes = anyPasses;
|
||||
firstMatchedString = matchedString;
|
||||
}
|
||||
else
|
||||
(passes, _) = matcher.MatchesAll(files);
|
||||
{
|
||||
(bool allPasses, List<string> matchedStrings) = matcher.MatchesAll(files);
|
||||
passes = allPasses;
|
||||
firstMatchedString = matchedStrings.FirstOrDefault();
|
||||
}
|
||||
|
||||
// If we don't have a pass, just continue
|
||||
if (!passes)
|
||||
continue;
|
||||
|
||||
// If we there is no version method, just return the protection name
|
||||
if (matcher.GetPathVersion == null)
|
||||
if (matcher.GetVersion == null)
|
||||
{
|
||||
matchedProtections.Add(matcher.ProtectionName ?? "Unknown Protection");
|
||||
}
|
||||
@@ -207,8 +216,12 @@ namespace BurnOutSharp.Matching
|
||||
// Otherwise, invoke the version method
|
||||
else
|
||||
{
|
||||
string version = matcher.GetPathVersion(files) ?? "Unknown Version";
|
||||
matchedProtections.Add($"{matcher.ProtectionName ?? "Unknown Protection"} {version}");
|
||||
// A null version returned means the check didn't pass at the version step
|
||||
string version = matcher.GetVersion(firstMatchedString, files);
|
||||
if (version == null)
|
||||
continue;
|
||||
|
||||
matchedProtections.Add($"{matcher.ProtectionName ?? "Unknown Protection"} {version}".TrimEnd());
|
||||
}
|
||||
|
||||
// If we're stopping after the first protection, bail out here
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BurnOutSharp.Matching
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for a single set of matching criteria
|
||||
/// </summary>
|
||||
internal class Matcher
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of all content matches
|
||||
/// </summary>
|
||||
public IEnumerable<ContentMatch> ContentMatches { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Function to get a content version for this Matcher
|
||||
/// </summary>
|
||||
public Func<string, byte[], List<int>, string> GetContentVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set of all path matches
|
||||
/// </summary>
|
||||
public IEnumerable<PathMatch> PathMatches { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Function to get a path version for this Matcher
|
||||
/// </summary>
|
||||
public Func<List<string>, string> GetPathVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the protection to show
|
||||
/// </summary>
|
||||
public string ProtectionName { get; set; }
|
||||
|
||||
#region ContentMatch Constructors
|
||||
|
||||
public Matcher(byte?[] needle, string protectionName)
|
||||
: this(new List<byte?[]> { needle }, null, protectionName) { }
|
||||
|
||||
public Matcher(List<byte?[]> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public Matcher(byte?[] needle, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
: this(new List<byte?[]> { needle }, getVersion, protectionName) { }
|
||||
|
||||
public Matcher(List<byte?[]> needles, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
: this(needles.Select(n => new ContentMatch(n)).ToList(), getVersion, protectionName) { }
|
||||
|
||||
public Matcher(ContentMatch needle, string protectionName)
|
||||
: this(new List<ContentMatch>() { needle }, null, protectionName) { }
|
||||
|
||||
public Matcher(List<ContentMatch> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public Matcher(ContentMatch needle, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
: this(new List<ContentMatch>() { needle }, getVersion, protectionName) { }
|
||||
|
||||
public Matcher(List<ContentMatch> needles, Func<string, byte[], List<int>, string> getVersion, string protectionName)
|
||||
{
|
||||
ContentMatches = needles;
|
||||
GetContentVersion = getVersion;
|
||||
ProtectionName = protectionName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PathMatch Constructors
|
||||
|
||||
public Matcher(string needle, string protectionName)
|
||||
: this(new List<string> { needle }, null, protectionName) { }
|
||||
|
||||
public Matcher(List<string> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public Matcher(string needle, Func<List<string>, string> getVersion, string protectionName)
|
||||
: this(new List<string> { needle }, getVersion, protectionName) { }
|
||||
|
||||
public Matcher(List<string> needles, Func<List<string>, string> getVersion, string protectionName)
|
||||
: this(needles.Select(n => new PathMatch(n)).ToList(), getVersion, protectionName) { }
|
||||
|
||||
public Matcher(PathMatch needle, string protectionName)
|
||||
: this(new List<PathMatch>() { needle }, null, protectionName) { }
|
||||
|
||||
public Matcher(List<PathMatch> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public Matcher(PathMatch needle, Func<List<string>, string> getVersion, string protectionName)
|
||||
: this(new List<PathMatch>() { needle }, getVersion, protectionName) { }
|
||||
|
||||
public Matcher(List<PathMatch> needles, Func<List<string>, string> getVersion, string protectionName)
|
||||
{
|
||||
PathMatches = needles;
|
||||
GetPathVersion = getVersion;
|
||||
ProtectionName = protectionName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Matching
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether all content matches pass
|
||||
/// </summary>
|
||||
/// <param name="fileContent">Byte array representing the file contents</param>
|
||||
/// <returns>Tuple of passing status and matching positions</returns>
|
||||
public (bool, List<int>) MatchesAll(byte[] fileContent)
|
||||
{
|
||||
// If no content matches are defined, we fail out
|
||||
if (ContentMatches == null || !ContentMatches.Any())
|
||||
return (false, null);
|
||||
|
||||
// Initialize the position list
|
||||
List<int> positions = new List<int>();
|
||||
|
||||
// Loop through all content matches and make sure all pass
|
||||
foreach (var contentMatch in ContentMatches)
|
||||
{
|
||||
(bool match, int position) = contentMatch.Match(fileContent);
|
||||
if (!match)
|
||||
return (false, null);
|
||||
else
|
||||
positions.Add(position);
|
||||
}
|
||||
|
||||
return (true, positions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether all content matches pass
|
||||
/// </summary>
|
||||
/// <param name="stack">List of strings to try to match</param>
|
||||
/// <returns>Tuple of passing status and matching values</returns>
|
||||
public (bool, List<string>) MatchesAll(List<string> stack)
|
||||
{
|
||||
// If no path matches are defined, we fail out
|
||||
if (PathMatches == null || !PathMatches.Any())
|
||||
return (false, null);
|
||||
|
||||
// Initialize the value list
|
||||
List<string> values = new List<string>();
|
||||
|
||||
// Loop through all path matches and make sure all pass
|
||||
foreach (var pathMatch in PathMatches)
|
||||
{
|
||||
(bool match, string value) = pathMatch.Match(stack);
|
||||
if (!match)
|
||||
return (false, null);
|
||||
else
|
||||
values.Add(value);
|
||||
}
|
||||
|
||||
return (true, values);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether any content matches pass
|
||||
/// </summary>
|
||||
/// <param name="stack">List of strings to try to match</param>
|
||||
/// <returns>Tuple of passing status and matching values</returns>
|
||||
public (bool, string) MatchesAny(List<string> stack)
|
||||
{
|
||||
// If no path matches are defined, we fail out
|
||||
if (PathMatches == null || !PathMatches.Any())
|
||||
return (false, null);
|
||||
|
||||
// Loop through all path matches and make sure all pass
|
||||
foreach (var pathMatch in PathMatches)
|
||||
{
|
||||
(bool match, string value) = pathMatch.Match(stack);
|
||||
if (match)
|
||||
return (true, value);
|
||||
}
|
||||
|
||||
return (false, null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ namespace BurnOutSharp.Matching
|
||||
/// <summary>
|
||||
/// Path matching criteria
|
||||
/// </summary>
|
||||
internal class PathMatch
|
||||
internal class PathMatch : IMatch<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// String to match
|
||||
@@ -22,6 +22,12 @@ namespace BurnOutSharp.Matching
|
||||
/// </summary>
|
||||
public bool UseEndsWith { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="needle">String representing the search</param>
|
||||
/// <param name="matchExact">True to match exact casing, false otherwise</param>
|
||||
/// <param name="useEndsWith">True to match the end only, false for all contents</param>
|
||||
public PathMatch(string needle, bool matchExact = false, bool useEndsWith = false)
|
||||
{
|
||||
Needle = needle;
|
||||
@@ -35,6 +41,7 @@ namespace BurnOutSharp.Matching
|
||||
/// Get if this match can be found in a stack
|
||||
/// </summary>
|
||||
/// <param name="stack">List of strings to search for the given content</param>
|
||||
/// <returns>Tuple of success and matched item</returns>
|
||||
public (bool, string) Match(List<string> stack)
|
||||
{
|
||||
// If either array is null or empty, we can't do anything
|
||||
@@ -46,7 +53,7 @@ namespace BurnOutSharp.Matching
|
||||
|
||||
foreach (string stackItem in stack)
|
||||
{
|
||||
// Preprocess the stack item, ir necessary
|
||||
// Preprocess the stack item, if necessary
|
||||
string procStackItem = MatchExact ? stackItem : stackItem.ToLowerInvariant();
|
||||
|
||||
if (UseEndsWith && procStackItem.EndsWith(procNeedle))
|
||||
|
||||
108
BurnOutSharp/Matching/PathMatchSet.cs
Normal file
108
BurnOutSharp/Matching/PathMatchSet.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BurnOutSharp.Matching
|
||||
{
|
||||
/// <summary>
|
||||
/// A set of path matches that work together
|
||||
/// </summary>
|
||||
internal class PathMatchSet : MatchSet<PathMatch, string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Function to get a path version for this Matcher
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A path version method takes the matched path and a list of files
|
||||
/// and returns a single string. That string is either a version string,
|
||||
/// in which case it will be appended to the protection name, or `null`,
|
||||
/// in which case it will cause the protection to be omitted.
|
||||
/// </remarks>
|
||||
public Func<string, List<string>, string> GetVersion { get; set; }
|
||||
|
||||
#region Constructors
|
||||
|
||||
public PathMatchSet(string needle, string protectionName)
|
||||
: this(new List<string> { needle }, null, protectionName) { }
|
||||
|
||||
public PathMatchSet(List<string> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public PathMatchSet(string needle, Func<string, List<string>, string> getVersion, string protectionName)
|
||||
: this(new List<string> { needle }, getVersion, protectionName) { }
|
||||
|
||||
public PathMatchSet(List<string> needles, Func<string, List<string>, string> getVersion, string protectionName)
|
||||
: this(needles.Select(n => new PathMatch(n)).ToList(), getVersion, protectionName) { }
|
||||
|
||||
public PathMatchSet(PathMatch needle, string protectionName)
|
||||
: this(new List<PathMatch>() { needle }, null, protectionName) { }
|
||||
|
||||
public PathMatchSet(List<PathMatch> needles, string protectionName)
|
||||
: this(needles, null, protectionName) { }
|
||||
|
||||
public PathMatchSet(PathMatch needle, Func<string, List<string>, string> getVersion, string protectionName)
|
||||
: this(new List<PathMatch>() { needle }, getVersion, protectionName) { }
|
||||
|
||||
public PathMatchSet(List<PathMatch> needles, Func<string, List<string>, string> getVersion, string protectionName)
|
||||
{
|
||||
Matchers = needles;
|
||||
GetVersion = getVersion;
|
||||
ProtectionName = protectionName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Matching
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether all path matches pass
|
||||
/// </summary>
|
||||
/// <param name="stack">List of strings to try to match</param>
|
||||
/// <returns>Tuple of passing status and matching values</returns>
|
||||
public (bool, List<string>) MatchesAll(List<string> stack)
|
||||
{
|
||||
// If no path matches are defined, we fail out
|
||||
if (Matchers == null || !Matchers.Any())
|
||||
return (false, null);
|
||||
|
||||
// Initialize the value list
|
||||
List<string> values = new List<string>();
|
||||
|
||||
// Loop through all path matches and make sure all pass
|
||||
foreach (var pathMatch in Matchers)
|
||||
{
|
||||
(bool match, string value) = pathMatch.Match(stack);
|
||||
if (!match)
|
||||
return (false, null);
|
||||
else
|
||||
values.Add(value);
|
||||
}
|
||||
|
||||
return (true, values);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether any path matches pass
|
||||
/// </summary>
|
||||
/// <param name="stack">List of strings to try to match</param>
|
||||
/// <returns>Tuple of passing status and first matching value</returns>
|
||||
public (bool, string) MatchesAny(List<string> stack)
|
||||
{
|
||||
// If no path matches are defined, we fail out
|
||||
if (Matchers == null || !Matchers.Any())
|
||||
return (false, null);
|
||||
|
||||
// Loop through all path matches and make sure all pass
|
||||
foreach (var pathMatch in Matchers)
|
||||
{
|
||||
(bool match, string value) = pathMatch.Match(stack);
|
||||
if (match)
|
||||
return (true, value);
|
||||
}
|
||||
|
||||
return (false, null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Software\Caphyon\Advanced Installer
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
|
||||
0x5C, 0x43, 0x61, 0x70, 0x68, 0x79, 0x6F, 0x6E,
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// .nicode + (char)0x00
|
||||
new Matcher(new byte?[] { 0x2E, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0x00 }, "Armadillo"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0x00 }, "Armadillo"),
|
||||
|
||||
// ARMDEBUG
|
||||
new Matcher(new byte?[] { 0x41, 0x52, 0x4D, 0x44, 0x45, 0x42, 0x55, 0x47 }, "Armadillo"),
|
||||
new ContentMatchSet(new byte?[] { 0x41, 0x52, 0x4D, 0x44, 0x45, 0x42, 0x55, 0x47 }, "Armadillo"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// %Wo<57>a6.<2E>a6.<2E>a6.<2E>a6.<2E>{6.<2E>.).<2E>f6.<2E><>).<2E>`6.<2E><>0.<2E>`6.<2E>
|
||||
new Matcher(
|
||||
new ContentMatchSet(
|
||||
new ContentMatch(new byte?[]
|
||||
{
|
||||
0x25, 0x57, 0x6F, 0xC1, 0x61, 0x36, 0x01, 0x92,
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// ??[[__[[_ + (char)0x00 + {{ + (char)0x0 + (char)0x00 + {{ + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x0 + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00 + ?;??;??
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x3F, 0x3F, 0x5B, 0x5B, 0x5F, 0x5F, 0x5B, 0x5B,
|
||||
0x5F, 0x00, 0x7B, 0x7B, 0x00, 0x00, 0x7B, 0x7B,
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Inno
|
||||
new Matcher(
|
||||
new ContentMatchSet(
|
||||
new ContentMatch(new byte?[] { 0x49, 0x6E, 0x6E, 0x6F }, start: 0x30, end: 0x31),
|
||||
GetVersion,
|
||||
"Inno Setup"),
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Nullsoft Install System
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x6f, 0x66, 0x74,
|
||||
0x20, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c,
|
||||
@@ -22,7 +22,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, GetVersion, "NSIS"),
|
||||
|
||||
// NullsoftInst
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x6f, 0x66, 0x74,
|
||||
0x49, 0x6e, 0x73, 0x74
|
||||
|
||||
@@ -11,16 +11,16 @@ namespace BurnOutSharp.PackerType
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
// Another possible version string for version 1 is "PECO" (50 45 43 4F)
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// pec1
|
||||
new Matcher(new byte?[] { 0x70, 0x65, 0x63, 0x31 }, "PE Compact 1"),
|
||||
new ContentMatchSet(new byte?[] { 0x70, 0x65, 0x63, 0x31 }, "PE Compact 1"),
|
||||
|
||||
// PEC2
|
||||
new Matcher(new byte?[] { 0x50, 0x45, 0x43, 0x32 }, GetVersion, "PE Compact 2"),
|
||||
new ContentMatchSet(new byte?[] { 0x50, 0x45, 0x43, 0x32 }, GetVersion, "PE Compact 2"),
|
||||
|
||||
// PECompact2
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x50, 0x45, 0x43, 0x6F, 0x6D, 0x70, 0x61, 0x63,
|
||||
0x74, 0x32
|
||||
|
||||
@@ -12,10 +12,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// S.e.t.u.p. .F.a.c.t.o.r.y.
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x53, 0x00, 0x65, 0x00, 0x74, 0x00, 0x75, 0x00,
|
||||
0x70, 0x00, 0x20, 0x00, 0x46, 0x00, 0x61, 0x00,
|
||||
@@ -25,7 +25,7 @@ namespace BurnOutSharp.PackerType
|
||||
|
||||
// Longer version of the check that can be used if false positves become an issue:
|
||||
// S.e.t.u.p. .F.a.c.t.o.r.y. .i.s. .a. .t.r.a.d.e.m.a.r.k. .o.f. .I.n.d.i.g.o. .R.o.s.e. .C.o.r.p.o.r.a.t.i.o.n.
|
||||
// new Matcher(new byte?[]
|
||||
// new ContentMatchSet(new byte?[]
|
||||
// {
|
||||
// 0x53, 0x00, 0x65, 0x00, 0x74, 0x00, 0x75, 0x00,
|
||||
// 0x70, 0x00, 0x20, 0x00, 0x46, 0x00, 0x61, 0x00,
|
||||
|
||||
@@ -9,15 +9,15 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// UPX!
|
||||
new Matcher(new byte?[] { 0x55, 0x50, 0x58, 0x21 }, GetVersion, "UPX"),
|
||||
new ContentMatchSet(new byte?[] { 0x55, 0x50, 0x58, 0x21 }, GetVersion, "UPX"),
|
||||
|
||||
// NOS
|
||||
new Matcher(new byte?[] { 0x4E, 0x4F, 0x53, 0x20 }, GetVersion, "UPX (NOS Variant)"),
|
||||
new ContentMatchSet(new byte?[] { 0x4E, 0x4F, 0x53, 0x20 }, GetVersion, "UPX (NOS Variant)"),
|
||||
|
||||
new Matcher(
|
||||
new ContentMatchSet(
|
||||
new List<byte?[]>
|
||||
{
|
||||
// UPX0
|
||||
@@ -29,7 +29,7 @@ namespace BurnOutSharp.PackerType
|
||||
"UPX (Unknown Version)"
|
||||
),
|
||||
|
||||
new Matcher(
|
||||
new ContentMatchSet(
|
||||
new List<byte?[]>
|
||||
{
|
||||
// NOS0
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Software\WinRAR SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
|
||||
0x5C, 0x57, 0x69, 0x6E, 0x52, 0x41, 0x52, 0x20,
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// WinZip Self-Extractor
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x57, 0x69, 0x6E, 0x5A, 0x69, 0x70, 0x20, 0x53,
|
||||
0x65, 0x6C, 0x66, 0x2D, 0x45, 0x78, 0x74, 0x72,
|
||||
@@ -26,7 +26,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, GetVersion, "WinZip SFX"),
|
||||
|
||||
// _winzip_
|
||||
new Matcher(new byte?[] { 0x5F, 0x77, 0x69, 0x6E, 0x7A, 0x69, 0x70, 0x5F }, GetVersion, "WinZip SFX"),
|
||||
new ContentMatchSet(new byte?[] { 0x5F, 0x77, 0x69, 0x6E, 0x7A, 0x69, 0x70, 0x5F }, GetVersion, "WinZip SFX"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
@@ -105,11 +105,11 @@ namespace BurnOutSharp.PackerType
|
||||
|
||||
private static string GetV2Version(string file, byte[] fileContent)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
#region 16-bit NE Header Checks
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x86, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -121,7 +121,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "2.0 (MS-DOS/16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x86, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -133,7 +133,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "2.0 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x80, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -145,7 +145,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "Compact 2.0 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0xCD, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x00,
|
||||
@@ -157,7 +157,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "Software Installation 2.0 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x86, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -169,7 +169,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "2.1 RC2 (MS-DOS/16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0xBE, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x00,
|
||||
@@ -181,7 +181,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "2.1 RC2 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x80, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -193,7 +193,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "Compact 2.1 RC2 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0xBE, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x00,
|
||||
@@ -205,7 +205,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "Software Installation 2.1 RC2 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x86, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -217,7 +217,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "2.1 (MS-DOS/16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0xBE, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x00,
|
||||
@@ -229,7 +229,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "2.1 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0x80, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x03, 0x00,
|
||||
@@ -241,7 +241,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
||||
}, "Compact 2.1 (16-bit)"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4E, 0x45, 0x11, 0x20, 0xBE, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x00,
|
||||
@@ -258,7 +258,7 @@ namespace BurnOutSharp.PackerType
|
||||
#region 32-bit SFX Header Checks
|
||||
|
||||
// .............8<EFBFBD>92....<2E>P..............<2E>P..<2E>P..<2E>P..VW95SE.SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9C, 0x39,
|
||||
@@ -271,7 +271,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, "2.0 (32-bit)"),
|
||||
|
||||
// .............]<5D>92....<2E>P..............<2E>P..<2E>P..<2E>P..VW95SRE.SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x9C, 0x39,
|
||||
@@ -284,7 +284,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, "Software Installation 2.0 (32-bit)"),
|
||||
|
||||
// .............<2E><><EFBFBD>3....<2E>P..............<2E>P..<2E>P..<2E>P..VW95SE.SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x82, 0x94,
|
||||
@@ -297,7 +297,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, "2.1 RC2 (32-bit)"),
|
||||
|
||||
// .............<2E><><EFBFBD>3....<2E>P..............<2E>P..<2E>P..<2E>P..VW95SRE.SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x82, 0x94,
|
||||
@@ -310,7 +310,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, "Software Installation 2.1 RC2 (32-bit)"),
|
||||
|
||||
// .............U<><55>3....<2E>P..............<2E>P..<2E>P..<2E>P..VW95SE.SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xCD, 0xCC,
|
||||
@@ -323,7 +323,7 @@ namespace BurnOutSharp.PackerType
|
||||
}, "2.1 (32-bit)"),
|
||||
|
||||
// .............{<7B><>3....<2E>P..............<2E>P..<2E>P..<2E>P..VW95SRE.SFX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x7B, 0xCD, 0xCC,
|
||||
@@ -339,7 +339,7 @@ namespace BurnOutSharp.PackerType
|
||||
|
||||
#region 32-bit PE Header Checks
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x50, 0x45, 0x00, 0x00, 0x4C, 0x01, 0x05, 0x00,
|
||||
0x69, 0x1B, 0x5B, 0x3A, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -350,7 +350,7 @@ namespace BurnOutSharp.PackerType
|
||||
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
|
||||
}, "2.2.4003"),
|
||||
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x50, 0x45, 0x00, 0x00, 0x4C, 0x01, 0x05, 0x00,
|
||||
0x81, 0x1B, 0x5B, 0x3A, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// WiseMain
|
||||
new Matcher(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"),
|
||||
new ContentMatchSet(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.PackerType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// DotfuscatorAttribute
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x44, 0x6F, 0x74, 0x66, 0x75, 0x73, 0x63, 0x61,
|
||||
0x74, 0x6F, 0x72, 0x41, 0x74, 0x74, 0x72, 0x69,
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// TMSAMVOF
|
||||
new Matcher(new byte?[] { 0x54, 0x4D, 0x53, 0x41, 0x4D, 0x56, 0x4F, 0x46 }, "ActiveMARK"),
|
||||
new ContentMatchSet(new byte?[] { 0x54, 0x4D, 0x53, 0x41, 0x4D, 0x56, 0x4F, 0x46 }, "ActiveMARK"),
|
||||
|
||||
// " " + (char)0xC2 + (char)0x16 + (char)0x00 + (char)0xA8 + (char)0xC1 + (char)0x16 + (char)0x00 + (char)0xB8 + (char)0xC1 + (char)0x16 + (char)0x00 + (char)0x86 + (char)0xC8 + (char)0x16 + (char)0x00 + (char)0x9A + (char)0xC1 + (char)0x16 + (char)0x00 + (char)0x10 + (char)0xC2 + (char)0x16 + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x20, 0xC2, 0x16, 0x00, 0xA8, 0xC1, 0x16, 0x00,
|
||||
0xB8, 0xC1, 0x16, 0x00, 0x86, 0xC8, 0x16, 0x00,
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// SETTEC
|
||||
new Matcher(new byte?[] { 0x53, 0x45, 0x54, 0x54, 0x45, 0x43 }, "Alpha-ROM"),
|
||||
new ContentMatchSet(new byte?[] { 0x53, 0x45, 0x54, 0x54, 0x45, 0x43 }, "Alpha-ROM"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -8,17 +8,17 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// MGS CDCheck
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4D, 0x47, 0x53, 0x20, 0x43, 0x44, 0x43, 0x68,
|
||||
0x65, 0x63, 0x6B
|
||||
}, "Microsoft Game Studios CD Check"),
|
||||
|
||||
// CDCheck
|
||||
new Matcher(new byte?[] { 0x43, 0x44, 0x43, 0x68, 0x65, 0x63, 0x6B }, "Executable-Based CD Check"),
|
||||
new ContentMatchSet(new byte?[] { 0x43, 0x44, 0x43, 0x68, 0x65, 0x63, 0x6B }, "Executable-Based CD Check"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
@@ -27,17 +27,17 @@ namespace BurnOutSharp.ProtectionType
|
||||
// These content checks are too broad to be useful
|
||||
private static string CheckContentsBroad(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// GetDriveType
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x47, 0x65, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65,
|
||||
0x54, 0x79, 0x70, 0x65
|
||||
}, "Executable-Based CD Check"),
|
||||
|
||||
// GetVolumeInformation
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x47, 0x65, 0x74, 0x56, 0x6F, 0x6C, 0x75, 0x6D,
|
||||
0x65, 0x49, 0x6E, 0x66, 0x6F, 0x72, 0x6D, 0x61,
|
||||
|
||||
@@ -11,17 +11,17 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// CD-Cops, ver.
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x43, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C,
|
||||
0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20
|
||||
}, GetVersion, "CD-Cops"),
|
||||
|
||||
// .grand + (char)0x00
|
||||
new Matcher(new byte?[] { 0x2E, 0x67, 0x72, 0x61, 0x6E, 0x64, 0x00 }, "CD-Cops"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x67, 0x72, 0x61, 0x6E, 0x64, 0x00 }, "CD-Cops"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// 2 + (char)0xF2 + (char)0x02 + (char)0x82 + (char)0xC3 + (char)0xBC + (char)0x0B + $ + (char)0x99 + (char)0xAD + 'C + (char)0xE4 + (char)0x9D + st + (char)0x99 + (char)0xFA + 2$ + (char)0x9D + )4 + (char)0xFF + t
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x32, 0xF2, 0x02, 0x82, 0xC3, 0xBC, 0x0B, 0x24,
|
||||
0x99, 0xAD, 0x27, 0x43, 0xE4, 0x9D, 0x73, 0x74,
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// ~0017.tmp
|
||||
new Matcher(new byte?[] { 0x7E, 0x30, 0x30, 0x31, 0x37, 0x2E, 0x74, 0x6D, 0x70 }, "CDSHiELD SE"),
|
||||
new ContentMatchSet(new byte?[] { 0x7E, 0x30, 0x30, 0x31, 0x37, 0x2E, 0x74, 0x6D, 0x70 }, "CDSHiELD SE"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -12,16 +12,16 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// DATA.CDS
|
||||
new Matcher(new byte?[] { 0x44, 0x41, 0x54, 0x41, 0x2E, 0x43, 0x44, 0x53 }, "Cactus Data Shield 200"),
|
||||
new ContentMatchSet(new byte?[] { 0x44, 0x41, 0x54, 0x41, 0x2E, 0x43, 0x44, 0x53 }, "Cactus Data Shield 200"),
|
||||
|
||||
// \*.CDS
|
||||
new Matcher(new byte?[] { 0x5C, 0x2A, 0x2E, 0x43, 0x44, 0x53 }, "Cactus Data Shield 200"),
|
||||
new ContentMatchSet(new byte?[] { 0x5C, 0x2A, 0x2E, 0x43, 0x44, 0x53 }, "Cactus Data Shield 200"),
|
||||
|
||||
// CDSPlayer
|
||||
new Matcher(new byte?[] { 0x43, 0x44, 0x53, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72 }, "Cactus Data Shield 200"),
|
||||
new ContentMatchSet(new byte?[] { 0x43, 0x44, 0x53, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72 }, "Cactus Data Shield 200"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// .cenega
|
||||
new Matcher(new byte?[] { 0x2E, 0x63, 0x65, 0x6E, 0x65, 0x67, 0x61 }, "Cenega ProtectDVD"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x63, 0x65, 0x6E, 0x65, 0x67, 0x61 }, "Cenega ProtectDVD"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -9,16 +9,16 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// icd1 + (char)0x00
|
||||
new Matcher(new byte?[] { 0x69, 0x63, 0x64, 0x31, 0x00 }, "Code Lock"),
|
||||
new ContentMatchSet(new byte?[] { 0x69, 0x63, 0x64, 0x31, 0x00 }, "Code Lock"),
|
||||
|
||||
// icd2 + (char)0x00
|
||||
new Matcher(new byte?[] { 0x69, 0x63, 0x64, 0x32, 0x00 }, "Code Lock"),
|
||||
new ContentMatchSet(new byte?[] { 0x69, 0x63, 0x64, 0x32, 0x00 }, "Code Lock"),
|
||||
|
||||
// CODE-LOCK.OCX
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x43, 0x4F, 0x44, 0x45, 0x2D, 0x4C, 0x4F, 0x43,
|
||||
0x4B, 0x2E, 0x4F, 0x43, 0x58
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Tom Commander
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x54, 0x6F, 0x6D, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
|
||||
0x61, 0x6E, 0x64, 0x65, 0x72
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// DVD-Cops, ver.
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x44, 0x56, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73,
|
||||
0x2C, 0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// EASTL
|
||||
//new Matcher(new byte?[] { 0x45, 0x41, 0x53, 0x54, 0x4C }, "Cucko (EA Custom)"),
|
||||
//new ContentMatchSet(new byte?[] { 0x45, 0x41, 0x53, 0x54, 0x4C }, "Cucko (EA Custom)"),
|
||||
|
||||
// R + (char)0x00 + e + (char)0x00 + g + (char)0x00 + i + (char)0x00 + s + (char)0x00 + t + (char)0x00 + r + (char)0x00 + a + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + C + (char)0x00 + o + (char)0x00 + d + (char)0x00 + e + (char)0x00 + + (char)0x00 + i + (char)0x00 + n + (char)0x00 + s + (char)0x00 + t + (char)0x00 + a + (char)0x00 + l + (char)0x00 + l + (char)0x00 + e + (char)0x00 + r + (char)0x00 + + (char)0x00 + p + (char)0x00 + r + (char)0x00 + o + (char)0x00 + g + (char)0x00 + r + (char)0x00 + a + (char)0x00 + m + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x69, 0x00,
|
||||
0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x61, 0x00,
|
||||
@@ -32,7 +32,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// R + (char)0x00 + e + (char)0x00 + g + (char)0x00 + i + (char)0x00 + s + (char)0x00 + t + (char)0x00 + r + (char)0x00 + a + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + c + (char)0x00 + o + (char)0x00 + d + (char)0x00 + e + (char)0x00 + + (char)0x00 + i + (char)0x00 + n + (char)0x00 + s + (char)0x00 + t + (char)0x00 + a + (char)0x00 + l + (char)0x00 + l + (char)0x00 + e + (char)0x00 + r + (char)0x00 + + (char)0x00 + p + (char)0x00 + r + (char)0x00 + o + (char)0x00 + g + (char)0x00 + r + (char)0x00 + a + (char)0x00 + m + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x69, 0x00,
|
||||
0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x61, 0x00,
|
||||
@@ -46,7 +46,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// A + (char)0x00 + b + (char)0x00 + o + (char)0x00 + u + (char)0x00 + t + (char)0x00 + + (char)0x00 + C + (char)0x00 + D + (char)0x00 + K + (char)0x00 + e + (char)0x00 + y + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x41, 0x00, 0x62, 0x00, 0x6F, 0x00, 0x75, 0x00,
|
||||
0x74, 0x00, 0x20, 0x00, 0x43, 0x00, 0x44, 0x00,
|
||||
@@ -54,7 +54,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// I + (char)0x00 + n + (char)0x00 + t + (char)0x00 + e + (char)0x00 + r + (char)0x00 + n + (char)0x00 + a + (char)0x00 + l + (char)0x00 + N + (char)0x00 + a + (char)0x00 + m + (char)0x00 + e + (char)0x00 + + (char)0x00 + + (char)0x00 + C + (char)0x00 + D + (char)0x00 + K + (char)0x00 + e + (char)0x00 + y + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x49, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x65, 0x00,
|
||||
0x72, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
@@ -64,7 +64,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// I + (char)0x00 + n + (char)0x00 + t + (char)0x00 + e + (char)0x00 + r + (char)0x00 + n + (char)0x00 + a + (char)0x00 + l + (char)0x00 + N + (char)0x00 + a + (char)0x00 + m + (char)0x00 + e + (char)0x00 + + (char)0x00 + + (char)0x00 + C + (char)0x00 + D + (char)0x00 + C + (char)0x00 + o + (char)0x00 + d + (char)0x00 + e + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x49, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x65, 0x00,
|
||||
0x72, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
@@ -74,14 +74,14 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// EReg Config Form
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x45, 0x52, 0x65, 0x67, 0x20, 0x43, 0x6F, 0x6E,
|
||||
0x66, 0x69, 0x67, 0x20, 0x46, 0x6F, 0x72, 0x6D
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// ereg.ea-europe.com
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x65, 0x72, 0x65, 0x67, 0x2E, 0x65, 0x61, 0x2D,
|
||||
0x65, 0x75, 0x72, 0x6F, 0x70, 0x65, 0x2E, 0x63,
|
||||
@@ -89,7 +89,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// GenericEA + (char)0x00 + (char)0x00 + (char)0x00 + Activation
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x47, 0x65, 0x6E, 0x65, 0x72, 0x69, 0x63, 0x45,
|
||||
0x41, 0x00, 0x00, 0x00, 0x41, 0x63, 0x74, 0x69,
|
||||
@@ -97,7 +97,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, "EA DRM Protection"),
|
||||
|
||||
// E + (char)0x00 + A + (char)0x00 + + (char)0x00 + D + (char)0x00 + R + (char)0x00 + M + (char)0x00 + + (char)0x00 + H + (char)0x00 + e + (char)0x00 + l + (char)0x00 + p + (char)0x00 + e + (char)0x00 + r + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x45, 0x00, 0x41, 0x00, 0x20, 0x00, 0x44, 0x00,
|
||||
0x52, 0x00, 0x4D, 0x00, 0x20, 0x00, 0x48, 0x00,
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// xlive.dll
|
||||
new Matcher(new byte?[] { 0x78, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x64, 0x6C, 0x6C }, "Games for Windows - Live"),
|
||||
new ContentMatchSet(new byte?[] { 0x78, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x64, 0x6C, 0x6C }, "Games for Windows - Live"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
new Matcher(new List<byte?[]>
|
||||
new ContentMatchSet(new List<byte?[]>
|
||||
{
|
||||
// CVPInitializeClient
|
||||
new byte?[]
|
||||
@@ -36,7 +36,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "Impulse Reactor"),
|
||||
|
||||
// CVPInitializeClient
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x43, 0x56, 0x50, 0x49, 0x6E, 0x69, 0x74, 0x69,
|
||||
0x61, 0x6C, 0x69, 0x7A, 0x65, 0x43, 0x6C, 0x69,
|
||||
|
||||
@@ -24,10 +24,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Trial + (char)0x00 + P
|
||||
new Matcher(new byte?[] { 0x54, 0x72, 0x69, 0x61, 0x6C, 0x00, 0x50 }, "INTENIUM Trial & Buy Protection"),
|
||||
new ContentMatchSet(new byte?[] { 0x54, 0x72, 0x69, 0x61, 0x6C, 0x00, 0x50 }, "INTENIUM Trial & Buy Protection"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// @HC09
|
||||
new Matcher(new byte?[] { 0x40, 0x48, 0x43, 0x30, 0x39, 0x20, 0x20, 0x20, 0x20 }, "JoWooD X-Prot v2"),
|
||||
new ContentMatchSet(new byte?[] { 0x40, 0x48, 0x43, 0x30, 0x39, 0x20, 0x20, 0x20, 0x20 }, "JoWooD X-Prot v2"),
|
||||
|
||||
new Matcher(new List<byte?[]>
|
||||
new ContentMatchSet(new List<byte?[]>
|
||||
{
|
||||
// .ext
|
||||
new byte?[] { 0x2E, 0x65, 0x78, 0x74, 0x20, 0x20, 0x20, 0x20 },
|
||||
@@ -31,7 +31,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetVersion, "JoWooD X-Prot"),
|
||||
|
||||
// .ext
|
||||
new Matcher(new byte?[] { 0x2E, 0x65, 0x78, 0x74, 0x20, 0x20, 0x20, 0x20 }, "JoWooD X-Prot v1"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x65, 0x78, 0x74, 0x20, 0x20, 0x20, 0x20 }, "JoWooD X-Prot v1"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// KEY-LOCK COMMAND
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4B, 0x45, 0x59, 0x2D, 0x4C, 0x4F, 0x43, 0x4B,
|
||||
0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x41, 0x4E, 0x44
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (file != null && string.Equals(Path.GetFileName(file), "NOMOUSE.SP", StringComparison.OrdinalIgnoreCase))
|
||||
return $"LaserLock {GetVersion16Bit(fileContent)}" + (includePosition ? $" (Index 71)" : string.Empty);
|
||||
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// :\\LASERLOK\\LASERLOK.IN + (char)0x00 + C:\\NOMOUSE.SP
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x3A, 0x5C, 0x5C, 0x4C, 0x41, 0x53, 0x45, 0x52,
|
||||
0x4C, 0x4F, 0x4B, 0x5C, 0x5C, 0x4C, 0x41, 0x53,
|
||||
@@ -43,7 +43,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, "LaserLock 3"),
|
||||
|
||||
// LASERLOK_INIT + (char)0xC + LASERLOK_RUN + (char)0xE + LASERLOK_CHECK + (char)0xF + LASERLOK_CHECK2 + (char)0xF + LASERLOK_CHECK3
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x4C, 0x41, 0x53, 0x45, 0x52, 0x4C, 0x4F, 0x4B,
|
||||
0x5F, 0x49, 0x4E, 0x49, 0x54, 0x0C, 0x4C, 0x41,
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// Cd3Ctl
|
||||
new Matcher(new byte?[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C }, "MediaMax CD-3"),
|
||||
new ContentMatchSet(new byte?[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C }, "MediaMax CD-3"),
|
||||
|
||||
// DllInstallSbcp
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x44, 0x6C, 0x6C, 0x49, 0x6E, 0x73, 0x74, 0x61,
|
||||
0x6C, 0x6C, 0x53, 0x62, 0x63, 0x70
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// I + (char)0x00 + n + (char)0x00 + t + (char)0x00 + e + (char)0x00 + r + (char)0x00 + n + (char)0x00 + a + (char)0x00 + l + (char)0x00 + N + (char)0x00 + a + (char)0x00 + m + (char)0x00 + e + (char)0x00 + + (char)0x00 + + (char)0x00 + E + (char)0x00 + R + (char)0x00 + e + (char)0x00 + g + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x49, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x65, 0x00,
|
||||
0x72, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// O + (char)0x00 + r + (char)0x00 + i + (char)0x00 + g + (char)0x00 + i + (char)0x00 + n + (char)0x00 + S + (char)0x00 + e + (char)0x00 + t + (char)0x00 + u + (char)0x00 + p + (char)0x00 + . + (char)0x00 + e + (char)0x00 + x + (char)0x00 + e + (char)0x00
|
||||
new Matcher(new byte?[] { 0x4F, 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x53, 0x00, 0x65, 0x00, 0x74, 0x00, 0x75, 0x00, 0x70, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00 }, "Origin"),
|
||||
new ContentMatchSet(new byte?[] { 0x4F, 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x53, 0x00, 0x65, 0x00, 0x74, 0x00, 0x75, 0x00, 0x70, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00 }, "Origin"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x4F, 0x46,
|
||||
0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x54, 0x45,
|
||||
@@ -29,7 +29,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, "PlayStation Anti-modchip (English)"),
|
||||
|
||||
// 強制終了しました。\n本体が改造されている\nおそれがあります。
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x5F, 0x37, 0x52, 0x36, 0x7D, 0x42, 0x4E, 0x86,
|
||||
0x30, 0x57, 0x30, 0x7E, 0x30, 0x57, 0x30, 0x5F,
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// HúMETINF
|
||||
new Matcher(new byte?[] { 0x48, 0xFA, 0x4D, 0x45, 0x54, 0x49, 0x4E, 0x46 }, GetVersion76till10, "ProtectDisc"),
|
||||
new ContentMatchSet(new byte?[] { 0x48, 0xFA, 0x4D, 0x45, 0x54, 0x49, 0x4E, 0x46 }, GetVersion76till10, "ProtectDisc"),
|
||||
|
||||
// ACE-PCD
|
||||
new Matcher(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDisc"),
|
||||
new ContentMatchSet(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDisc"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// TODO: Investigate as this may be over-matching
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// (char)0x00 + Allocator + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x00, 0x41, 0x6C, 0x6C, 0x6F, 0x63, 0x61, 0x74,
|
||||
0x6F, 0x72, 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// ?SVKP + (char)0x00 + (char)0x00
|
||||
new Matcher(new byte?[] { 0x3F, 0x53, 0x56, 0x4B, 0x50, 0x00, 0x00 }, "SVK Protector"),
|
||||
new ContentMatchSet(new byte?[] { 0x3F, 0x53, 0x56, 0x4B, 0x50, 0x00, 0x00 }, "SVK Protector"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
new Matcher(new List<byte?[]>
|
||||
new ContentMatchSet(new List<byte?[]>
|
||||
{
|
||||
// BoG_ *90.0&!! Yy>
|
||||
new byte?[]
|
||||
@@ -36,7 +36,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetVersion, "SafeCast"),
|
||||
|
||||
// BoG_ *90.0&!! Yy>
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x42, 0x6F, 0x47, 0x5F, 0x20, 0x2A, 0x39, 0x30,
|
||||
0x2E, 0x30, 0x26, 0x21, 0x21, 0x20, 0x20, 0x59,
|
||||
@@ -44,13 +44,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, "SafeDisc"),
|
||||
|
||||
// (char)0x00 + (char)0x00 + BoG_
|
||||
new Matcher(new byte?[] { 0x00, 0x00, 0x42, 0x6F, 0x47, 0x5F }, Get320to4xVersion, "SafeDisc"),
|
||||
new ContentMatchSet(new byte?[] { 0x00, 0x00, 0x42, 0x6F, 0x47, 0x5F }, Get320to4xVersion, "SafeDisc"),
|
||||
|
||||
// stxt774
|
||||
new Matcher(new byte?[] { 0x73, 0x74, 0x78, 0x74, 0x37, 0x37, 0x34 }, Get320to4xVersion, "SafeDisc"),
|
||||
new ContentMatchSet(new byte?[] { 0x73, 0x74, 0x78, 0x74, 0x37, 0x37, 0x34 }, Get320to4xVersion, "SafeDisc"),
|
||||
|
||||
// stxt371
|
||||
new Matcher(new byte?[] { 0x73, 0x74, 0x78, 0x74, 0x33, 0x37, 0x31 }, Get320to4xVersion, "SafeDisc"),
|
||||
new ContentMatchSet(new byte?[] { 0x73, 0x74, 0x78, 0x74, 0x33, 0x37, 0x31 }, Get320to4xVersion, "SafeDisc"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
@@ -82,7 +82,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
protections.Add("SafeDisc for Macintosh");
|
||||
}
|
||||
|
||||
if (protections.Count() == 0)
|
||||
if (protections.Count == 0)
|
||||
return null;
|
||||
else
|
||||
return string.Join(", ", protections);
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// SafeLock
|
||||
new Matcher(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B }, "SafeLock"),
|
||||
new ContentMatchSet(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B }, "SafeLock"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -12,26 +12,26 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// AddD + (char)0x03 + (char)0x00 + (char)0x00 + (char)0x00)
|
||||
new Matcher(new byte?[] { 0x41, 0x64, 0x64, 0x44, 0x03, 0x00, 0x00, 0x00 }, GetV4Version, "SecuROM"),
|
||||
new ContentMatchSet(new byte?[] { 0x41, 0x64, 0x64, 0x44, 0x03, 0x00, 0x00, 0x00 }, GetV4Version, "SecuROM"),
|
||||
|
||||
// (char)0xCA + (char)0xDD + (char)0xDD + (char)0xAC + (char)0x03
|
||||
new Matcher(new byte?[] { 0xCA, 0xDD, 0xDD, 0xAC, 0x03 }, GetV5Version, "SecuROM"),
|
||||
new ContentMatchSet(new byte?[] { 0xCA, 0xDD, 0xDD, 0xAC, 0x03 }, GetV5Version, "SecuROM"),
|
||||
|
||||
// .securom + (char)0xE0 + (char)0xC0
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x2E, 0x73, 0x65, 0x63, 0x75, 0x72, 0x6F, 0x6D,
|
||||
0xE0, 0xC0
|
||||
}, GetV7Version, "SecuROM"),
|
||||
|
||||
// .securom
|
||||
new Matcher(new byte?[] { 0x2E, 0x73, 0x65, 0x63, 0x75, 0x72, 0x6F, 0x6D }, GetV7Version, "SecuROM"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x73, 0x65, 0x63, 0x75, 0x72, 0x6F, 0x6D }, GetV7Version, "SecuROM"),
|
||||
|
||||
// _and_play.dll + (char)0x00 + drm_pagui_doit
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x5F, 0x61, 0x6E, 0x64, 0x5F, 0x70, 0x6C, 0x61,
|
||||
0x79, 0x2E, 0x64, 0x6C, 0x6C, 0x00, 0x64, 0x72,
|
||||
@@ -40,10 +40,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "SecuROM Product Activation"),
|
||||
|
||||
// .cms_t + (char)0x00
|
||||
new Matcher(new byte?[] { 0x2E, 0x63, 0x6D, 0x73, 0x5F, 0x74, 0x00 }, "SecuROM 1-3"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x63, 0x6D, 0x73, 0x5F, 0x74, 0x00 }, "SecuROM 1-3"),
|
||||
|
||||
// .cms_d + (char)0x00
|
||||
new Matcher(new byte?[] { 0x2E, 0x63, 0x6D, 0x73, 0x5F, 0x64, 0x00 }, "SecuROM 1-3"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x63, 0x6D, 0x73, 0x5F, 0x64, 0x00 }, "SecuROM 1-3"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// BITARTS
|
||||
new Matcher(new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }, "SmartE"),
|
||||
new ContentMatchSet(new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }, "SmartE"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -12,10 +12,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// D + (char)0x00 + V + (char)0x00 + M + (char)0x00 + + (char)0x00 + L + (char)0x00 + i + (char)0x00 + b + (char)0x00 + r + (char)0x00 + a + (char)0x00 + r + (char)0x00 + y + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x44, 0x00, 0x56, 0x00, 0x4D, 0x00, 0x20, 0x00,
|
||||
0x4C, 0x00, 0x69, 0x00, 0x62, 0x00, 0x72, 0x00,
|
||||
@@ -23,7 +23,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "SolidShield"),
|
||||
|
||||
// S + (char)0x00 + o + (char)0x00 + l + (char)0x00 + i + (char)0x00 + d + (char)0x00 + s + (char)0x00 + h + (char)0x00 + i + (char)0x00 + e + (char)0x00 + l + (char)0x00 + d + (char)0x00 + + (char)0x00 + L + (char)0x00 + i + (char)0x00 + b + (char)0x00 + r + (char)0x00 + a + (char)0x00 + r + (char)0x00 + y + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x53, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x69, 0x00,
|
||||
0x64, 0x00, 0x73, 0x00, 0x68, 0x00, 0x69, 0x00,
|
||||
@@ -33,7 +33,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetFileVersion, "SolidShield Core.dll"),
|
||||
|
||||
// S + (char)0x00 + o + (char)0x00 + l + (char)0x00 + i + (char)0x00 + d + (char)0x00 + s + (char)0x00 + h + (char)0x00 + i + (char)0x00 + e + (char)0x00 + l + (char)0x00 + d + (char)0x00 + + (char)0x00 + A + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + v + (char)0x00 + a + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + L + (char)0x00 + i + (char)0x00 + b + (char)0x00 + r + (char)0x00 + a + (char)0x00 + r + (char)0x00 + y + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x53, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x69, 0x00,
|
||||
0x64, 0x00, 0x73, 0x00, 0x68, 0x00, 0x69, 0x00,
|
||||
@@ -46,10 +46,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetFileVersion, "SolidShield Core.dll"),
|
||||
|
||||
// (char)0xEF + (char)0xBE + (char)0xAD + (char)0xDE
|
||||
new Matcher(new byte?[] { 0xEF, 0xBE, 0xAD, 0xDE }, GetExeWrapperVersion, "SolidShield"),
|
||||
new ContentMatchSet(new byte?[] { 0xEF, 0xBE, 0xAD, 0xDE }, GetExeWrapperVersion, "SolidShield"),
|
||||
|
||||
// A + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + v + (char)0x00 + a + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + M + (char)0x00 + a + (char)0x00 + n + (char)0x00 + a + (char)0x00 + g + (char)0x00 + e + (char)0x00 + r + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x41, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
|
||||
0x76, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00,
|
||||
@@ -59,20 +59,20 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetFileVersion, "SolidShield Activation Manager Module"),
|
||||
|
||||
// dvm.dll
|
||||
new Matcher(new byte?[] { 0x64, 0x76, 0x6D, 0x2E, 0x64, 0x6C, 0x6C }, "SolidShield EXE Wrapper"),
|
||||
new ContentMatchSet(new byte?[] { 0x64, 0x76, 0x6D, 0x2E, 0x64, 0x6C, 0x6C }, "SolidShield EXE Wrapper"),
|
||||
|
||||
// (char)0xAD + (char)0xDE + (char)0xFE + (char)0xCA
|
||||
new Matcher(new byte?[] { 0xAD, 0xDE, 0xFE, 0xCA }, GetVersionPlusTages, "SolidShield"),
|
||||
new ContentMatchSet(new byte?[] { 0xAD, 0xDE, 0xFE, 0xCA }, GetVersionPlusTages, "SolidShield"),
|
||||
|
||||
// Solidshield
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x53, 0x6F, 0x6C, 0x69, 0x64, 0x73, 0x68, 0x69,
|
||||
0x65, 0x6C, 0x64
|
||||
}, GetVersion, "SolidShield"),
|
||||
|
||||
// B + (char)0x00 + I + (char)0x00 + N + (char)0x00 + (char)0x7 + (char)0x00 + I + (char)0x00 + D + (char)0x00 + R + (char)0x00 + _ + (char)0x00 + S + (char)0x00 + G + (char)0x00 + T + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x42, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x07, 0x00,
|
||||
0x49, 0x00, 0x44, 0x00, 0x52, 0x00, 0x5F, 0x00,
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
new Matcher(new List<byte?[]>
|
||||
new ContentMatchSet(new List<byte?[]>
|
||||
{
|
||||
// ( + (char)0x00 + c + (char)0x00 + ) + (char)0x00 + + (char)0x00 + P + (char)0x00 + r + (char)0x00 + o + (char)0x00 + t + (char)0x00 + e + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + T + (char)0x00 + e + (char)0x00 + c + (char)0x00 + h + (char)0x00 + n + (char)0x00 + o + (char)0x00 + l + (char)0x00 + o + (char)0x00 + g + (char)0x00 + y + (char)0x00
|
||||
new byte?[]
|
||||
@@ -48,7 +48,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetVersion, "StarForce"),
|
||||
|
||||
// ( + (char)0x00 + c + (char)0x00 + ) + (char)0x00 + + (char)0x00 + P + (char)0x00 + r + (char)0x00 + o + (char)0x00 + t + (char)0x00 + e + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + T + (char)0x00 + e + (char)0x00 + c + (char)0x00 + h + (char)0x00 + n + (char)0x00 + o + (char)0x00 + l + (char)0x00 + o + (char)0x00 + g + (char)0x00 + y + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x28, 0x00, 0x63, 0x00, 0x29, 0x00, 0x20, 0x00,
|
||||
0x50, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x74, 0x00,
|
||||
@@ -59,7 +59,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
0x79, 0x00
|
||||
}, Utilities.GetFileVersion, "StarForce"),
|
||||
|
||||
new Matcher(new List<byte?[]>
|
||||
new ContentMatchSet(new List<byte?[]>
|
||||
{
|
||||
// Protection Technology, Ltd.
|
||||
new byte?[]
|
||||
@@ -91,7 +91,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, GetVersion, "StarForce"),
|
||||
|
||||
// Protection Technology, Ltd.
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x50, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x69,
|
||||
0x6F, 0x6E, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E,
|
||||
@@ -100,13 +100,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "StarForce"),
|
||||
|
||||
// .sforce
|
||||
new Matcher(new byte?[] { 0x2E, 0x73, 0x66, 0x6F, 0x72, 0x63, 0x65 }, "StarForce 3-5"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x73, 0x66, 0x6F, 0x72, 0x63, 0x65 }, "StarForce 3-5"),
|
||||
|
||||
// .brick
|
||||
new Matcher(new byte?[] { 0x2E, 0x62, 0x72, 0x69, 0x63, 0x6B }, "StarForce 3-5"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x62, 0x72, 0x69, 0x63, 0x6B }, "StarForce 3-5"),
|
||||
|
||||
// P + (char)0x00 + r + (char)0x00 + o + (char)0x00 + t + (char)0x00 + e + (char)0x00 + c + (char)0x00 + t + (char)0x00 + e + (char)0x00 + d + (char)0x00 + + (char)0x00 + M + (char)0x00 + o + (char)0x00 + d + (char)0x00 + u + (char)0x00 + l + (char)0x00 + e + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x50, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x74, 0x00,
|
||||
0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x65, 0x00,
|
||||
|
||||
@@ -8,17 +8,17 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// V SUHPISYSDVD
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x56, 0x20, 0x53, 0x55, 0x48, 0x50, 0x49, 0x53,
|
||||
0x59, 0x53, 0x44, 0x56, 0x44
|
||||
}, GetVersion, "Sysiphus DVD"),
|
||||
|
||||
// V SUHPISYSDVD
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x56, 0x20, 0x53, 0x55, 0x48, 0x50, 0x49, 0x53,
|
||||
0x59, 0x53
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// protected-tages-runtime.exe
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x70, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x65,
|
||||
0x64, 0x2D, 0x74, 0x61, 0x67, 0x65, 0x73, 0x2D,
|
||||
@@ -23,7 +23,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "TAGES"),
|
||||
|
||||
// tagesprotection.com
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x74, 0x61, 0x67, 0x65, 0x73, 0x70, 0x72, 0x6F,
|
||||
0x74, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x2E,
|
||||
@@ -31,7 +31,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}, Utilities.GetFileVersion, "TAGES"),
|
||||
|
||||
// (char)0xE8 + u + (char)0x00 + (char)0x00 + (char)0x00 + (char)0xE8
|
||||
new Matcher(new byte?[] { 0xE8, 0x75, 0x00, 0x00, 0x00, 0xE8 }, GetVersion, "TAGES"),
|
||||
new ContentMatchSet(new byte?[] { 0xE8, 0x75, 0x00, 0x00, 0x00, 0xE8 }, GetVersion, "TAGES"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
@@ -64,7 +64,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
protections.Add("TAGES Setup " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
|
||||
if (protections.Count() == 0)
|
||||
if (protections.Count == 0)
|
||||
return null;
|
||||
else
|
||||
return string.Join(", ", protections);
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
new Matcher(new List<byte?[]>
|
||||
new ContentMatchSet(new List<byte?[]>
|
||||
{
|
||||
// .ldr
|
||||
new byte?[] { 0x2E, 0x6C, 0x64, 0x72 },
|
||||
@@ -21,7 +21,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
|
||||
// This produced false positives in some DirectX 9.0c installer files
|
||||
// "Y" + (char)0xC3 + "U" + (char)0x8B + (char)0xEC + (char)0x83 + (char)0xEC + "0SVW"
|
||||
// new Matcher(new byte?[]
|
||||
// new ContentMatchSet(new byte?[]
|
||||
// {
|
||||
// 0x59, 0xC3, 0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x30,
|
||||
// 0x53, 0x56, 0x57
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// 3 + (char)0x00 + 1 + 2 + (char)0x00 + 1 + (char)0x00 + S + (char)0x00 + t + (char)0x00 + u + (char)0x00 + d + (char)0x00 + i + (char)0x00 + o + (char)0x00 + s + (char)0x00 + + (char)0x00 + A + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + v + (char)0x00 + a + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x33, 0x00, 0x32, 0x00, 0x31, 0x00, 0x53, 0x00,
|
||||
0x74, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00,
|
||||
|
||||
@@ -13,20 +13,20 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// VOB ProtectCD
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x56, 0x4F, 0x42, 0x20, 0x50, 0x72, 0x6F, 0x74,
|
||||
0x65, 0x63, 0x74, 0x43, 0x44
|
||||
}, GetOldVersion, "VOB ProtectCD/DVD"),
|
||||
|
||||
// DCP-BOV + (char)0x00 + (char)0x00
|
||||
new Matcher(new byte?[] { 0x44, 0x43, 0x50, 0x2D, 0x42, 0x4F, 0x56, 0x00, 0x00 }, GetVersion, "VOB ProtectCD/DVD"),
|
||||
new ContentMatchSet(new byte?[] { 0x44, 0x43, 0x50, 0x2D, 0x42, 0x4F, 0x56, 0x00, 0x00 }, GetVersion, "VOB ProtectCD/DVD"),
|
||||
|
||||
// .vob.pcd
|
||||
new Matcher(new byte?[] { 0x2E, 0x76, 0x6F, 0x62, 0x2E, 0x70, 0x63, 0x64 }, "VOB ProtectCD"),
|
||||
new ContentMatchSet(new byte?[] { 0x2E, 0x76, 0x6F, 0x62, 0x2E, 0x70, 0x63, 0x64 }, "VOB ProtectCD"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// WTM76545
|
||||
new Matcher(new byte?[] { 0x57, 0x54, 0x4D, 0x37, 0x36, 0x35, 0x34, 0x35 }, "WTM CD Protect"),
|
||||
new ContentMatchSet(new byte?[] { 0x57, 0x54, 0x4D, 0x37, 0x36, 0x35, 0x34, 0x35 }, "WTM CD Protect"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -12,20 +12,20 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// XCP.DAT
|
||||
new Matcher(new byte?[] { 0x58, 0x43, 0x50, 0x2E, 0x44, 0x41, 0x54 }, "XCP"),
|
||||
new ContentMatchSet(new byte?[] { 0x58, 0x43, 0x50, 0x2E, 0x44, 0x41, 0x54 }, "XCP"),
|
||||
|
||||
// XCPPlugins.dll
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x58, 0x43, 0x50, 0x50, 0x6C, 0x75, 0x67, 0x69,
|
||||
0x6E, 0x73, 0x2E, 0x64, 0x6C, 0x6C
|
||||
}, "XCP"),
|
||||
|
||||
// XCPPhoenix.dll
|
||||
new Matcher(new byte?[]
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x58, 0x43, 0x50, 0x50, 0x68, 0x6F, 0x65, 0x6E,
|
||||
0x69, 0x78, 0x2E, 0x64, 0x6C, 0x6C
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
var matchers = new List<Matcher>
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
// XPROT
|
||||
new Matcher(new byte?[] { 0x58, 0x50, 0x52, 0x4F, 0x54, 0x20, 0x20, 0x20 }, "Xtreme-Protector"),
|
||||
new ContentMatchSet(new byte?[] { 0x58, 0x50, 0x52, 0x4F, 0x54, 0x20, 0x20, 0x20 }, "Xtreme-Protector"),
|
||||
};
|
||||
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace BurnOutSharp
|
||||
Utilities.AppendToDictionary(protections, directoryPathProtections);
|
||||
|
||||
// Scan each file in directory separately
|
||||
for (int i = 0; i < files.Count(); i++)
|
||||
for (int i = 0; i < files.Count; i++)
|
||||
{
|
||||
// Get the current file
|
||||
string file = files.ElementAt(i);
|
||||
@@ -101,7 +101,7 @@ namespace BurnOutSharp
|
||||
reportableFileName = reportableFileName.Substring(tempFilePathWithGuid.Length);
|
||||
|
||||
// Checkpoint
|
||||
FileProgress?.Report(new ProtectionProgress(reportableFileName, i / (float)files.Count(), "Checking file" + (file != reportableFileName ? " from archive" : string.Empty)));
|
||||
FileProgress?.Report(new ProtectionProgress(reportableFileName, i / (float)files.Count, "Checking file" + (file != reportableFileName ? " from archive" : string.Empty)));
|
||||
|
||||
// Scan for path-detectable protections
|
||||
var filePathProtections = GetFilePathProtections(file);
|
||||
@@ -123,7 +123,7 @@ namespace BurnOutSharp
|
||||
// Checkpoint
|
||||
protections.TryGetValue(file, out List<string> fullProtectionList);
|
||||
string fullProtection = (fullProtectionList != null && fullProtectionList.Any() ? string.Join(", ", fullProtectionList) : null);
|
||||
FileProgress?.Report(new ProtectionProgress(reportableFileName, (i + 1) / (float)files.Count(), fullProtection ?? string.Empty));
|
||||
FileProgress?.Report(new ProtectionProgress(reportableFileName, (i + 1) / (float)files.Count, fullProtection ?? string.Empty));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ namespace BurnOutSharp
|
||||
/// <summary>
|
||||
/// Initialize all IPathCheck implementations
|
||||
/// </summary>
|
||||
private void InitPathCheckClasses()
|
||||
private static void InitPathCheckClasses()
|
||||
{
|
||||
if (pathCheckClasses == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user