KernelPatch icon indicating copy to clipboard operation
KernelPatch copied to clipboard

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

Open xingkong123600 opened this issue 1 year ago • 1 comments

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);

xingkong123600 avatar Oct 30 '24 12:10 xingkong123600

use kallsyms

Surrya24 avatar Mar 30 '25 11:03 Surrya24