LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
Reverse engineering foundations
LESSON 2 OF 3 · ABOUT 15 MINUTES + EXERCISE

What is the difference between static and dynamic analysis?

THE IDEA

What it is

Static analysis inspects binary files without executing them, examining headers, strings, import tables, and decompiled control flow. Dynamic analysis runs the binary in a controlled environment, observing runtime memory, register values, system calls, and network traffic.

Why you need it

Static analysis gives broad structural visibility and works even on incomplete code, but can be hindered by obfuscation or packers. Dynamic analysis proves what actually happens at runtime, but only covers executed code paths. Combining both yields defensible findings.

How it works

  1. Start with rapid static triage: inspect file format, strings, and imported library functions.
  2. Formulate a specific question about program behavior or a sensitive operation.
  3. Set up an isolated execution environment with logging and breakpoints.
  4. Run under a debugger or tracer to observe real parameters and memory changes.
Shell commands

Static string extraction vs dynamic system call trace

# 1. Static extraction (inspect without running)
strings ./unknown_binary | grep -E "https?://"
readelf -d ./unknown_binary    # Inspect dynamic dependencies

# 2. Dynamic tracing (observe actual OS interactions)
strace -e trace=openat,connect,write ./unknown_binary

Strings reveals potential endpoints or formatting strings embedded in the binary. Running under strace confirms which files and network sockets the binary actually attempts to access during execution.

Good practices and why

  • Always perform static triage first to identify suspicious imports, URLs, and file operations before running unknown code.
  • Document clear hypotheses before stepping into a debugger so you do not get lost in thousands of assembly instructions.

Common mistakes

  • Executing an untrusted binary on your primary workstation without isolation.
  • Assuming a string found in a binary is definitely executed or trustworthy evidence of behavior.
GUIDED IMPLEMENTATION

Try it yourself

Run strings on a utility on your system (like /bin/ls), find an error message, then use a debugger or strace to force or observe that code path being exercised.

What a successful result looks like

You can explain one observation made statically and one observation confirmed dynamically for the same utility.

0 / 6000 characters · Saved on this device. Do not include passwords or private data.

Check your understanding

What is a major limitation of purely dynamic analysis?

Answer the understanding check correctly to record exercise completion.

PUT THE IDEA UNDER PRESSURE

Related interview practice

These scenarios add constraints and follow-up questions to the concepts you just learned.

Further reading

Selected primary references · reviewed 2026-10-09. Examples are educational; use your framework’s documented integration guidance when building a deployed system.

AlifBay Prep