VOGONS


First post, by nemo

User metadata
Rank Newbie
Rank
Newbie

Hi all,

I'd like to share a tool I've been building for reverse engineering 32-bit DOS and early Windows games: retro-kit (open source, Apache 2.0).

https://github.com/nemo22/retrokit

It wraps headless Ghidra in a pipeline aimed at the games of roughly 1993-2010: DOS/4GW, DOS/32A, PMODE/W, CauseWay and DOS/4G-bound LE/LX executables built with Watcom C/C++, and Win32 PE (mostly MSVC). You point it at an EXE and get a workspace with one decompiled C file of every function, plus indexes (functions, call graph, strings, pointer tables) that you can grep, split up, or hand to an AI agent.

DOS side

  • Its own LE/LX loader for Ghidra 12 (objects, fixups applied and recorded, BW bind chains, OS/2 LX imports), checked against an independent Python model of each image
  • Watcom calling conventions: both register (-3r/-5r) and stack (-3s/-5s), detected automatically from the code
  • Functions found from fixups and pointer tables (state machines and handler tables are where much of the game logic lives), switch tables kept inside their functions, parameter counts recovered from call-site cleanup
  • Library signatures: the Watcom C run-time, math and C++ libraries are named and typed (built from Open Watcom; a fuzzy tier handles the old 10.x/11.0 run-time that differs byte for byte), zlib and IJG libjpeg too. If you own an original Watcom or MSVC, you can build signatures from its libraries locally.
  • retrokit libs recognises ~20 period libraries from strings, imports and data files: Miles/AIL, HMI SOS, DIGPAK/MIDPAK, Smacker, Bink, PKWARE DCL, VESA/UniVBE, ...
  • retrokit convert: XMIDI (Miles), HMI/HMP (HMI SOS) -> standard MIDI, VOC -> WAV, Smacker/Bink/FLIC -> MP4 via FFmpeg

Win32 side

  • DirectX 3-9 calls through COM vtables com(*dd->lpVtbl->CreateSurface)(dd,&desc,&primary,0) instead of (**(code **)(*dd + 0x18))(...)
  • Imports from Miles (MSS32), Smacker, Binktotypes
  • C++ classes, base classes and vtables from MSVC RTTI; compiler version from the Rich header

How good is it?
Everything is measured on small synthetic programs built with Open Watcom in several configurations (stack/register convention, -od, DOS/4GW, DOS/32A, PMODE/W, st the linker map. On those, all ownfunctions are found, parameter counts match for 27 of 28 functions, all string literals show up as literals, and about 90% of the run-time library is named. On a rhe signatures name around a hundred run-time functions. It is a starting point for your own reading, not a one-click source code generator: you still name things,
and it keeps track of your names and re-expo

There is also an MCP server, so an AI agent functions, xrefs, strings and tables andrecord name proposals while you review them. Totally optional, everything works from the command line and plain files.

Runs on Windows and Linux. Needs Python 3.10+, a JDK 21 and Ghidra 12.

The repository contains no game files and no decompiled game code, and I'd ask to keep it that way in any feedback.
It's meant for software you own and for reimk.

I'd be very glad for feedback, especially:

  • DOS extenders, compilers or packers it dompressed executables aren't supported yet)
  • sound/video libraries or data formats worth adding to the catalog
  • bug reports: the output of retrokit ini] for the EXE is usually enough to start



Thanks!

Reply 1 of 5, by keropi

User metadata
Rank l33t++
Rank
l33t++

I see on github that Claude is a contributor, correct? it should be stated on the post as well for full transparency

🎵 🎧 ⏳ ⚡ SoundVision PRO,MK1869 , PCMIDI MPU , OrpheusII , Megacard and 🎶GoldLib soundcard website
💾💾💾 Looking for a full version of LIST ENHANCED 2.4y1 by V. Buerg, message me if you have it for sale! 💾💾💾

Reply 2 of 5, by nemo

User metadata
Rank Newbie
Rank
Newbie

Yes, that's correct, and thanks for pointing it out – I should have said it upfront. retro-kit was developed with Claude (Anthropic's AI) through Claude Code: most of the code and documentation was written by Claude, under my direction. I set the scope and the goals, made the design decisions, tested it on Windows and Linux and decided what goes into each release. That's also why every commit lists Claude as co-author, so it shows up as a contributor on GitHub.

What I'd point to regarding quality is the test setup rather than who typed the code: every change runs against synthetic programs built with Open Watcom in several configurations and is scored against the linker map (functions found, parameter counts, call arguments, string literals, library names), with the results checked in CI on Windows and Linux. The numbers in my first post come from that. Bug reports where it gets things wrong are very welcome.

I can't edit the first post anymore, so I've added a "How it's made" section to the README instead: https://github.com/nemo22/retrokit#how-its-made

Reply 3 of 5, by eM-!3

User metadata
Rank Newbie
Rank
Newbie

Hope to see it gaining ability to reverse engineer 16-bit too or is it impossible due to tools used for this task?

Reply 4 of 5, by keropi

User metadata
Rank l33t++
Rank
l33t++

I have cleaned the thread a bit, no issues but please stay on topic
thank you 😀

🎵 🎧 ⏳ ⚡ SoundVision PRO,MK1869 , PCMIDI MPU , OrpheusII , Megacard and 🎶GoldLib soundcard website
💾💾💾 Looking for a full version of LIST ENHANCED 2.4y1 by V. Buerg, message me if you have it for sale! 💾💾💾

Reply 5 of 5, by nemo

User metadata
Rank Newbie
Rank
Newbie
eM-!3 wrote on Today, 08:53:

Hope to see it gaining ability to reverse engineer 16-bit too or is it impossible due to tools used for this task?

I’m not currently planning that. The primary focus is on DOS games running under the DOS4GW extender — essentially the majority of DOS games from the ’90s. I’m not ruling out adding 16-bit support in the future as well.