Ultima 4 Decomplied


ergonomy_joe sent in an email to let us know that a project he has been working on has finally been completed:

I finally uploaded the results of the work I did on Ultima IV: reverse compilation of the executable files.

The result can be found at https://github.com/ergonomy-joe/u4-decompiled

This is definitely for programmers. Nothing fancy, no pictures, no maps…Just code and algorithms, the closest possible to the originals.

Clicking through to his GitHub page gives us a bit more detail about the decompliation process joe employed:

Lots of information/tools/remakes about “Ultima IV – Quest Of The Avatar” have been made, but so far, no one really gave an insight of the binary itself. To be more precise, of the executables of the PC version of the game (ported by James Van Artsdalen). There are two of them: AVATAR.EXE and TITLE.EXE

Basically, what I did is reverse engineer them to obtain a list of source files, that, when compiled and linked, produce new executables very close to the original ones (there are maybe 10 bytes difference for each executable).

Some of the source files are in assembly code. The biggest chunk is in C language, which means that it should be easier to read it. Of course, since this is a reverse-engineered from binary, files|variables|functions names were lost and I had to come up with new naming. I hope you like it.

Concerning the compiler, I used “Microsoft C Compiler 4.00”. Which is certainly the version that was used to build the original game.

At present, I don’t think I’m going to host a download of these files here at the Codex. Still, this is an interesting effort, as it gives us a bit of a peek at the logic and code behind one of the most influential RPGs of all time.

3 Responses

  1. Infinitron says:

    Impressive. The game logic is (surprisingly?) readable for such old code.

  2. armchairavatar says:

    This is very cool. Now xu4 can be made “perfect”.

  3. Awesome work there. Probably the closest we’ll ever get to the original source, unless someone’s been sitting quietly on it for many years.