Closed akrogames closed 4 years ago
Hey, on modern kernels syscall prototypes are changed. Each of __x64_<syscall>
() function has proto like __x64_xxx(struct pt_regs *regs)
. So you have to deal with struct pr_regs
and extract syscall arguments manually using syscall calling convention (regs->di, regs->si, regs->dx, regs->cx and so on).
Update: have a look at https://github.com/milabs/khook#hooking-of-system-calls-handler-functions
Oh thanks ! I didn't found documentation on kernel.org ... Thanks so much ;) that's work ! I have to learn how to manage arguments.
Hi,
I am trying to hook openat syscall and others syscall like read or write but I have some issues. I don't understand why the hook doesn't work.
This is because some syscall are protected in kernel now ? I am using : 5.3.0-46-generic #38~18.04.1-Ubuntu
Source code :
Log from dmesg :