, PTRACE_PEEKTEXT, PTRACE_PEEKDATA, PTRACE_PEEKUSER, PTRACE_POKETEXT,
PTRACE_POKEDATA, PTRACE_POKEUSER..., PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_SETREGS,
PTRACE_SETFPREGS, PTRACE_CONT, PTRACE_SYSCALL, PTRACE_SINGLESTEP...使用PTRACE_ATTACH参数就可以追踪正在运行的程序:
ptrace(PTRACE_ATTACH, pid, NULL, NULL)
其中pid位想要追踪的进程的进程id....(PTRACE_ATTACH, victim, NULL, NULL);
long inst;
wait(NULL);
ptrace(PTRACE_GETREGS, victim..., ®s);
ptrace(PTRACE_CONT, victim, NULL, NULL);
ptrace(PTRACE_DETACH, victim, NULL, NULL)