mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-28 19:53:01 +00:00
Move generic CD key to own file
This commit is contained in:
30
BurnOutSharp/ProtectionType/CDKey.cs
Normal file
30
BurnOutSharp/ProtectionType/CDKey.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.Matching;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
public class CDKey : IContentCheck
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of all ContentMatchSets for this protection
|
||||
/// </summary>
|
||||
private static readonly List<ContentMatchSet> contentMatchers = 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 + C + (char)0x00 + D + (char)0x00 + K + (char)0x00 + e + (char)0x00 + y + (char)0x00
|
||||
new ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x49, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x65, 0x00,
|
||||
0x72, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
0x4E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00,
|
||||
0x00, 0x00, 0x43, 0x00, 0x44, 0x00, 0x4B, 0x00,
|
||||
0x65, 0x00, 0x79, 0x00
|
||||
}, Utilities.GetFileVersion, "CD-Key / Serial"),
|
||||
};
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
return MatchUtil.GetFirstMatch(file, fileContent, contentMatchers, includePosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,17 +49,6 @@ namespace BurnOutSharp.ProtectionType
|
||||
0x4B, 0x00, 0x65, 0x00, 0x79, 0x00
|
||||
}, Utilities.GetFileVersion, "EA CdKey Registration Module"),
|
||||
|
||||
// Overmatches with a more generic protection
|
||||
/* // 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 ContentMatchSet(new byte?[]
|
||||
{
|
||||
0x49, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x65, 0x00,
|
||||
0x72, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
0x4E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00,
|
||||
0x00, 0x00, 0x43, 0x00, 0x44, 0x00, 0x4B, 0x00,
|
||||
0x65, 0x00, 0x79, 0x00
|
||||
}, 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 ContentMatchSet(new byte?[]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user