Update PPSSPP.cpp

This commit is contained in:
恍兮惚兮 2024-03-22 02:45:00 +08:00
parent ed503b3de6
commit fbf5390636

View File

@ -75,7 +75,7 @@ struct emfuncinfo{
const wchar_t* _id; const wchar_t* _id;
}; };
std::unordered_map<uintptr_t,emfuncinfo>emfunctionhooks; std::unordered_map<uintptr_t,emfuncinfo>emfunctionhooks;
std::unordered_set<uintptr_t>breakpoints;
} }
bool hookPPSSPPDoJit(){ bool hookPPSSPPDoJit(){
ConsoleOutput("[Compatibility]"); ConsoleOutput("[Compatibility]");
@ -90,6 +90,7 @@ bool hookPPSSPPDoJit(){
hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){ hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){
auto em_address=stack->ARG2; auto em_address=stack->ARG2;
if(emfunctionhooks.find(em_address)==emfunctionhooks.end())return; if(emfunctionhooks.find(em_address)==emfunctionhooks.end())return;
static emfuncinfo op; static emfuncinfo op;
op=emfunctionhooks.at(em_address); op=emfunctionhooks.at(em_address);
HookParam hpinternal; HookParam hpinternal;
@ -97,6 +98,8 @@ bool hookPPSSPPDoJit(){
hpinternal.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){ hpinternal.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){
hp->text_fun=nullptr;hp->type=HOOK_EMPTY; hp->text_fun=nullptr;hp->type=HOOK_EMPTY;
auto ret=stack->rax; auto ret=stack->rax;
if(breakpoints.find(ret)!=breakpoints.end())return;
breakpoints.insert(ret);
DWORD _; DWORD _;
VirtualProtect((LPVOID)ret,0x10,PAGE_EXECUTE_READWRITE,&_); VirtualProtect((LPVOID)ret,0x10,PAGE_EXECUTE_READWRITE,&_);
HookParam hpinternal; HookParam hpinternal;