-
bool InputDispatcher::hasInjectionPermission(int32_t injectorPid, int32_t injectorUid) hook 成功找到函数地址了,但是没有被执行,求大佬给看看 typedef bool (*type_t)(int32_t injectorPid, int32_t injectorUid);
//static bool (*orgin_hasInjectionPermission)(int32_t injectorPid, int32_t injectorUid);
// 代替的方法
static bool new_hasInjectionPermission(int32_t injectorPid, int32_t injectorUid) {
LOG("HAHSHDAHHDA->>>>>>> %d, %d\n", injectorPid, injectorUid);
((type_t)orig)(injectorPid, injectorUid);
return true;
}
...
stub = shadowhook_hook_sym_name(
"libinputflinger.so",
"_ZN7android15InputDispatcher22hasInjectionPermissionEii",
(void *)new_hasInjectionPermission,
(void **)&orig);
#log:
I/shadowhook_tag: shadowhook: hook_sym_name(libinputflinger.so, _ZN7android15InputDispatcher22hasInjectionPermissionEii, 0x73322f8100) OK. return: 0x738e5686c0. 1 - Pending task |
Beta Was this translation helpful? Give feedback.
Answered by
caikelun
May 18, 2022
Replies: 1 comment 6 replies
-
hook 的时候 |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
re2zero
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hook 的时候
libinputflinger.so
还没有被加载。errno 为1
,详见文档:https://github.com/bytedance/android-inline-hook/blob/main/doc/manual.zh-CN.md#%E9%94%99%E8%AF%AF%E7%A0%81