Ultima 6 Has Been Decompiled

Some of you may recall that, around six years ago, a coder and Ultima fan going by the handle Ergonomy Joe decompiled the MS-DOS version of Ultima 4 and published the results on GitHub.

Well, after that hiatus of several years, Joe is back with another decompilation effort: the MS-DOS version of Ultima 6:

This project allows you to build GAME.EXE, with very few differences from the original. I have also decompiled most of the other executables, but I have to make the code more readable before releasing it.

The techniques used to decompile GAME.EXE is basically the same I used to decompile Ultima IV:

– disassemble the executable
– gather the tools/libraries that were originaly used (Borland Turbo C 2.0 in our case)
– search for modules/functions separation in the code.
– for each function, read assembly code and try to guess what was the original C code
– build new code and compare the resulting binary with original binary
– eventually correct code and build again
– repeat 3 last steps until all the executable file has been reversed

Some years ago, someone released Ultima 6 Technical Documents online, which proved very helpful to understand some parts of the code, and to give a name to some functions/variables/macros. Be aware though that these documents refer to an earlier version of the game, and so they do not reflect exactly what is in the code.

Joe does apologize that the naming of the C source files in the repository is not at all friendly at this time; a renaming may take place in the future. Additionally, the code to compile other executables associated with Ultima 6 has not yet been released, but should be once Joe has had time to clean it up.

Still, if you wanted to get a look at how Ultima 6 works “under the hood” (as it were), you’d do well to click on through to Ergonomy Joe’s GitHub page.

4 Responses

  1. Mark Lemmert says:

    That is excellent work! I hope somebody does that some day with the Apple II version of Ultima V.

  2. Cambragol says:

    Wow! Joe is a legend. Should be very interesting to see what comes of this.

    I too dream of an Ultima V decompile, however, I think Joe said he took a stab at it but couldn’t crack it. I also recall a post here on the Codex which hinted at the U5 executable being ‘spread out’ between other files. Perhaps that is something that stumped him…, or could help him crack Ultima V

  3. Rusty says:

    Please make Jaana a caster!