diff --git a/LunaHook/engine64/yuzusuyu.cpp b/LunaHook/engine64/yuzusuyu.cpp index 20f5aa9..7bdae74 100644 --- a/LunaHook/engine64/yuzusuyu.cpp +++ b/LunaHook/engine64/yuzusuyu.cpp @@ -95,7 +95,6 @@ bool yuzusuyu::attach_function() auto DoJitPtr=getDoJitAddress(); if(DoJitPtr==0)return false; ConsoleOutput("DoJitPtr %p",DoJitPtr); - jitaddrclear(); HookParam hp; hp.address=DoJitPtr; hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){ diff --git a/LunaHook/engines/ppsspp/ppsspp.cpp b/LunaHook/engines/ppsspp/ppsspp.cpp index 11694a9..ce911cf 100644 --- a/LunaHook/engines/ppsspp/ppsspp.cpp +++ b/LunaHook/engines/ppsspp/ppsspp.cpp @@ -283,7 +283,6 @@ bool hookPPSSPPDoJit(){ HookParam hp; hp.address=DoJitPtr;//Jit::DoJit ConsoleOutput("DoJitPtr %p",DoJitPtr); - jitaddrclear(); hp.user_value=(uintptr_t)new uintptr_t; hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){ auto em_address=stack->THISCALLARG1; diff --git a/LunaHook/hookfinder.cc b/LunaHook/hookfinder.cc index 98a9da1..55b8780 100644 --- a/LunaHook/hookfinder.cc +++ b/LunaHook/hookfinder.cc @@ -207,8 +207,9 @@ void SafeSendJitVeh(hook_stack* stack,uintptr_t address,uintptr_t em_addr,JITTYP }__except (EXCEPTION_EXECUTE_HANDLER) {} } std::unordered_mapaddresscalledtime; +bool safeautoleaveveh=false; bool SendJitVeh(PCONTEXT context,uintptr_t address,uintptr_t em_addr,JITTYPE jittype){ - + if(safeautoleaveveh)return true; if (recordsAvailable <= 0) return false; if(addresscalledtime.find(address)==addresscalledtime.end())addresscalledtime[address]=0; auto tm=GetTickCount64(); @@ -384,6 +385,7 @@ void SearchForHooks(SearchParam spUser) } else { + safeautoleaveveh=false; ConsoleOutput(HOOK_SEARCH_INITIALIZED, jitaddr2emuaddr.size()); std::vectorsuccessaddr;int i=0; for(auto addr:jitaddr2emuaddr){ @@ -395,9 +397,10 @@ void SearchForHooks(SearchParam spUser) } ConsoleOutput(MAKE_GAME_PROCESS_TEXT, sp.searchTime / 1000); Sleep(sp.searchTime); - for(auto addr:successaddr){ - remove_veh_hook((void*)addr); - } + // for(auto addr:successaddr){ + // remove_veh_hook((void*)addr); + // } + safeautoleaveveh=true; SearchForHooks_Return(); } }).detach(); diff --git a/LunaHook/main.cc b/LunaHook/main.cc index 94695bc..bd45682 100644 --- a/LunaHook/main.cc +++ b/LunaHook/main.cc @@ -173,11 +173,6 @@ int HookStrLen(HookParam* hp,BYTE* data){ } static std::mutex maplock; -void jitaddrclear(){ - std::lock_guard _(maplock); - emuaddr2jitaddr.clear(); - jitaddr2emuaddr.clear(); -} void jitaddraddr(uintptr_t em_addr,uintptr_t jitaddr,JITTYPE jittype){ std::lock_guard _(maplock); if(emuaddr2jitaddr.find(em_addr)==emuaddr2jitaddr.end()) diff --git a/LunaHook/main.h b/LunaHook/main.h index daab251..d3db9ad 100644 --- a/LunaHook/main.h +++ b/LunaHook/main.h @@ -21,7 +21,6 @@ inline SearchParam spDefault; int HookStrLen(HookParam*,BYTE* data); inline std::unordered_map > >emuaddr2jitaddr; inline std::unordered_map>jitaddr2emuaddr; -void jitaddrclear(); void jitaddraddr(uintptr_t em_addr,uintptr_t jitaddr,JITTYPE); void context_get(hook_stack*,PCONTEXT);