From f182dccbf22fc77e280dc748eabf69e6500ca7c4 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 29 Oct 2020 10:05:56 -0700 Subject: [PATCH] 21 -> 321, add a couple protection notes --- BurnOutSharp/FileType/Executable.cs | 4 ++-- BurnOutSharp/ProtectionType/Itenium.cs | 20 +++++++++++++++++++ BurnOutSharp/ProtectionType/Petite.cs | 10 ++++++++++ .../ProtectionType/ThreeTwoOneStudios.cs | 15 ++++++++++++++ .../ProtectionType/TwentyOneStudios.cs | 15 -------------- 5 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 BurnOutSharp/ProtectionType/Itenium.cs create mode 100644 BurnOutSharp/ProtectionType/Petite.cs create mode 100644 BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs delete mode 100644 BurnOutSharp/ProtectionType/TwentyOneStudios.cs diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index 79893fb7..09ecb4f2 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -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); diff --git a/BurnOutSharp/ProtectionType/Itenium.cs b/BurnOutSharp/ProtectionType/Itenium.cs new file mode 100644 index 00000000..00b9856a --- /dev/null +++ b/BurnOutSharp/ProtectionType/Itenium.cs @@ -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 + */ + } +} diff --git a/BurnOutSharp/ProtectionType/Petite.cs b/BurnOutSharp/ProtectionType/Petite.cs new file mode 100644 index 00000000..08f1df4e --- /dev/null +++ b/BurnOutSharp/ProtectionType/Petite.cs @@ -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) + */ + } +} diff --git a/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs new file mode 100644 index 00000000..b0da2f57 --- /dev/null +++ b/BurnOutSharp/ProtectionType/ThreeTwoOneStudios.cs @@ -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; + } + } +} diff --git a/BurnOutSharp/ProtectionType/TwentyOneStudios.cs b/BurnOutSharp/ProtectionType/TwentyOneStudios.cs deleted file mode 100644 index 37347a6e..00000000 --- a/BurnOutSharp/ProtectionType/TwentyOneStudios.cs +++ /dev/null @@ -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; - } - } -}