diff --git a/src/HookManager.cpp b/src/HookManager.cpp index 2be6f38c6..f90b52b8d 100644 --- a/src/HookManager.cpp +++ b/src/HookManager.cpp @@ -334,6 +334,10 @@ void HookManager::create_jitted_facilitator(std::unique_ptr r10 - a.pop(rax); // restore return value - + // Set hook storage back to R10. + a.mov(r10, rbx); constexpr auto ret_val_offset = offsetof(HookedFn::HookStorage, ret_val); //a.lea(rcx, ptr(r10, ret_val_offset));