Fenyx4 / u6-decompiled

Decompiled code for PC/MSDOS version of Ultima VI - The False Prophet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

u6-decompiled

Decompiled code for PC/MSDOS version of Ultima VI - The False Prophet (version 4.5)

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.

Concerning the build process:
The original game was build with Borland Turbo C 2.0 for the part written in C language (most of the files). There are some asm files too, you will need tasm 2.0 and masm 3.0 to build them.

All you need to know for the build process is in the file SRC/doit.bat which uses MAKEFILE. Before that, you will need to launch SRC/OSILIB/doit.bat. I think I put most of the asm files in there.

The naming of the C files is not friendly at all, and I apologize for that. Maybe some renaming will take place in the future ?

Have a lot of decompiling fun!
2022/03/29 ergonomy_joe

PS: when I first decompiled this code, I posted some comments on a french abandonware related forum, you can take a look here.

Steps to compile

  1. Download dosbox https://www.dosbox.com
  2. Launch dosbox
  3. cycles 15000

    1. This speeds up builds
  4. MOUNT c "[Local-Directory]/SRC" e.g. MOUNT c "..\SRC"

  5. Download tools
    1. Go to https://www.pcjs.org/software/pcx86/util/other/unp/4.11/
    2. In the dropdown under the command prompt select "UNP (Executable Unpacker) Source"
    3. Click "Load" and then "Save"
    4. In the dropdown select "MS C 4.00 (Disk 2)"
    5. Rename downloaded file to MSC2.img
    6. In the dropdown select "MS Macro Assembler 3.00"
    7. Rename downloaded file to MASM300.img
    8. Go to https://winworldpc.com/product/turbo-assembler/20
    9. Download Borland Turbo Assembler 2.0 (5.25-360k)
    10. Extract Disk01.img from the download and place with other img files
    11. Go to https://winworldpc.com/product/borland-turbo-c/2x
    12. Download "Borland Turbo C 2.0 (1988) (3.5-720k)"
    13. Extract disk02.img and disk03.img from download and place with other img files
  6. Extract tools
    1. mkdir C:\tools

    2. mkdir C:\tools\turboc20

    3. mkdir C:\tools\turboc20\include

    4. mkdir C:\tools\turboc20\lib

    5. MOUNT d "[Local Directory with img files]"

    6. imgmount a D:\UNP411~1.IMG -t floppy

    7. copy A:\UNP.EXE C:\TOOLS

    8. imgmount -u a

    9. imgmount a D:\Disk01.IMG -t floppy

    10. a:

    11. mkdir D:\TASM

    12. unzip TASM.ZIP D:\TASM

    13. copy D:\TASM.EXE C:\TOOLS\TASM200.EXE

    14. imgmount -u a

    15. imgmount a D:\MSC2.IMG -t floppy

    16. copy A:\EXEPACK.EXE C:\tools

    17. imgmount -u a

    18. imgmount a D:\MASM300.IMG -t floppy

    19. copy A:\MASM.EXE C:\TOOLS\MASM300.EXE

    20. imgmount -u a

    21. imgmount a D:\disk02.img -t floppy

    22. copy A:*.EXE C:\TOOLS\TURBOC20\

    23. imgmount -u a

    24. imgmount a D:\disk03.img -t floppy

    25. copy A:\TLIB.EXE C:\TOOLS\TURBOC20\TLIB.EXE

    26. copy A:*.H C:\TOOLS\TURBOC20\INCLUDE\

    27. copy A:*.OBJ C:\TOOLS\TURBOC20\LIB\

    28. copy A:*.LIB C:\TOOLS\TURBOC20\LIB\

  7. Build
    1. C:

    2. cd C:\OSILIB

    3. DOIT

    4. cd ..

    5. DOIT

About

Decompiled code for PC/MSDOS version of Ultima VI - The False Prophet


Languages

Language:C 92.5%Language:Assembly 7.0%Language:Batchfile 0.4%