We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to hook the posix socket api
elf_hook(handle, base_address, "socket", hook_socket); elf_hook(handle, base_address, "bind", hook_bind); elf_hook(handle, base_address, "connect", hook_connect); elf_hook(handle, base_address, "getpeername", hook_getpeername); elf_hook(handle, base_address, "getsockname", hook_getsockname); elf_hook(handle, base_address, "getsockopt", hook_getsockopt); elf_hook(handle, base_address, "listen", hook_listen); elf_hook(handle, base_address, "recv", hook_recv); elf_hook(handle, base_address, "recvfrom", hook_recvfrom); elf_hook(handle, base_address, "recvmsg", hook_recvmsg); elf_hook(handle, base_address, "send", hook_send); elf_hook(handle, base_address, "sendmsg", hook_sendmsg); elf_hook(handle, base_address, "sendto", hook_sendto); elf_hook(handle, base_address, "setsockopt", hook_setsockopt); elf_hook(handle, base_address, "shutdown", hook_shutdown); elf_hook(handle, base_address, "socketpair", hook_socketpair);
I can hook the first 6 functions
hooked(socket) original_function(0x7f8279c3c936) hooked(bind) original_function(0xff04f3a7a808) hooked(connect) original_function(0x4a8e56) hooked(getpeername) original_function(0x4a8ff0) hooked(getsockname) original_function(0x4a9126) hooked(getsockopt) original_function(0x4a92c7)
and then it seg faults
#0 0x00000000004b2b59 in elf_hook \ (module_filename=0x1498200 "/src/build/elfhook/libtest_api.so", \ module_address=0x7f8279c3c000, \ name=0x5671b2 "listen", \ substitution=0x4a96a5 <hook_listen(int, int)>) at /src/elfhook/elf_hook.c:479 479 *(size_t *)(((size_t)module_address) + rel_plt_table[i].r_offset) = (size_t)substitution; \ //and replace it with the substitutional
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to hook the posix socket api
I can hook the first 6 functions
and then it seg faults
The text was updated successfully, but these errors were encountered: