21 -> 321, add a couple protection notes

This commit is contained in:
Matt Nadareski
2020-10-29 10:05:56 -07:00
parent 2d2cff4d0e
commit f182dccbf2
5 changed files with 47 additions and 17 deletions

View File

@@ -63,8 +63,8 @@ namespace BurnOutSharp.FileType
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// 21Studios Online Activation
protection = TwentyOneStudios.CheckContents(fileContent, includePosition);
// 321Studios Online Activation
protection = ThreeTwoOneStudios.CheckContents(fileContent, includePosition);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);

View File

@@ -0,0 +1,20 @@
namespace BurnOutSharp.ProtectionType
{
public class Itenium
{
/*
* Possible strings for finding ITENIUM Trial & Buy Protection
*
* Luxor Only:
* - command_buyNowCb - 63 6F 6D 6D 61 6E 64 5F 62 75 79 4E 6F 77 43 62
* - command_testTrialCb - 63 6F 6D 6D 61 6E 64 5F 74 65 73 74 54 72 69 61 6C 43 62
* - PHRASE_TRIAL - 50 48 52 41 53 45 5F 54 52 49 41 4C
* - V_TRIAL_GAME - 56 5F 54 52 49 41 4C 5F 47 41 4D 45
* - V_FULL_GAME - 56 5F 46 55 4C 4C 5F 47 41 4D 45
*
* Luxor, World, Cradle, and Kingdom:
* - Trial + (char)0x00 + P - 54 72 69 61 6C 00 50
* - 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
*/
}
}

View File

@@ -0,0 +1,10 @@
namespace BurnOutSharp.ProtectionType
{
public class Petite
{
/*
* Possible strings for PEtite Win32 Executable Compressor (Unknown how to get version)
* - petite - 40 70 65 74 69 74 65 (Made with Version 2.4, Compression Level 1-9)
*/
}
}

View File

@@ -0,0 +1,15 @@
namespace BurnOutSharp.ProtectionType
{
public class ThreeTwoOneStudios
{
public static string CheckContents(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 };
if (fileContent.Contains(check, out int position))
return "321Studios Online Activation" + (includePosition ? $" (Index {position})" : string.Empty);
return null;
}
}
}

View File

@@ -1,15 +0,0 @@
namespace BurnOutSharp.ProtectionType
{
public class TwentyOneStudios
{
public static string CheckContents(byte[] fileContent, bool includePosition = false)
{
// 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[] { 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 };
if (fileContent.Contains(check, out int position))
return "21Studios Online Activation" + (includePosition ? $" (Index {position})" : string.Empty);
return null;
}
}
}