kernel: hook syscall instead of unstable symbol

This commit is contained in:
weishu
2024-03-20 14:21:14 +08:00
parent 8f33926aa0
commit 2a64784a33
2 changed files with 40 additions and 2 deletions

View File

@@ -20,8 +20,10 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)
#define PRCTL_SYMBOL "__arm64_sys_prctl"
#define SYS_READ_SYMBOL "__arm64_sys_read"
#else
#define PRCTL_SYMBOL "sys_prctl"
#define SYS_READ_SYMBOL "sys_read"
#endif
#elif defined(__x86_64__)
@@ -41,8 +43,10 @@
#define __PT_IP_REG ip
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)
#define PRCTL_SYMBOL "__x64_sys_prctl"
#define SYS_READ_SYMBOL "__x64_sys_read"
#else
#define PRCTL_SYMBOL "sys_prctl"
#define SYS_READ_SYMBOL "sys_read"
#endif
#else