Retrieved article excerpt
Open article · Retrieved 2026-11-04T09:22:57.086857+00:00
Software
# Reverse Engineering, With Receipts
An open-source tool that hands disassemblers to AI agents made a big splash in October. We had agents at the controls months earlier, along with a rulebook, a ledger and a short list of things we will not read.
4 November 2026·14 min read·[Software](https://insanely.digital/category/software/)
A beige compact Mac on a workbench with medical electrode pads on its top and side, their leads plugged into a battered old patient monitor showing a lime-green trace, with a stethoscope pressed to the Mac's front and a strip of chart paper running from the monitor across the bench.
In October, a project called [Reverse Engineer Anything](https://github.com/morluto/rea) had the kind of month most open-source projects only dream about. REA is an MCP server: it lets an AI coding agent drive Ghidra, Hopper, IDA and a long list of other inspection tools, so the agent can query a disassembler, follow cross-references, test a hypothesis against a binary and report back with evidence. [InfoQ covered it](https://www.infoq.com/news/2026/10/reverse-engineer-anything/) on 17 October. At the time of writing, its README thanks people for 400,000 GitHub stars.
We read the coverage with a very particular feeling. It is the one you get when a song your band has been playing in a pub since the spring turns up on the radio.
We have been reverse engineering classic Macintosh formats since April 2026. Since July, our agents have been driving emulators and a disassembler over MCP. None of that makes us first at anything, and REA is a far broader tool than ours. But it does mean we have had several months to find out that the tooling is the easy part.
## The tool is the easy part
REA’s own README is admirably clear about who carries the risk. It is for “lawful research, education, interoperability, software preservation, and analysis of software you own or are authorized to examine”. InfoQ adds that users are responsible for getting authorisation and for complying with the law. That is exactly right, and it is also where the interesting question starts. What does discharging that responsibility actually look like, day after day, with agents doing the work?
Our answer is unglamorous. It is a set of house rules that every agent reads before it touches a binary, and a ledger that records where every fact came from. This post is about both, and about the rig they govern.
A short disclaimer before the long post: we are not lawyers, and nothing here is legal advice. What follows is how we work and why. The point of writing it all down is that someone who *is* a lawyer can check it.
## What we are for
Disk Phoenix reads classic Macintosh disk images, and [the Phoenix apps around it](https://insanely.digital/old-over-new/) are meant to open the files on them. The formats are almost all dead, frequently undocumented and occasionally actively mysterious. (For the full flavour, see [Nobody Wrote It Down](https://insanely.digital/nobody-wrote-it-down/).)
So every piece of reverse engineering we do is interoperability work. We are finding out how an existing file format or wire protocol is laid out, so that a program we write ourselves can read files that already exist. Before an agent starts, it has to be able to say yes to three things:
1. **The object is functional facts:** field offsets, bit layouts, opcodes, message grammars. We are not after a program, and we are not after anyone’s artwork, text or sounds.
2. **The information is not readily available.** We looked, and we wrote down what we found.
3. **The result is independently written**, and does not stand in for the original as a piece of creative work.
Those three tests aren’t decoration. They follow the shape of the law we are relying on: the US cases that made disassembly for interoperability fair use (*Sega v. Accolade*, *Sony v. Connectix*), and the UK and EU right to observe, study and test a program, and in narrow conditions to decompile it. Every one of those exceptions is drawn around interoperability. Step outside it and none of them helps.
If one of the three answers is wobbly, the work stops.
## Search first
The second test has a practical consequence that is easy to skip and expensive to get wrong. Before anyone opens a disassembler, someone searches for prior art: a published specification, a Technical Note, a write-up, a permissively licensed implementation.
This is not politeness. In the UK and EU, “not readily available” is a precondition of the right to decompile. It is not a formality, and the search is also simply good engineering. We learned the hard way that the search has to be per algorithm, not per project. That story, and the two days it cost, are in [Nobody Wrote It Down](https://insanely.digital/nobody-wrote-it-down/).
When the search succeeds, we use what we found, credit it, and ship its licence notice. When it fails, we write the negative down too. “We looked, and here is where” is evidence. “We didn’t find anything” is just a mood.
## Ask the machine, not the code
The biggest difference in how we work isn’t a rule. It is the instrument we reach for first.
REA points an agent at a disassembler, which shows you what a program *is*. Our first move is usually to run the original software and watch what it *does*.
So the heart of our rig is emulation, with agents at the controls:
- **[Snow](https://snowemu.com/)**, a classic Macintosh emulator, behind an MCP server of our own with 68 tools. Agents boot real System software from genuine ROMs (and yes, we own a real example of every Mac we emulate), insert floppies, attach SCSI disks, type, click, take screenshots, read memory and set breakpoints on Toolbox traps by name.
- **QEMU**, behind a second MCP server, for Mac OS 9 on PowerPC.
- **A Mac mini on macOS 10.13**, kept deliberately old, because it is the last macOS that still reads standard HFS volumes and it lets us automate the GUI without per-app permission prompts. It is one of the few machines in the world whose job description includes “never update”.
- **The original applications**, some imaged from period disks we own (boxed retail copies, and magazine cover discs) with an Applesauce, a Greaseweazle and [a plain USB floppy drive](https://insanely.digital/a-1991-floppy-mounted-in-macos-27/), the rest downloaded from online archives. We never crack a serial number or a registration check: where an app asks for one, we enter a licence we own.
Watching a program run gives you facts about behaviour, and facts about behaviour are what interoperability needs. For a recent example, see [The Letters Apple Never Shipped](https://insanely.digital/the-letters-apple-never-shipped/). There we read Vietnamese font tables by installing 1990s fonts on an emulated Mac and writing down what it drew, byte by byte. And there is a pleasing robustness to it. The emulated Mac has no opinion about our theory. It just draws what it draws.
## When we do open the binary
Sometimes watching isn’t enough, and we do disassemble. We are not purists about that. Disassembly done for interoperability, after a search has come up empty, is the kind of work the interoperability exceptions exist for.
Our favourite example is Apple’s resource compression. System 7 compressed resources with four schemes, and Apple never documented any of them. Three already had public write-ups and an MIT-licensed implementation, so we used those, with the licence notice shipped. The fourth, `dcmp` 3, had no public implementation at all. So we took Apple’s own 7,696-byte `dcmp` 3 code resource out of the System file on a Mac OS 7.6 disk and disassembled it with our own tool, classicdis.
Inside was a table of thresholds following a tidy rule, except for two that didn’t. One reads `0x66C` where the pattern says `0x680`. The tempting move is to tidy it. That would be a mistake, because Apple’s *compressor* used the same table, so every file compressed by that code depends on the anomaly. The odd value isn’t a bug in the format. It *is* the format.
We carried the values into our Swift code exactly as the binary has them, anomaly included, and pinned them with a test so nobody tidies them later. They are not the kind of table our rules keep out. Those are another implementation’s choices about how to express something; these numbers are the format itself, and a decompressor given any others produces the wrong bytes. All 15,756 compressed resources in our test corpus now expand.
A constant that has to be wrong in exactly Apple’s way in order to work is about as purely functional as a fact gets. We find that rather lovely.
## Watching the wire
We started stricter than we ended. Our first rule was absolute: never read anyone else’s source code, full stop. We tried that on our QDesign Music decoder, and to be fair, it held. The codec was identified and one of its tables derived without anyone opening the reference decoder’s source. But it was stricter than our own standing rules, which already allowed reading other people’s code for ***facts*** as long as none of it was copied. It also ruled out something perfectly harmless: adding a few print statements to that decoder and reading the numbers.
And it had a name. The notes we wrote that July called it a “clean-room boundary”. We have since banned the phrase (more on that below). After several rounds of reverse engineering, we paused to check whether clean-room language had crept into how we describe our own work. It had. It’s an easy path to take: the phrase sounds like exactly the right thing to say. Those July notes, and a handful of other files, had drifted into that territory, borrowing the label for work that was never two-team. So we corrected course, deliberately. All of them are fixed now.
On 29 July we replaced it with something more precise. It is the most important sentence in our rulebook, and agents are told to quote it rather than paraphrase it:
> **Trace yes, transcribe no.** A third-party implementation may be run, and may be instrumented to emit numeric traces. Those numbers are observations and may be used freely. What may not cross over is expression: its structure, its control flow, its function decomposition, its tables.
The idea came from [our AppleTalk work](https://insanely.digital/two-emulators-one-wire/), where we learn protocols by watching packets go by on the wire. A packet capture records what happened. It doesn’t copy the thing that made it happen. A decoder printing its intermediate values is the same act.
What crosses the line
### **✓** Safe
What you do
: Run it and record what it outputs, or print its intermediate numbers
What crosses over
: Facts about behaviour: values, lengths, orderings
What it establishes
: Two independent implementations agree
### **×** Tainting
What you do
: Read its code, understand its design, write new code that follows it
What crosses over
: Expression: structure, control flow, tables
What it establishes
: Nothing independent; the second copies the first
The two produce commits that look identical. The difference is what crossed over: a record of what happened, or the thing that made it happen.
The rule matters most at exactly the moment REA makes easy. Decompiled pseudo-code is very readable, and an agent that has just read it will cheerfully write new code in the same shape. So our policy carries a blunt test: if the code you are writing mirrors the shape of what you just read, you have crossed the line. Stopping is a permitted outcome, and so is escalating to a human. Peeking first and asking forgiveness later is not.
## Four kinds of constant
Every table that ships in our code gets a label for where it came from:
- **Derived:** we can regenerate it from a rule, a probe or a measurement, and the generator is recorded.
- **Functionally dictated:** it has to be exactly this to interoperate, like that `dcmp` threshold.
- **Prior art under a compatible licence:** tak