Ejemplo n.º 1
0
 /// <summary>
 /// Sets the value of the patch byte in the Unity executable.
 /// </summary>
 private void PatchExecutable(byte b)
 {
     try
     {
         FileHelpers.CreateFileBackup(UnityExecutable.ExecutablePath);
         BinaryHelpers.WriteByteToAddress(UnityExecutable.ExecutablePath, b, PatchableByteAddress);
         ConsoleHelpers.WriteLine("Patch applied successfully", ConsoleColor.Green);
         Init();
     }
     catch
     {
         ConsoleHelpers.ExitOnInput("Failed to write changes to file, make sure you have write permission", ConsoleColor.Red);
     }
 }