Add IContentCheck interface

This commit is contained in:
Matt Nadareski
2021-02-26 01:26:49 -08:00
parent c6eaafebbe
commit 7cfa9649e4
47 changed files with 195 additions and 136 deletions

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class ActiveMARK
public class ActiveMARK : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "TMSAMVOF"
byte[] check = new byte[] { 0x54, 0x4D, 0x53, 0x41, 0x4D, 0x56, 0x4F, 0x46 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class AlphaROM
public class AlphaROM : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "SETTEC"
byte[] check = new byte[] { 0x53, 0x45, 0x54, 0x54, 0x45, 0x43 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class CDCheck
public class CDCheck : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// MGS CDCheck
byte[] check = new byte[] { 0x4D, 0x47, 0x53, 0x20, 0x43, 0x44, 0x43, 0x68, 0x65, 0x63, 0x6B };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class CDCops : IPathCheck
public class CDCops : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "CD-Cops, ver. "
byte[] check = new byte[] { 0x43, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C, 0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class CDLock : IPathCheck
public class CDLock : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "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"
byte[] check = new byte[] { 0x32, 0xF2, 0x02, 0x82, 0xC3, 0xBC, 0x0B, 0x24, 0x99, 0xAD, 0x27, 0x43, 0xE4, 0x9D, 0x73, 0x74, 0x99, 0xFA, 0x32, 0x24, 0x9D, 0x29, 0x34, 0xFF, 0x74 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class CDSHiELDSE
public class CDSHiELDSE : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "~0017.tmp"
byte[] check = new byte[] { 0x7E, 0x30, 0x30, 0x31, 0x37, 0x2E, 0x74, 0x6D, 0x70 };

View File

@@ -6,9 +6,10 @@ using System.Text;
namespace BurnOutSharp.ProtectionType
{
public class CactusDataShield : IPathCheck
public class CactusDataShield : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// DATA.CDS
byte[] check = new byte[] { 0x44, 0x41, 0x54, 0x41, 0x2E, 0x43, 0x44, 0x53 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class CengaProtectDVD
public class CengaProtectDVD : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// ".cenega"
byte[] check = new byte[] { 0x2E, 0x63, 0x65, 0x6E, 0x65, 0x67, 0x61 };

View File

@@ -1,9 +1,10 @@
namespace BurnOutSharp.ProtectionType
{
public class CodeLock
public class CodeLock : IContentCheck
{
// TODO: Verify if these are OR or AND
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "icd1" + (char)0x00
byte[] check = new byte[] { 0x69, 0x63, 0x64, 0x31, 0x00 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class CopyKiller : IPathCheck
public class CopyKiller : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "Tom Commander"
byte[] check = new byte[] { 0x54, 0x6F, 0x6D, 0x20, 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x65, 0x72 };

View File

@@ -3,9 +3,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class DVDCops
public class DVDCops : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "DVD-Cops, ver. "
byte[] check = new byte[] { 0x44, 0x56, 0x44, 0x2D, 0x43, 0x6F, 0x70, 0x73, 0x2C, 0x20, 0x20, 0x76, 0x65, 0x72, 0x2E, 0x20 };

View File

@@ -1,12 +1,13 @@
namespace BurnOutSharp.ProtectionType
{
public class ElectronicArts
public class ElectronicArts : IContentCheck
{
// TODO: Verify this doesn't over-match
// TODO: Do more research into the Cucko protection:
// - Reference to `EASTL` and `EAStdC` are standard for EA products and does not indicate Cucko by itself
// - There's little information outside of PiD detection that actually knows about Cucko
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// EASTL
// byte[] check = new byte[] { 0x45, 0x41, 0x53, 0x54, 0x4C };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class GFWL : IPathCheck
public class GFWL : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "xlive.dll"
byte[] check = new byte[] { 0x78, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x64, 0x6C, 0x6C };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class ImpulseReactor : IPathCheck
public class ImpulseReactor : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "CVPInitializeClient"
byte[] check = new byte[] { 0x43, 0x56, 0x50, 0x49, 0x6E, 0x69, 0x74, 0x69, 0x61, 0x6C, 0x69, 0x7A, 0x65, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74 };

View File

@@ -3,11 +3,12 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class InnoSetup
public class InnoSetup : IContentCheck
{
// TOOO: Add Inno Setup extraction
// https://github.com/dscharrer/InnoExtract
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "Inno"
byte[] check = new byte[] { 0x49, 0x6E, 0x6E, 0x6F };

View File

@@ -1,6 +1,6 @@
namespace BurnOutSharp.ProtectionType
{
public class Intenium
public class Intenium : IContentCheck
{
/*
* Possible strings for finding INTENIUM Trial & Buy Protection
@@ -18,7 +18,8 @@
* - NO NESTED PRMS SUPPORTED - 4E 4F 20 4E 45 53 54 45 44 20 50 52 4D 53 20 53 55 50 50 4F 52 54 45 44
*/
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// Trial + (char)0x00 + P
byte[] check = new byte[] { 0x54, 0x72, 0x69, 0x61, 0x6C, 0x00, 0x50 };

View File

@@ -3,9 +3,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class JoWooDXProt
public class JoWooDXProt : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// ".ext "
byte[] check = new byte[] { 0x2E, 0x65, 0x78, 0x74, 0x20, 0x20, 0x20, 0x20 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class KeyLock
public class KeyLock : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "KEY-LOCK COMMAND"
byte[] check = new byte[] { 0x4B, 0x45, 0x59, 0x2D, 0x4C, 0x4F, 0x43, 0x4B, 0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x41, 0x4E, 0x44 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class LaserLock : IPathCheck
public class LaserLock : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "Packed by SPEEnc V2 Asterios Parlamentas.PE"
byte[] check = new byte[] { 0x50, 0x61, 0x63, 0x6B, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x53, 0x50, 0x45, 0x45, 0x6E, 0x63, 0x20, 0x56, 0x32, 0x20, 0x41, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6F, 0x73, 0x20, 0x50, 0x61, 0x72, 0x6C, 0x61, 0x6D, 0x65, 0x6E, 0x74, 0x61, 0x73, 0x2E, 0x50, 0x45 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class MediaMaxCD3 : IPathCheck
public class MediaMaxCD3 : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// Cd3Ctl
byte[] check = new byte[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class Origin : IPathCheck
public class Origin : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// 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
byte[] check = 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 };

View File

@@ -1,20 +1,21 @@
namespace BurnOutSharp.ProtectionType
{
public class PSXAntiModchip
public class PSXAntiModchip : IContentCheck
{
// TODO: Figure out PSX binary header so this can be checked explicitly
// TODO: Detect Red Hand protection
public static string CheckContents(byte[] fileContent)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// " SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690"
byte[] check = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x4F, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x54, 0x45, 0x52, 0x4D, 0x49, 0x4E, 0x41, 0x54, 0x45, 0x44, 0x5C, 0x6E, 0x43, 0x4F, 0x4E, 0x53, 0x4F, 0x4C, 0x45, 0x20, 0x4D, 0x41, 0x59, 0x20, 0x48, 0x41, 0x56, 0x45, 0x20, 0x42, 0x45, 0x45, 0x4E, 0x20, 0x4D, 0x4F, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5C, 0x6E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x41, 0x4C, 0x4C, 0x20, 0x31, 0x2D, 0x38, 0x38, 0x38, 0x2D, 0x37, 0x38, 0x30, 0x2D, 0x37, 0x36, 0x39, 0x30 };
if (fileContent.Contains(check, out int position))
return $"PlayStation Anti-modchip (English) (Index {position})";
return $"PlayStation Anti-modchip (English)" + (includePosition ? $"(Index {position})" : string.Empty);
// "強制終了しました。\n本体が改造されている\nおそれがあります。"
check = new byte[] { 0x5F, 0x37, 0x52, 0x36, 0x7D, 0x42, 0x4E, 0x86, 0x30, 0x57, 0x30, 0x7E, 0x30, 0x57, 0x30, 0x5F, 0x30, 0x02, 0x5C, 0x6E, 0x67, 0x2C, 0x4F, 0x53, 0x30, 0x4C, 0x65, 0x39, 0x90, 0x20, 0x30, 0x55, 0x30, 0x8C, 0x30, 0x66, 0x30, 0x44, 0x30, 0x8B, 0x5C, 0x6E, 0x30, 0x4A, 0x30, 0x5D, 0x30, 0x8C, 0x30, 0x4C, 0x30, 0x42, 0x30, 0x8A, 0x30, 0x7E, 0x30, 0x59, 0x30, 0x02 };
if (fileContent.Contains(check, out position))
return $"PlayStation Anti-modchip (Japanese) (Index {position})";
return $"PlayStation Anti-modchip (Japanese)" + (includePosition ? $"(Index {position})" : string.Empty);
return null;
}

View File

@@ -6,9 +6,10 @@ using System.Threading;
namespace BurnOutSharp.ProtectionType
{
public class ProtectDisc
public class ProtectDisc : IContentCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "HúMETINF"
byte[] check = new byte[] { 0x48, 0xFA, 0x4D, 0x45, 0x54, 0x49, 0x4E, 0x46 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class RingPROTECH
public class RingPROTECH : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// (char)0x00 + "Allocator" + (char)0x00 + (char)0x00 + (char)0x00 + (char)0x00
byte[] check = new byte[] { 0x00, 0x41, 0x6C, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class SVKProtector
public class SVKProtector : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "?SVKP" + (char)0x00 + (char)0x00
byte[] check = new byte[] { 0x3F, 0x53, 0x56, 0x4B, 0x50, 0x00, 0x00 };

View File

@@ -7,9 +7,10 @@ using System.Text;
namespace BurnOutSharp.ProtectionType
{
public class SafeDisc : IPathCheck
public class SafeDisc : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "BoG_ *90.0&!! Yy>"
byte[] check = new byte[] { 0x42, 0x6F, 0x47, 0x5F, 0x20, 0x2A, 0x39, 0x30, 0x2E, 0x30, 0x26, 0x21, 0x21, 0x20, 0x20, 0x59, 0x79, 0x3E };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class SafeLock : IPathCheck
public class SafeLock : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "SafeLock"
byte[] check = new byte[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B };

View File

@@ -6,9 +6,10 @@ using System.Text;
namespace BurnOutSharp.ProtectionType
{
public class SecuROM : IPathCheck
public class SecuROM : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "AddD" + (char)0x03 + (char)0x00 + (char)0x00 + (char)0x00)
byte[] check = new byte[] { 0x41, 0x64, 0x64, 0x44, 0x03, 0x00, 0x00, 0x00 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class SmartE : IPathCheck
public class SmartE : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// BITARTS
byte[] check = new byte[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 };

View File

@@ -6,9 +6,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class SolidShield : IPathCheck
public class SolidShield : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "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"
byte[] check = new byte[] { 0x44, 0x00, 0x56, 0x00, 0x4D, 0x00, 0x20, 0x00, 0x4C, 0x00, 0x69, 0x00, 0x62, 0x00, 0x72, 0x00, 0x61, 0x00, 0x72, 0x00, 0x79 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class StarForce : IPathCheck
public class StarForce : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "(" + (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
byte[] check = new byte[] { 0x28, 0x00, 0x63, 0x00, 0x29, 0x00, 0x20, 0x00, 0x50, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x67, 0x00, 0x79, 0x00 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class Sysiphus
public class Sysiphus : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "V SUHPISYSDVD"
byte[] check = new byte[] { 0x56, 0x20, 0x53, 0x55, 0x48, 0x50, 0x49, 0x53, 0x59, 0x53, 0x44, 0x56, 0x44 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class Tages : IPathCheck
public class Tages : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "protected-tages-runtime.exe"
byte[] check = new byte[] { 0x70, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x2D, 0x74, 0x61, 0x67, 0x65, 0x73, 0x2D, 0x72, 0x75, 0x6E, 0x74, 0x69, 0x6D, 0x65, 0x2E, 0x65, 0x78, 0x65 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class ThreePLock
public class ThreePLock : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// .ldr
byte[] check = new byte[] { 0x2E, 0x6C, 0x64, 0x72 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class ThreeTwoOneStudios
public class ThreeTwoOneStudios : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// 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
byte[] check = new byte[] { 0x33, 0x00, 0x32, 0x00, 0x31, 0x00, 0x53, 0x00, 0x74, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x73, 0x00, 0x20, 0x00, 0x41, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x76, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00 };

View File

@@ -7,9 +7,10 @@ using System.Threading;
namespace BurnOutSharp.ProtectionType
{
public class VOBProtectCDDVD : IPathCheck
public class VOBProtectCDDVD : IContentCheck, IPathCheck
{
public static string CheckContents(string file, byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "VOB ProtectCD"
byte[] check = new byte[] { 0x56, 0x4F, 0x42, 0x20, 0x50, 0x72, 0x6F, 0x74, 0x65, 0x63, 0x74, 0x43, 0x44 };

View File

@@ -5,9 +5,10 @@ using System.Linq;
namespace BurnOutSharp.ProtectionType
{
public class WTMCDProtect : IPathCheck
public class WTMCDProtect : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "WTM76545"
byte[] check = new byte[] { 0x57, 0x54, 0x4D, 0x37, 0x36, 0x35, 0x34, 0x35 };

View File

@@ -6,9 +6,10 @@ using BurnOutSharp.FileType;
namespace BurnOutSharp.ProtectionType
{
public class XCP : IPathCheck
public class XCP : IContentCheck, IPathCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// XCP.DAT
byte[] check = new byte[] { 0x58, 0x43, 0x50, 0x2E, 0x44, 0x41, 0x54 };

View File

@@ -1,8 +1,9 @@
namespace BurnOutSharp.ProtectionType
{
public class XtremeProtector
public class XtremeProtector : IContentCheck
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// "XPROT "
byte[] check = new byte[] { 0x58, 0x50, 0x52, 0x4F, 0x54, 0x20, 0x20, 0x20 };