ptrace and strace
TL;DR
- summary
- ptrace
- tracee call ptrace(PTRACE_TRACEME) to set process status to PT_PTRACED
- tracee enter syscall execute ptrace hook tracehook_report_syscall_entry notify tracer
- tracee exit syscall execute ptrace hook tracehook_report_syscall_exit notify tracer
- strace
- tracee call ptrace set process status to PT_PTRACED [5]
- strace call wait tracee resume
- strace call ptrace to get tracee registers and memory [6][7]
- strace parse syscall name according to register value
- strace print syscall argument, such as: open
links: