Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Mono.Cecil;
- using Mono.Cecil.Cil;
- namespace TSS_Patcher
- {
- class Program
- {
- static string path;
- static void Main(string[] args)
- {
- path = args[0];
- Console.Title = "TSS Patcher";
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("TSS Patcher - Anon Xero\n\nFile: " + path);
- Magic(AssemblyDefinition.ReadAssembly(path));
- }
- static void Magic(AssemblyDefinition asdef)
- {
- Console.Write("\n\nStarting Patcher...\n\n");
- // Set to Standard Edition
- asdef.EntryPoint.Body.Instructions[1] = Instruction.Create(OpCodes.Ldc_I4_1);
- Console.Write("P1: Set to standard edition\n");
- // Find & edit the location of Registration #
- foreach (ModuleDefinition moduledef in asdef.Modules)
- foreach (TypeDefinition typedef in moduledef.Types)
- if (typedef.HasMethods)
- foreach (MethodDefinition methoddef in typedef.Methods)
- if (methoddef.HasBody)
- if (methoddef.Body.Instructions.Count > 0x61)
- if (methoddef.Body.Instructions[0x61].OpCode == OpCodes.Ldarg_3)
- if (methoddef.Body.Instructions[0x61].Offset == 0x10A)
- methoddef.Body.Instructions[0x61] = Instruction.Create(OpCodes.Ldstr, "CrackedByXeClutch");
- Console.Write("P2: Registration # stamped\n");
- // Save patched assembly
- asdef.Write(path.TrimEnd(".exe".ToCharArray()) + " - TSS Patcher.exe");
- Console.Write("P3: Patched assembly saved\n");
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Done !\n");
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("Press any key to exit...");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement