From 6ef70a3efff855891a6f4cc7db87bf84890bbe93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:07:47 +0800 Subject: [PATCH] Update PPSSPP.cpp --- LunaHook/engine64/PPSSPP.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LunaHook/engine64/PPSSPP.cpp b/LunaHook/engine64/PPSSPP.cpp index ff83bad..052c8a3 100644 --- a/LunaHook/engine64/PPSSPP.cpp +++ b/LunaHook/engine64/PPSSPP.cpp @@ -91,8 +91,6 @@ bool hookPPSSPPDoJit(){ if(emfunctionhooks.find(em_address)==emfunctionhooks.end())return; - static emfuncinfo op; - op=emfunctionhooks.at(em_address); HookParam hpinternal; hpinternal.user_value=em_address; hpinternal.address=stack->retaddr; @@ -102,11 +100,15 @@ bool hookPPSSPPDoJit(){ auto ret=stack->rax; if(breakpoints.find(ret)!=breakpoints.end())return; breakpoints.insert(ret); + + auto em_address=hp->user_value; + auto op=emfunctionhooks.at(em_address); + DWORD _; VirtualProtect((LPVOID)ret,0x10,PAGE_EXECUTE_READWRITE,&_); HookParam hpinternal; hpinternal.address=ret; - hpinternal.user_value=hp->user_value; + hpinternal.user_value=em_address; hpinternal.type=CODEC_UTF16|USING_STRING|NO_CONTEXT; hpinternal.text_fun=(decltype(hpinternal.text_fun))op.hookfunc; hpinternal.filter_fun=(decltype(hpinternal.filter_fun))op.filterfun;