Parsing Call and Ret with ptrace.
问题 I try to parse all the Calls and Rets from an executable with ptrace. Conforming the the x64opcode, I found opcodes for Calls: 0xe8 and for Rets: 0xc3, 0xc2, 0xca, 0xcb . Since I parsed them I found more Rets than Calls. There is the program I trace: void func() { write(1, "i", 1); } int main(int ac) { func(); return(0); } There is my tracer: int tracer(t_info *info) { int status; long ptr; int ret = 0; int call = 0; waitpid(info->pid, &status, 0); while (WIFSTOPPED(status)) { ptrace(PTRACE