Replies: 2 comments
-
把你自己的fopen逻辑写在一个单独函数中?比如new_fopen_impl(里面不包含bytehook的任何宏和调用),然后new_fopen调用new_fopen_impl,new_dlsym也返回new_fopen_impl的地址? |
Beta Was this translation helpful? Give feedback.
0 replies
-
好的,明白了,谢谢 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
bytehook Version
1.0.5
Android OS Version
7.1
Android ABIs
armeabi-v7a
Device Manufacturers and Models
any
Describe the Bug
bhook拦截了dlsym函数
FILE* new_fopen(const char* __path, const char* __mode){
BYTEHOOK_STACK_SCOPE();
return BYTEHOOK_CALL_PREV(new_fopen, __path, __mode);;
}
void* new_dlsym(void* __handle, const char* __symbol){
BYTEHOOK_STACK_SCOPE();
void rs = NULL;
if(strcmp(__symbol, "fopen") == 0) rs = (void)new_fopen;
else rs = BYTEHOOK_CALL_PREV(new_dlsym, __handle, __symbol);
LOGD("dlsym: %s, func:%p", __symbol, rs);
return rs;
}
如果目标应用通过dlsym来调用fopen的时候会崩溃,我看源码中写有
if (0 == stack->frames_cnt) abort(); // called in a non-hook status?
有啥办法解决吗?
Beta Was this translation helpful? Give feedback.
All reactions