I'm using ptrace system call in C language:
long ptrace(enum __ptrace_request requête, pid_t pid, void *addr, void *data);
But I don't know what void *addr refers to...
In this example, I wanted to get the address of the current instruction which is in RIP:
unsigned long ip = ptrace(PTRACE_PEEKUSER, child, 8 * RIP, NULL);
Where child refers to the PID of the child process, I don't understand why do we need to multiply RIP by 8 and why RIP is used as an integer constant (defined in <sys/reg.h> as 16).
16*8 = 128 is an integer constant: is it a valid (void *addr) ?