bmax121 / KernelPatch

Patching and hooking the Linux kernel with only a stripped Linux kernel image.
GNU General Public License v2.0
736 stars 128 forks source link

how to get origin struct param in syscall hook when using syscall_argn? #136

Open xingkong123600 opened 3 weeks ago

xingkong123600 commented 3 weeks ago

i am using kpm to hook syscall. param[1] is a struct, how to get origin struct? and need i copy from user like demo "compat_strncpy_from_user(buf, path, sizeof(buf));" ? and how to copy from user?

here is my code, but not work (phone rebooted): struct statfs mystruct = (struct statfs )syscall_argn(args, 1);