Friday, October 23, 2026

Inside retrokit: headless Ghidra automation for reverse engineering 1990s DOS and Win32 games

Inside retrokit: headless Ghidra automation for reverse engineering 1990s DOS and Win32 games

retrokit is a headless-Ghidra toolkit that automates reverse engineering of 32-bit DOS and Win32 games from 1993-2010, intended for authorized research and preservation work.

Toolnautilusbits/retrokit — headless-Ghidra toolkit for reversing 32-bit DOS and Win32 games (1993-2010)
CategoryReverse engineering / static analysis automation
Primary UseAutomating decompilation and analysis of legacy LE/LX executables with Watcom calling conventions inside headless Ghidra pipelines
Safe UseAuthorized analysis of software you own or have rights to examine: game preservation research, malware triage of retro samples in isolated lab environments, and defensive study of legacy binary formats
Telemetry NotePure static analysis tool — runs entirely offline against local binaries via analyzeHeadless; it contacts no infrastructure and leaves no trace on the analyzed subject beyond generated project files on the analyst's machine

retrokit, hosted at nautilusbits/retrokit, targets a niche that mainstream reverse engineering platforms have historically handled poorly: 32-bit DOS extenders and early Win32 executables from the 1993-2010 era. The project's pitch, stated plainly in its repository description, is a headless-Ghidra toolkit with a custom loader for LE and LX formats, support for Watcom calling conventions, library signatures, and an MCP server component. Written in Python and licensed under Apache-2.0, it is an automation-first project rather than a GUI addon, which immediately signals who it is for: analysts who want reproducible, scriptable pipelines rather than interactive point-and-click sessions.

The format support is the core of the value proposition. LE (linear executable) and LX (linear eXecutable) are the executable formats used by DOS extenders such as the family descended from Phar Lap and DOS4/GW-style tooling, and they were the packaging of choice for performance games compiled with Watcom C/C++ throughout the mid-1990s. Stock Ghidra does not ship a mature loader for these formats, which means an analyst working on a 1995-era title either had to write manual import scripts or fall back on legacy DOS-era tools with poor decompiler integration. retrokit fills that gap with its own loader, so a binary lands in Ghidra with segments, entry points, and relocations mapped correctly.

The Watcom calling convention support deserves emphasis because it is the piece that makes decompilation actually readable. Watcom C/C++ compiled most protected-mode DOS games using register-based argument passing (typically EAX, EDX, EBX, ECX in that order) rather than the stack-based conventions analysts are used to from MSVC or Borland builds. Without a decompiler that understands this convention, function signatures come out mangled, arguments appear as unexplained register reads, and the pseudo-C output is close to useless. By teaching headless Ghidra the Watcom convention, retrokit converts what used to be manual annotation work into an automated preprocessing step.

Library signatures are the third pillar. The project ships function signature sets — effectively Ghidra FID-style signature data — that let the analyzer recognize calls into common runtime and game libraries of the period, from DirectDraw and other COM-based Win32 APIs to DOS extender host services. The repository's promotional imagery contrasts stock Ghidra output with retrokit output around DirectDraw calls through COM vtables, which is a well-chosen example: early DirectX titles invoke graphics interfaces through indirect vtable dispatch, and without signature recovery those calls degrade into anonymous indirect jumps that resist both static review and decompilation.

The headless orientation means the toolkit is designed around Ghidra's analyzeHeadless mode, where analysis runs from a command line without the UI. This matters operationally for a few reasons. First, it enables batch processing — an analyst or archivist triaging a collection of dozens of era titles can queue them through an identical analysis configuration and get consistent projects out the other end. Second, it makes the tool composable into larger pipelines, whether those are decompilation-assist workflows for source recovery projects or bulk triage of legacy binaries during incident response involving old malware families that also shipped in LE/LX wrappers.

The inclusion of an MCP server is the most contemporary design choice in the project. MCP (Model Context Protocol) exposes the analysis session to LLM-driven clients, so an analyst can drive Ghidra projects conversationally — asking a model to query functions, pull decompilation, and iterate on hypotheses without hand-copying output between windows. In the reverse engineering workflow this pattern is increasingly common: the model handles the tedious cross-referencing and pattern recognition, while the analyst retains judgment over what the code actually means. Pairing an MCP endpoint with a retro-format loader suggests the author expects iterative, question-driven analysis of large unfamiliar binaries, which is exactly what abandoned game codebases demand.

Where this fits in an authorized workflow is worth stating precisely. The obvious audience is game preservation and source-recovery research — communities that decompile titles they own to patch compatibility, fix bugs, or port engines, all legitimate activity on software the researcher has rights to examine. The second audience is defensive: legacy DOS-era malware and droppers occasionally resurface in curiosity-driven incidents and research corpora, and retrokit gives analysts a modern decompiler path for those samples instead of forcing them back into 1990s debuggers. In both cases the tool is purely local, purely static, and touches no infrastructure beyond the analyst's own machine.

Because the tool is Python-based, deployment follows the usual pattern for Ghidra extension scripting: cloning the repository (git clone against the project's GitHub URL) and wiring it into a headless Ghidra installation's script or extension path, with the exact invocation surfaced through analyzeHeadless plus the project's loader arguments. The MCP server component runs as a local service the client connects to. Anyone evaluating it should verify the exact Ghidra version compatibility before building a pipeline around it, since Ghidra's Java and Python bridges have shifted across releases and format loaders are sensitive to those changes.

At 39 stars the project is young and specialist, which is the correct lens for judging it: this is not a general-purpose framework competing with mainstream tooling, it is a focused instrument for a format family that general tooling ignores. The combination — custom LE/LX loader, Watcom conventions, signature recovery, and scriptable headless operation — collapses what used to be days of manual setup per binary into a repeatable command. For anyone whose work touches the 32-bit DOS and early Win32 era, whether for preservation, porting, or retro-malware research on samples they are authorized to analyze, retrokit removes the single largest friction point in the pipeline: getting these binaries properly loaded and readable in a modern decompiler at all.

Official project repository for nautilusbits/retrokit.
Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.

Share articleFacebookXLinkedIn

Continue exploring

Browse all articles →

0 comentários:

Post a Comment

Note: Only a member of this blog may post a comment.