mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Fix patched jmp location
This commit is contained in:
2 files changed
+9
-1
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user