PROJECT DOSSIER // [STRACE]VIEW SOURCEBACK TO PROJECTS →

01 // PROJECT AT A GLANCE

STRACE

C

Spying on everything a program asks the operating system for.

A program cannot do anything useful — read a file, print text, open a connection — without going through the operating system. This tool intercepts and prints each of those requests in real time. It is one of the most powerful diagnostic instruments on Linux, and re-coding it amounts to understanding the exact boundary between a program and the kernel.

An strace clone: the tracer advances the child process step by step with ptrace, spots the syscall instructions in the execution stream itself, decodes the number and arguments from the registers using a table of the 385 system calls, and prints the return value with its symbolic errno (hexadecimal mode by default, detailed with -s).

PRIMARYC
DELIVERYTEAM RECORD
VERIFICATIONmake
SOURCEINSPECTOR READY
MEDIA ATTACHMENTS (Images, Photos, Videos)

03 // KEY OUTCOMES

  • System calls spotted by hand in the instruction stream, PTRACE_SYSCALL being forbidden by the subject
  • Reading another process's memory to reconstitute the strings passed as arguments
  • Error returns translated into errno constants and readable messages

04 // SOURCE TREE

READING SOURCE…