---
title: "An extra bit of analysis for Clemency"
description: "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."
url: "https://swe.quest/articles/an-extra-bit-of-analysis-for-clemency-5ce625cba91adff1"
canonical: "https://blog.trailofbits.com/2017/07/30/an-extra-bit-of-analysis-for-clemency/"
source: "Trail of Bits"
published: "2017-07-30"
difficulty: "hard"
kind: "Case study"
reading_minutes: 3
tags: ["vulnerability-research","developer-tools","python"]
---

# An extra bit of analysis for Clemency

A post on [Trail of Bits](https://swe.quest/sources/trail-of-bits.md), published 2017-07-30, 3 min read, Case study. Original: [https://blog.trailofbits.com/2017/07/30/an-extra-bit-of-analysis-for-clemency/](https://blog.trailofbits.com/2017/07/30/an-extra-bit-of-analysis-for-clemency/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Vulnerability research](https://swe.quest/tags/vulnerability-research.md) (Security)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- disassemblers
- instruction set architectures
- endianness
- Binary Ninja plugins

## Keywords

cLEMENCy, Binary Ninja, DEF CON CTF, LLIL, LegitBS

## Related posts

- [GPT-5.5-Cyber built a zlib fuzzing lab in a day](https://swe.quest/articles/gpt-5-5-cyber-built-a-zlib-fuzzing-lab-in-a-day-34216d52ce035220.md): Trail of Bits · 2026-07-02 · Medium · 5 min read · Vulnerability research, AI agents, Testing, Open source, C & C++
  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.
- [Copy Hunting](https://swe.quest/articles/copy-hunting-7c2f19f97f1f7edc.md): TigerBeetle · 2023-07-26 · Medium · 11 min read · Zig, Compilers, Performance engineering, Debugging, Developer tools
  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.
- [Reverse debugging at scale](https://swe.quest/articles/reverse-debugging-at-scale-38ad4795201fdcca.md): Meta Engineering · 2021-04-27 · Hard · 7 min read · Debugging, Developer tools, Hardware, Linux, Performance engineering
  Meta continuously records Intel Processor Trace (Intel PT) data for all running processes in production, keeping it in a bounded circular buffer.
- [What the interns have wrought, 2024 edition](https://swe.quest/articles/what-the-interns-have-wrought-2024-edition-b9d6cc4b73c67320.md): Jane Street Tech Blog · 2024-08-26 · Medium · 12 min read · Functional programming, Performance engineering, Debugging, Event-driven architecture, Analytics & OLAP
  Three 2024 Jane Street intern projects get a technical walkthrough.
- [A thousand fewer paths to root](https://swe.quest/articles/a-thousand-fewer-paths-to-root-c8474fd0ac7978f5.md): OpenAI · 2026-11-04 · Medium · 18 min read · Vulnerability research, Linux, AI agents, Security
  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).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
