Lion Cipher Lab
Diff two builds of a program to find what a patch fixed, with rizin
- Digital Forensics & IR (DFIR)
- Advanced
- ~90 min
- Free · no account required
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
- building two versions of a program and stripping symbols so you work like an analyst with a vendor update
- using rz-diff to compare sections, imports and strings between two binaries
- using rz-diff -t functions and reading its similarity labels (COMPLETE, PARTIAL, UNLIKE)
- selecting one function by address and comparing it with rz-diff -t graphs
- reading the disassembly of a function in rizin with pdf and spotting an added length check
- explaining why compiler options create diff noise and why you compare builds from the same toolchain
Steps in this lab
- What patch diffing is, and the rule that keeps it honest
- Build v1 (unsafe copy) and v2 (length check), then strip both
- Start with the cheap comparisons: sections, imports and strings
- Diff every function and read the similarity labels
- Zoom into the changed function: its address, graph and disassembly
- Prove the noise rule: change the compiler flags and diff again
- Does this build have the fix? Test an unknown copy
- When NOT to use this, and how a pro does it better
Open the full interactive lab →