TL;DR
Traditional binary deobfuscation relies heavily on decompiled pseudocode, which frequently suffers from severe semantic and type loss. To overcome this, BINMIRROR introduces a paradigm shift by reframing deobfuscation as a behavior-specification-guided program synthesis task. By combining dynamic tracing, noise filtering, and LLM-based code generation with iterative differential testing, BINMIRROR achieves a remarkable 74.5% unit-test pass rate under extreme obfuscation, significantly outperforming state-of-the-art baselines.
What Problem Does This Paper Address?
When security analysts reverse-engineer malware or stripped binaries, they rarely have access to the original source code. The standard workaround is to decompile the binary into C-like pseudocode and apply structural transformations to clean up the obfuscation (like dead code or control-flow flattening).
However, the compilation and decompilation pipeline introduces a massive "semantic gap." High-level context—such as variable types, data structures, and exact control flows—is often lost or mis-recovered. As shown in the paper's motivating example, a standard 8-bit integer overflow check can be completely optimized away or misinterpreted by a decompiler as an impossible condition, leading static deobfuscators to erroneously delete critical security checks.
Methods
Instead of fixing flawed static pseudocode, BINMIRROR shifts focus entirely to observable execution behavior. Even if an obfuscator scrambles a program's internal syntax, the program must maintain its original runtime behavior and side effects to function correctly.
BINMIRROR operates via a four-stage pipeline:
- Behavior Specification Capture: Uses syscall-guided greybox fuzzing paired with dynamic binary instrumentation (DBI) to monitor critical system calls (like file I/O or network operations). It captures snapshots of the exact CPU registers and memory states ($B_{spec}$) at these interaction boundaries.
- Specification-Driven Noise Filtering: Scans the dynamic execution trace backward from the system call. It uses trace-enhanced backward data-flow slicing to strip away behavior-irrelevant "junk" instructions, such as opaque predicates or flattened dispatcher updates.
- Specification-Guided Code Synthesis: Feeds the purified instruction slice and the I/O state constraints into a Large Language Model (LLM). The LLM acts as a "semantic lifter," translating low-level assembly effects into structured, readable C code.
- Test-Based Behavioral Validation: Executes the synthesized candidate code inside a Unicorn-based emulator to perform differential testing against the original binary. If any behavioral discrepancy is found, a closed-loop feedback mechanism passes the error back to the LLM for iterative refinement.
Datasets
The authors evaluated BINMIRROR using two distinct datasets:
- Synthetic Benchmark: Built from 1,573 non-trivial C/C++ programs from CodeNet. These were compiled across four architectures (x86, x64, ARM, MIPS) and four optimization levels (O0–O3), and heavily scrambled using four industry-standard obfuscators (O-LLVM, Hikari, Tigress, Alcatraz) across 63 configurations. This yielded a massive dataset of 1.5 million unique obfuscated binaries backed by ground-truth source code and unit tests.
- MalBench: A real-world evaluation set consisting of 500 active Linux obfuscated malware samples (collected from VirusShare and MalwareBazaar between 2023 and 2025) spanning aggressive malware families like Mirai and Gafgyt, alongside 500 benign Linux executables.
Key Insights and Ideas
- Behavior as an Empirical Anchor: The core "aha moment" is that runtime side effects (modifying non-local variables, memory updates, I/O operations) provide an unyielding factual constraint. Scrambled syntax doesn't matter if the inputs and outputs match perfectly.
- LLMs as Constraint-Guided Generators, Not Solvers: LLMs struggle to statically "solve" complex obfuscation primitives like Mixed Boolean-Arithmetic (MBA) or control-flow flattening. However, when they are given a clean data-flow slice and strict input/output state boundaries, their ability to infer high-level code structure shines.
- Slicing is Mandatory Noise Control: The ablation study revealed that feeding raw execution traces directly to an LLM causes a catastrophic drop in performance. Slicing out the dispatcher logic and junk instructions is absolutely vital to keeping the context window manageable and accurate.
Key Results
BINMIRROR was pitted against traditional static tools (Ghidra, D810, GooMBA), symbolic execution frameworks (ANGR, Syntia), and advanced LLM pipelines (ChatDEOB, GPT-4o).
- Extreme Obfuscation Resilience: Under the most severe obfuscation level (L6), BINMIRROR achieved a 74.5% unit-test Pass@1 on the synthetic benchmark. The closest domain-specific baseline, ChatDEOB, managed only 20.2%, while traditional symbolic and static tools dropped to near 0%.
- Real-World Malware Deobfuscation: On the MalBench dataset, BINMIRROR achieved a 65.8% Execution Success Rate (ESR), outperforming ChatDEOB by 29.3 percentage points.
- Downstream Utility Boost: To prove its practical worth, the authors integrated BINMIRROR into a Control Flow Graph (CFG)-based Linux malware detector (HawkEye-Linux). Deobfuscating the binaries with BINMIRROR prior to analysis boosted the detector's accuracy by 33.3% and its F1-score by 37.1% compared to analyzing the raw obfuscated binaries directly.
Limitations and Future Work
Despite its strength, BINMIRROR has a few notable limitations:
- Observation-Bounded Validation: The approach relies on executed paths. If a specific input or malicious trigger is never reached during the fuzzing/exploration phase, its behavior cannot be captured or synthesized. It does not guarantee full mathematical semantic equivalence across all possible inputs.
- The "Long Slice" Problem: When a behavior-relevant instruction slice exceeds 250 to 500 instructions, the synthesis success rate drops sharply (down to 21.6% for >500 instructions) due to dense assembly dependencies and LLM context window degradation.
- OS Scope: The current prototype is heavily tailored to Linux and POSIX system calls. Extending it to Windows or macOS would require significant engineering to capture OS-specific user-mode library boundaries and Native APIs.
The authors suggest that future work should explore hierarchical chunking strategies to break down large dependency graphs, alongside improved pointer-alias modeling to capture elusive implicit memory dependencies.
Summary updated