Concepts · deobfuscation
LLM deobfuscation explained
LLM deobfuscation works on bogus control flow and fails on instruction substitution and combined techniques, in a 2025 evaluation of seven commercial models.
On this page
Techniques
| Technique | What it does | What helps |
|---|---|---|
| Opaque predicates | Adds branches that never change | A model spots them. A solver proves them |
| Control-flow flattening | One loop and a state dispatcher | Recover the states, then the flow |
| Instruction substitution | Simple operations rewritten as long arithmetic | A solver. Models struggle |
| String encryption | Strings appear only at runtime | Run the decryptor in the lab |
| Import hashing | APIs resolved by hash | Resolve the hashes with a script |
| Packing | The real code is encrypted on disk | Unpack, then analyze the dump |
| Virtualization | A custom bytecode interpreter | Map the handlers first |
Research
A 2025 study tested seven commercial models on assembly obfuscated four ways. Results ranged "from autonomous deobfuscation to complete failure". Resistance was low for bogus control flow, moderate for control-flow flattening, and high for instruction substitution and for all three combined, with "universal failure against combined techniques".
Workflow
- Clean up with tools first. Unpack, decrypt strings, resolve import hashes and simplify arithmetic with a solver. The ida-pro-mcp README says to do this before an LLM sees the code.
- Give the model the cleaned function and the dispatcher, and ask for the states and transitions.
- Have it rebuild the structure and mark every unsure transition.
- Check it in a debugger on real inputs, in the lab.
Kimi K3.1 Pro holds 1,048,576 tokens, so a flattened function fits in one request.
Scope
Authorized work only, on your own systems, a scoped engagement, a CTF or a lab. No exploits, payloads, malware or detection-evasion steps.