Replies: 2 comments 2 replies
-
我在使用项目的过程中碰到如标题的崩溃,以下是相关信息 问题描述: |
Beta Was this translation helpful? Give feedback.
0 replies
-
@dimly123 哈哈我们俩都犯了低级错误,因为返回值错了。正确代码如下:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
static bytehook_stub_t read_stub = NULL;
typedef ssize_t (*read_t)(int, void *, size_t);
static int proxy_read(int fd, void *buf, size_t count) {
BYTEHOOK_CALL_PREV(proxy_read, read_t, fd, buf, count);
// __android_log_print(ANDROID_LOG_DEBUG, "jzx-->", "%zd", count);
// __android_log_print(ANDROID_LOG_DEBUG, "jzx-->", "%p", buf);
// (void)buf;
// (void)count;
BYTEHOOK_POP_STACK();
return fd;
}
static int hacker_hook(JNIEnv *env, jobject thiz) {
(void) env, (void) thiz;
void *read_proxy;
read_proxy = (void *) proxy_read;
if (NULL != read_stub) return -1;
read_stub = bytehook_hook_partial(allow_filter,
NULL, NULL, "read", read_proxy,
NULL, NULL);
return 0;
}
static int hacker_unhook(JNIEnv *env, jobject thiz) {
(void) env, (void) thiz;
}
Beta Was this translation helpful? Give feedback.
All reactions