I am trying to catpure name of an executable for execve system call using ptrace as -
long val = ptrace(PTRACE_PEEKUSER, child, sizeof(long) * RDI);
Where RDI
is the register which holds first argument to execve
I was hoping to get some arbitrary number in val
But, it ended up having 0
all the time.