amiga-re-kit

Measure the original before you touch it.

Tools for reverse engineering Amiga floppy games, extracted from three finished projects. Entropy maps, packers, a strict 68000 decoder and recompiler, headless emulator captures — and an MCP server so an assistant can hold the same instruments.

pip install amiga-re-kit then arek adf map disk.adf does the same from the terminal.

1760 sectors, 160 tracks, 4 tracks per rowno disk loaded
emptysparsecode / datadensepacked
Load a disk image to see: size and SHA-256, boot block type and checksum, regions by track, packer signatures (PP20, RNC, ATN!, IMP!, …) and Bytekiller blocks verified by their own checksum — the output of `arek adf info` and `arek scan`.

The method

Each step produces a measurement the next step is checked against. Nothing downstream rests on a guess, which is why documents built this way can be trusted by someone who has never seen the game.

  1. Inventory the image

    Size, SHA-256, boot block. Every later claim refers to this exact image; cracked dumps differ.

  2. Look before reading: the entropy map

    Where the code is, where the packed blob is, how many files there probably are — before one instruction is decoded.

  3. Boot chain and packers

    Walk the boot block, follow the trackloader to the next stage, find packers by signature or by reading the decrunch routine. Verify each unpacker byte for byte against the emulator's RAM.

  4. Find the catalogue through the code

    Read the file table the way the loader reads it. Data formats have many plausible readings; code has one.

  5. The hardware boundary

    Which routines are pure computation and which really drive Agnus, Denise and Paula. Usually most of a game is the former.

  6. Recompile and verify

    68k to C, routine by routine, run on a RAM capture of the original and compared with a capture taken after. Equal or not done.

  7. Check against the real thing, not your eyes

    Deterministic screenshots from the headless emulator at known times, with scripted input, as regression checkpoints.

The long version with commands: docs/METHOD.md. The headless vAmiga setup: docs/HEADLESS.md.

What's inside

modulewhat it doescame from
arek.adfgeometry, boot block checksum, entropy map and regions, inventory recordnew
arek.packersPowerPacker 2.0, Bytekiller B and the SWIV word-stream variant, Turrican II three-stage; brute-force scan with verificationSWIV, Turrican II
arek.hunkbounded AmigaDOS HUNK reader: CODE/DATA/BSS, RELOC32, split streams; a builder for small probesSuperfrog
arek.coppercopper list disassembler with custom register namesSWIV
arek.m68k.decoderstrict 68000 decoder that raises on anything it does not model; flow-graph walker that reports frontiersSuperfrog
arek.m68k.hwscanpure-RAM routines versus hardware routines, with unknown address-register bases kept explicitTurrican II
arek.m68k.recompstatic 68k to C with a verification driver: RAM in, RAM and write log outSuperfrog
arek.m68k.xref, auditcross references from objdump listings; profile-driven inventory and reachability as JSONSuperfrog
arek.headlessRetroShell scripts, screenshots, breakpoint captures through a patched VAHeadless; the patches are includedTurrican II, Superfrog
arek.contractbyte-level comparison of captures, register diffs, "must not touch" assertionsSuperfrog
arek, arek-mcpthe command line (18 subcommands) and the MCP server (20 tools)new

75 tests run on synthetic data only: a hand-assembled 20-byte program, random buffers, a generated boot block.

From an assistant

The MCP server exposes the same instruments to Claude Code or any MCP client. Every tool takes paths on your machine and returns a measurement — an entropy map, a listing, a diff — never the image itself. A session reads like a lab notebook: map the disk, scan for packed blocks, unpack the one at 0x1f40 and walk it from its entry, say which routines touch hardware, recompile one and compare its writes with a capture of the original.

Install with pip install "amiga-re-kit[mcp]" and register the server:

// .mcp.json in your project
{
  "mcpServers": {
    "arek": { "command": "arek-mcp" }
  }
}

// tools, in the order you will use them
adf_info      adf_map       adf_regions    adf_extract
scan_packed   unpack        hunk_info      hunk_load
disassemble   walk          hwscan         recomp
xref          copper        ram_at
headless_shot headless_bpstate  diff_captures