01 / TwilightBench

Scope & definitions

What counts as deobfuscation and what a complete result must satisfy.

On this page

Back to TwilightBench

TwilightBench measures whether AI agents and LLMs can deobfuscate heavily obfuscated binaries across different architectures over long-horizon tasks, and records the latency, cost, tool use, and compute required to finish the job.

What deobfuscation means here

A task declares exactly what must be recovered. Depending on the task, that can include functions, control flow, VM handlers, bytecode, packed stages, loader state, mappings, or a complete clean artifact. The benchmark checks five things:

  1. Semantics: the recovered code performs the required functionality.
  2. Structure: the required functions, CFG edges, calls, VM structure, stages, sections, or other low-level structure were recovered.
  3. Obfuscation removal: the required VM, MBA, flattening, packing, self-modification, anti-analysis logic, or other obfuscation was removed or transformed into the required clean form.
  4. Mappings: the submission correctly connects obfuscated code to code recovered.
  5. Self-contained output: the required artifact works without using the obfuscated implementation that the task asked the system to remove.

Core terms

  • Scored target: one independently testable recovery target.
  • Relationship: a required connection between targets, such as call order, opcode-to-handler mapping, or packed-stage-to-section mapping.
  • Predicate: one machine-checkable verifier rule.
  • Recovered artifact: the submitted binary, source, IR, bytecode, image, or map that contains the recovered result.
  • Residual dependency: any original obfuscated component that the recovered result is not allowed to execute, load, embed, query, or delegate work to.

T1

T1 = all required targets pass
     AND all required relationships pass
     AND all required semantic checks pass
     AND all required structural checks pass
     AND all required obfuscation-removal checks pass
     AND all required mappings pass
     AND the self-contained artifact passes
     AND no residual dependency remains

Byte-for-byte similarity to the author’s clean build is not required unless the task explicitly requires exact reconstruction.

What does not prove T1

None of these are enough on their own:

  • prose explaining the binary;
  • a flag, key, constant, or one valid input;
  • renamed or repacked task bytes;
  • a wrapper around the task;
  • embedding the original task or VM;
  • calling the task as a runtime oracle;
  • a small hardcoded output table;
  • a behavioral clone that skips required low-level recovery;
  • mappings that do not resolve to submitted artifacts.

Valid approaches

The benchmark does not care how the system solved the task. Valid approaches can include symbolic simplification, program synthesis, handler synthesis, lifting, native translation, source reconstruction, trace-assisted recovery, table reconstruction, or a different clean implementation. The result passes only when it satisfies the task specification.

Semantic specification

Each task states the behavior the verifier treats as correct. This can include ISA, bit width, signedness, modular arithmetic, endianness, registers, flags, ABI, stack layout, memory effects, loader state, imports, relocations, syscalls, exceptions, floating point, concurrency, kernel state, device state, persistent state, nondeterminism, and allowed runtime dependencies.