LLM assisted reverse engineering

Open original

The author, a veteran hardware and software hacker, walks through how they use AI agents with Ghidra, radare2, and Python/Rust tooling to reverse engineer devices and software far faster than they could by hand. The post pairs a workflow (documentation files, a hypothesis-testing loop, probes and logging) with a list of projects like custom synth firmware and camera control apps.

  • The workflow has the agent document findings in markdown files and run a hypothesis loop (state a guess, design an experiment, record the result) to stop it going in circles.
  • The author uses DeepSeek with Ghidra's MCP bridge, and says current models handle raw x86 or ARM disassembly reasonably well.
  • Claimed results over six months include firmware for Arturia MiniFreak, Teenage Engineering OP-Z, and Akai MPC Sample, plus wireless control of Sony Alpha cameras.
  • The author stresses that human expertise is still needed to steer agents away from narrow, unproductive approaches by reading their reasoning traces.

The author, who has been reverse engineering hardware and software for about two decades, now runs most of the work through LLM agents. The setup is DeepSeek (v4.1 Flash, inside a "DeepSeek Harness") as the main model, with Codex occasionally used as a backup. Ghidra with an MCP bridge handles decompilation, while radare2 and "kuna" serve as faster CLI tools that the author finds easier for an AI to drive. The workflow starts by pointing the agent at a binary, identifying its type and platform, and having it write everything it learns into markdown files. Those notes serve the author as reference, help the agent recover after context compaction or a handoff to another agent, and keep it from circling. From there the agent maps the main functions, branching, and imports. When static analysis stalls, the author has the agent set breakpoints, add logging (either built into the binary or through injected probes), give it computer-use or emulator control, or steer it to a different approach, such as following strings instead of cross-references. He stresses that reading the agent's reasoning traces is essential, since models still tend to fixate on a narrow path and a human needs to spot that. Two custom skills do most of the heavy lifting. A "Grill me" skill, borrowed from Matt Pocock, makes the agent ask targeted questions when the human's input would help. A tooling skill describes how to use Ghidra, radare2, and the MCP bridge, because without it agents tend to give up early. The author's own "hypothesis debugging" skill forces a loop: write a hypothesis into a CSV file, design an experiment that can definitively confirm or refute it, record the result, and repeat. He says this stops the agent from guessing at random, and he has published it publicly. For implementation he uses Python with uv for quick probes and decompilation helpers, and Rust for the final hacks, mainly because the strict compiler gives the agent fast, precise feedback and because Rust is a language he enjoys. He admits Rust's slower compile times are a cost. The results he lists are specific: reverse engineering the AlphaSmart NEO typewriter; mapping the communication protocols of an EmWave biofeedback device and two Sony A7III cameras, which led to custom desktop and mobile apps and a wireless webcam built from the A7III; custom firmware for the Arturia MiniFreak, Teenage Engineering OP-Z, Akai MPC Sample, and Xteink X4 ebook reader; a fixed macOS driver for an old HP printer; cracks of abandonware from his youth; a lightweight Evernote client; and a personal photo editor built from a decoded proprietary save format. He estimates that each of these would have taken years by hand. The piece is more a hobbyist's workflow report than a technical paper, and its most useful points are the concrete loop of notes, hypotheses, and experiments, plus the warning that the human still has to read the agent's reasoning to catch it going down a blind alley.

Ask about this article