I bullied simple monitor that print the path of the file that been execute so i hooked the execve system call but the problem was that the file name parameter contain only the file name and not the all path. any way i copied the envp parameter and i printed every string in it but the out put was just LS_C so i am wondering where do the execve system call get path from this is my code:
static asmlinkage long our_execl(const char __user * filename, const char __user * const __user * argv, const char __user * const __user * envp) { copy_from_user(mid,envp,sizeof(envp)); printk("okdotk:%d\n",sizeof(envp)); for(i=0;i<sizeof(envp);i++) { strncpy_from_user(env, mid[i], sizeof(mid[i])); env[255]='\0'; printk("%s\n",env); reset_envp(sizeof(env)); } return original_call(filename,argv,envp) }