Binary Bomb Lab – All Phase Types ( 6 regular phases + 1 secret phase )
Binary Bomb Lab – All Phase Types
A reference guide for every phase variant used to generate randomized bomb instances in the standard Binary Bomb Lab.
Phase 1 — String Comparison
Variants: 1a · 1b · 1cThe simplest phase. The bomb calls strings_not_equal() to compare the user's input against a randomly chosen secret string stored in .rodata. All three variants share identical logic — only the string itself differs.
| Variants | Mechanism | Key Skill |
|---|---|---|
| 1a / 1b / 1c | Input must exactly match a hardcoded string | Read string literal from binary with strings_not_equal |
Phase 2 — Numeric Sequences
Variants: 2a · 2b · 2cEnter six space-separated integers satisfying a mathematical rule. The bomb uses read_six_numbers() (a wrapper around sscanf) and validates each element in a loop.
| Variant | Rule | Example Answer |
|---|---|---|
| 2a | x[i] = x[i-1] + i, x[0] ≥ 0 |
2 3 5 8 12 17 |
| 2b | x[0] = 1, x[i] = x[i-1] × 2 (geometric) |
1 2 4 8 16 32 |
| 2c | x[0]=0, x[1]=1, x[i] = x[i-1] + x[i-2] (Fibonacci) |
0 1 1 2 3 5 |
Phase 3 — Jump Table (Switch Statement)
Variants: 3a · 3b · 3cA long switch statement compiled into a jump table. Supply a table index plus the value(s) produced by the selected branch.
| Variant | Input Format | Key Challenge |
|---|---|---|
| 3a | <index> <value> |
No fall-through; each case assigns a single constant — find it for the given index. |
| 3b | <index> <sum> |
All cases fall through to end; the sum accumulates additions/subtractions from the selected case downward. |
| 3c | <index> <char> <num> |
Each case checks both a letter and an integer; must supply all three values. |
Phase 4 — Recursive Functions
Variants: 4a · 4b · 4cEach variant wraps a different recursive func4. The bomb embeds a random target value; you must reverse-engineer the function to find the input that produces it.
| Variant | func4 Returns | Defusing Strategy |
|---|---|---|
| 4a | Sum of all node indices visited during binary search over [0–14] | Enumerate all 15 possible inputs; find the one whose path-index sum matches the embedded constant. |
| 4b | 3-bit path code (0 = left, 1 = right, LSB = first turn) | Decode the embedded path bits by following the BST; read the target leaf value. |
| 4c | Generalized Fibonacci: F(n,b) = b + F(n-1,b) + F(n-2,b) |
Given a random n, choose any valid base b, compute F(n,b), and enter both. |
Phase 5 — Array Indexing via Character Bits
Variants: 5a · 5b · 5cAll three variants use the low 4 bits of each input character (c & 0x0f) as an index into a 16-element static array. The goal differs per variant.
| Variant | Array Type | Constraint |
|---|---|---|
| 5a | Integer pointer chain | Starting at offset p, follow the chain until reaching index 15 in exactly k steps; also enter the cumulative element sum. |
| 5b | 16-char alphabet array | Enter 6 characters so that array[c & 0x0f] for each spells the target word (e.g., devils, flames…). |
| 5c | 16-integer array | Enter 6 characters so that the sum of the six indexed integers equals the embedded target sum. |
Phase 6 — Linked List Sorting
Variants: 6a · 6b · 6cEnter a permutation of six node numbers (1–6). The code re-links the list in that order and checks whether the resulting list is sorted correctly. Variants differ in sort direction and whether the permutation is inverted first.
| Variant | Expected Order | Extra Twist |
|---|---|---|
| 6a | Ascending ↑ | None — enter the permutation that sorts values ascending. |
| 6b | Descending ↓ | None — enter the permutation that sorts values descending. |
| 6c | Descending ↓ (post-inversion) | Code applies idx → 7 − idx before re-linking; supply the ascending permutation — the inversion handles the rest. |
Phase 7 — Secret Stage (Binary Tree)
Variant: 7 (single)The secret stage unlocks only after defusing Phase 6 and entering a special trigger string appended to the Phase 4 answer. The bomb contains a balanced binary tree of 15 nodes.
| Component | Description |
|---|---|
| Input | A single integer in the range [1, 1001] |
fun7() |
Recursively searches the tree; encodes the traversal path (0 = left, 1 = right, LSB = first branch) |
| Validation | The computed path code must equal a randomly embedded target path constant |
| Strategy | Read the target path from the binary; trace each bit through the tree from root to find the matching leaf value |
SECRET_PHRASE token. Append this phrase to your Phase 4 answer line — the bomb's phase_defused() function checks for it and calls secret_phase() if found.

Comments
Post a Comment