Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Trail of Bits 3 min read Case study hardMaster

An extra bit of analysis for Clemency

cLEMENCy, the custom architecture used at DEF CON CTF 2017, was designed to break existing tools with 9-bit bytes, middle-endian storage and variable-length opcodes of 4 to 18 bits. Trail of Bits built a Binary Ninja processor module for it during the event. Each 9-bit byte was expanded to a 16-bit short, which doubled memory offsets. Opcodes were parsed by slicing bit strings in Python, and multi-register load/store instructions were expanded to show every register. A full LLIL lifter proved impossible because three-byte register widths and doubled addresses conflicted, but partial lifting was enough for dataflow-based string discovery. The plugins and pack/unpack script are released on GitHub.

Assumes: disassemblersinstruction set architecturesendiannessBinary Ninja plugins

Related posts

  • GPT-5.5-Cyber built a zlib fuzzing lab in a day

    Trail of Bits mediumAdept

    GPT-5.5-Cyber, driven through Codex's /goal command, independently chose dynamic testing over static review of heavily audited zlib and built a full fuzzing campaign in a day. It produced ASan/UBSan builds, seed corpora derived from existing edge-case tests, C/C++ harnesses across a dozen entrypoints (inflate, inflateBack, gzFile, MiniZip, puff, blast and more) and compile-time variant builds such as INFLATE_STRICT and BUILDFIXED. Its most productive harness reached valid gz* states that only arise under OS backpressure, and it yielded several findings now in coordinated disclosure. Strict validity rules for what counts as a reportable finding were key: the model logged an unreachable inflateBack null-callback crash and moved on. The recommendation is for defenders to run bespoke fuzzing first, because the expertise barrier to doing it has largely disappeared.

  • Copy Hunting

    TigerBeetle mediumAdept

    Reading Zig's emitted LLVM IR as plain text and grepping it is a practical substitute for staring at disassembly when chasing implicit memcopies and binary bloat. A small line-by-line tool, copyhound, flags large `llvm.memcpy` calls per function and also sums IR lines per generic function name to expose monomorphization blowup, the same idea as cargo-llvm-lines. In TigerBeetle it traced copies to `std.meta.eql`, which was replaced with a comptime-checked word-wise byte comparison. In the Zig compiler it found an inlined float-parsing slow path costing 10 KB of stack, fixed with `@setCold`. Making comptime parameters runtime in a version-printing function cut 300 bytes from the binary.

  • Reverse debugging at scale

    Meta Engineering hardMaster

    Meta continuously records Intel Processor Trace (Intel PT) data for all running processes in production, keeping it in a bounded circular buffer. An eBPF kernel probe notifies the collector within milliseconds of a crash, so the crashed process's trace is saved before other processes overwrite it. Traces and binaries are stored for offline analysis, where an LLDB plugin decodes taken and not-taken branches against the binary, symbolicates the executed instructions, and builds a function call tree that makes reverse-step-over and reverse breakpoints cheap. The same timestamped traces also support latency analysis that sampled call stacks miss, with visualization planned for Meta's Tracery tool and VSCode.

  • What the interns have wrought, 2024 edition

    Jane Street Tech Blog mediumAdept

    Three 2024 Jane Street intern projects get a technical walkthrough. Camels is a pure-OCaml, Polars-like dataframe library that separates expression construction from execution so queries can be compiled, and it uses a phantom-typed length parameter to catch missing broadcasts at compile time. A speed-over-size variant of Binprot drops variable-length integer encoding so adjacent non-pointer record fields can be memcpy'd, built on typerep with custom C bindings; it ran 10-20% to 15x faster than Binprot and cut production tail latencies by 30-65%. A time-travel debugger for the Aria-based Limshare risk-limit system adds periodic snapshots so engineers can step backward through the update log when investigating incidents.

  • A thousand fewer paths to root

    OpenAI mediumAdept

    An autonomous five-stage pipeline (scouting, static analysis, KASAN-based dynamic validation, exploit development, patch generation, then human review) scanned the Linux kernel and produced 948 distinct working local privilege escalation exploits plus 291 info-leak PoCs from 2,308 candidate findings, at about $1.2M in API cost (~$1,279 per LPE). Scout agents narrowed the audit to 7% of the kernel, triage agents reproduced 74.7% of candidates with only 3.1% reflecting incorrect analysis, and exploits were developed against SMEP, SMAP, KASLR and HARDENED_USERCOPY. Because validation costs similar amounts for true and false positives, filtering false positives early is the main cost lever. The practical takeaway is to treat unpatched low-privilege access as effectively root, invest in sandboxing such as Firecracker and gVisor, and plan for automated patch generation and repeated scans with each model generation.

The quest for software engineering knowledge.

Look:
Layout: