mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-27 15:54:03 +08:00
Update PPSSPP.cpp
This commit is contained in:
parent
ed503b3de6
commit
fbf5390636
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user