Lion Cipher Lab

Diff two builds of a program to find what a patch fixed, with rizin

Why it matters

When a vendor says 'we fixed a memory safety bug' they rarely say where. Analysts compare the old and new binary to find out, which is called patch diffing. Defenders use it to answer practical questions: does this update really cover the flaw, does my older build contain the vulnerable code, and is the fix complete or only partial? The same skill helps you check a supplier's claim yourself. Doing it on code you wrote means you can see exactly what you should find.

What you'll learn

Steps in this lab

  1. What patch diffing is, and the rule that keeps it honest
  2. Build v1 (unsafe copy) and v2 (length check), then strip both
  3. Start with the cheap comparisons: sections, imports and strings
  4. Diff every function and read the similarity labels
  5. Zoom into the changed function: its address, graph and disassembly
  6. Prove the noise rule: change the compiler flags and diff again
  7. Does this build have the fix? Test an unknown copy
  8. When NOT to use this, and how a pro does it better

Open the full interactive lab →

Keep learning