Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6382

Why argv is allways (NULL) in my execve system call monitor

$
0
0

I wrote lkm hook that monitor the execve system call it basically should print the parameter of the char ** argv .and i tried to print the argv but it didn't worked i must say that the filename parameter and the env variable were printed fine but when i print the argv the result is

(NULL)

when i run the ls -all command or any other programthis is my code

char argv[100];char **mid;asmlinkage long our_execl(struct pt_regs *tr){copy_from_user(mid,tr->cx,100);strncpy_from_user(argv,mid[1], 253);printk("%s\n",argv);}

Viewing all articles
Browse latest Browse all 6382

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>