Android 钩子Roblox上的函数崩溃。MSHOOK函数
我有一些问题 当我挂接所有lua函数时,Roblox崩溃,除了重新调用器 什么是重新呼叫?Android 钩子Roblox上的函数崩溃。MSHOOK函数,android,c++,java-native-interface,roblox,ida,Android,C++,Java Native Interface,Roblox,Ida,我有一些问题 当我挂接所有lua函数时,Roblox崩溃,除了重新调用器 什么是重新呼叫? // attributes: thunk int __fastcall sub_1534F83(int a1) { return sub_154B4BC(a1);//Calls the function that i want to hook. } 如果我调用/hooksub_154B4BCall崩溃。 但是,如果我调用/hooksub_1534F83,所有操作都不会出现任何问题 sub_154B4
// attributes: thunk
int __fastcall sub_1534F83(int a1)
{
return sub_154B4BC(a1);//Calls the function that i want to hook.
}
如果我调用/hooksub_154B4BC
all崩溃。
但是,如果我调用/hooksub_1534F83
,所有操作都不会出现任何问题
sub_154B4BC伪码:
int __fastcall sub_154B4BC(int a1)
{
return (*(_DWORD *)(a1 + 12) - *(_DWORD *)(a1 + 16)) >> 4;
}
这是我的钩法
uintptr_t (*old_sub_154B4BC)(uintptr_t a1);
uintptr_t sub_154B4BC(uinptr_t a1)
{
LOG("I hooked the function!"); //never gets called, it crashes before of the call...
return old_sub_154B4BC(a1);
}
MSHookFunction((void *) getAbsoluteAddress(targetLibName,
string2Offset(OBFUSCATE_KEY("0x154B4BC", '?'))),
(void *) sub_154B4BC, (void **) &old_sub_154B4BC);
请帮忙