hook不成功

Open
#85 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c
Domain
mobile-dev

Research direction

Start with the bytehook_hook_all calls and the send_proxy/recv_proxy callbacks targeting /system/lib/libinput.so; compare the requested sendto and recvfrom symbols with runtime behavior on Android 11 and arm64-v8a. Check whether the callbacks are reached, then document a reproducible diagnosis or confirmed hook behavior.

Written by the indexing model from the issue text.

Description

bug
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);
Dominant language
C
Stars
2.6k
Forks
405
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytedance/bhook

All issues in bytedance/bhook

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.