From 6dd7b47e345d889ec925516db8f84deafa102558 Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 28 Mar 2024 15:59:10 -0700 Subject: [PATCH] HookManager: Simplify previous improvements with register storage --- src/HookManager.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) 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));