From c3f232dcfc51ab16da49deb29cd392a5c94f1f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Mon, 9 Dec 2024 17:02:55 +0800 Subject: [PATCH] . --- cpp/LunaHook/LunaHook/stackoffset.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/LunaHook/LunaHook/stackoffset.hpp b/cpp/LunaHook/LunaHook/stackoffset.hpp index ab03fab5..3c9e7a90 100644 --- a/cpp/LunaHook/LunaHook/stackoffset.hpp +++ b/cpp/LunaHook/LunaHook/stackoffset.hpp @@ -159,8 +159,8 @@ inline uintptr_t *argidx(hook_stack *stack, int idx) default: offset = get_stack(idx); } - return (uintptr_t *)((uintptr_t)stack + sizeof(hook_stack) - sizeof(uintptr_t) + offset); + return (uintptr_t *)(stack->get_base() + offset); #else - return (uintptr_t *)((uintptr_t)stack + sizeof(hook_stack) - sizeof(uintptr_t) + get_stack(idx)); + return (uintptr_t *)(stack->get_base() + get_stack(idx)); #endif } \ No newline at end of file