Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hook不成功 #85

Open
punkisnotdead3 opened this issue Nov 22, 2023 · 1 comment
Open

hook不成功 #85

punkisnotdead3 opened this issue Nov 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@punkisnotdead3
Copy link

bytehook Version

1.0.9

Android OS Version

11

Android ABIs

arm64-v8a

Device Manufacturers and Models

vivo x60

Describe the Bug

是想hook libinput.so 里的 send和recv方法 来做onTouch事件的监听, 但是一直不成功 不知道为啥

//__socketcall ssize_t sendto(int __fd, const void* __buf, size_t __n, int __flags, const struct sockaddr* __dst_addr, socklen_t __dst_addr_length);
ssize_t send_proxy(int __fd, const void* __buf, size_t __n, int __flags, const struct sockaddr* __dst_addr, socklen_t __dst_addr_length) {
    LOGD("send_proxy");
    BYTEHOOK_STACK_SCOPE();
    return BYTEHOOK_CALL_PREV(send_proxy, __fd, __buf, __n, __flags,__dst_addr,__dst_addr_length);
}

//__socketcall ssize_t recvfrom(int __fd, void* __buf, size_t __n, int __flags, struct sockaddr* __src_addr, socklen_t* __src_addr_length);
ssize_t recv_proxy(int __fd, void* __buf, size_t __n, int __flags, struct sockaddr* __src_addr, socklen_t* __src_addr_length) {
    LOGD("recv_proxy");
    BYTEHOOK_STACK_SCOPE();
    return  BYTEHOOK_CALL_PREV(recv_proxy, __fd, __buf, __n, __flags,__src_addr,__src_addr_length);
}


    bytehook_hook_all("/system/lib/libinput.so", "sendto", (void *) send_proxy, nullptr, nullptr);
    bytehook_hook_all("/system/lib/libinput.so", "recvfrom", (void *) recv_proxy,
                      nullptr,
                      nullptr);
@punkisnotdead3 punkisnotdead3 added the bug Something isn't working label Nov 22, 2023
@caikelun
Copy link
Member

你可以先确认下是否初始化了bytehook,再通过 hooked 参数的callback看看errno?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants