Binary Decoder Reconstruction in C
Recreated a decoder from supplied binary artifacts and validated its behavior through iterative compilation and debugging.
Scope: I completed this as a technical interview exercise. I have omitted the original company's materials, challenge secrets, and step-by-step solution.
The problem
The assessment supplied binary artifacts and a decoder behavior to recover. Initial execution tracing gave partial insight but did not provide a complete, reusable decoding algorithm.
How I approached it
- Inspected the artifacts and experimented with Unicorn Engine to understand how the decoding logic ran.
- Used binary inspection and Ghidra pseudocode to identify data transformations and control flow.
- Translated the observed algorithm into C, fixed early runtime errors, and reran tests against the provided data.
Tools and techniques
Unicorn EngineCyberChefGhidraCLinux
Result
The reconstructed C program successfully decoded the intended challenge output. The result was a working local reproduction of program behavior, not a newly discovered security vulnerability.
What I learned
The first C translation needed debugging. Comparing intermediate values with the observed binary behavior was more useful than continuing to rewrite the entire decoder from scratch.