Fix patched jmp location

This commit is contained in:
Bepis committed 2020-09-02 05:29:55 +10:00
1 parent 418476b728
commit a45ee28303
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ namespace BepInEx.IL2CPP
0x00, 0x00, 0x00, 0x00 // Relative destination address
};
Array.Copy(BitConverter.GetBytes(currentAddress.ToInt32() - address.ToInt32()), 0, jmpBytes, 1, 4);
Array.Copy(BitConverter.GetBytes(address.ToInt32() - (currentAddress.ToInt32() + 5)), 0, jmpBytes, 1, 4);
}
return jmpBytes;
+8
View File
@@ -54,6 +54,14 @@ namespace BepInEx.Tests
Console.WriteLine("Modified:");
Console.WriteLine();
Marshal.Copy(exampleCodePointer, exampleCode, 0, exampleCode.Length);
Disassemble(exampleCode, (ulong)exampleCodePointer.ToInt64());
Console.WriteLine();
Console.WriteLine("Trampoline:");
Console.WriteLine();