File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
extensions/dhooks/DynamicHooks Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -317,9 +317,13 @@ void CHook::CreateBridge()
317
317
PrintRegisters (jit);
318
318
319
319
// Jump to the trampoline
320
+ jit.sub (rsp, 8 );
321
+ jit.push (rax);
320
322
jit.mov (rax, reinterpret_cast <std::uint64_t >(&m_pTrampoline));
321
323
jit.mov (rax, rax ());
322
- jit.jump (rax);
324
+ jit.mov (rsp (8 ), rax);
325
+ jit.pop (rax);
326
+ jit.retn ();
323
327
324
328
// This code will be executed if a pre-hook returns ReturnAction_Supercede
325
329
jit.rewrite <std::int32_t >(jumpOff - sizeof (std::int32_t ), jit.get_outputpos () - jumpOff);
@@ -621,8 +625,12 @@ void CHook::CreateBridge()
621
625
masm.j (equal, &label_supercede);
622
626
623
627
// Jump to the trampoline
628
+ masm.subl (esp, 4 );
629
+ masm.push (eax);
624
630
masm.movl (eax, Operand (ExternalAddress (&m_pTrampoline)));
625
- masm.jmp (eax);
631
+ masm.movl (Operand (esp, 4 ), eax);
632
+ masm.pop (eax);
633
+ masm.ret ();
626
634
627
635
// This code will be executed if a pre-hook returns ReturnAction_Supercede
628
636
masm.bind (&label_supercede);
You can’t perform that action at this time.
0 commit comments