I am looking at the files included with the 1981 game Wizardry. The particular version I have is from a 1998 re-release, but I do not know if the binary is still the original 1981 release.
My questions are at the bottom. Here is all the information I have gathered.
The binary runs in DOSBox. There are 3 files.
- WIZ1.COM
- WIZ1.DSK
- SAVE1.DSK
Linux file identifies the .COM as 'data', and the .DSK files as 'DOS executable (COM)'.
The first 64 bytes of the .COM are as follows:
00000000: fa8c c88e c08e d88e d0bc 0e08 fbb4 0fcd ................
00000010: 10a2 dc01 8cc8 8ec0 bbff ffb4 4acd 2181 ............J.!.
00000020: fb00 4173 0cba c403 b409 cd21 b808 4ccd ..As.......!..L.
00000030: 218c c8ba 1f08 d1ea d1ea d1ea d1ea 01d0 !...............
00000040: a3d2 01ba 6304 b800 3dcd 2173 0cba f103 ....c...=.!s....
The only meaningful ACII strings in the data are:
!Wizardry requires 300K free memory to run. $The file WIZ1.DSK is missing or damaged. $The file SAVE1.DSK cannot be created. $Read error in the Boot Block $WIZ1.DSK SAVE1.DSK Thanks for playing Wizardry!
The .COM file is 1.8K, while the two .DSK files are both 640K. Being that the 'bootstrap' (see below) is well over the 64K limitations of COM executables, I am already perplexed.
Wikipedia says the game was developed using USCD Pascal and implies that it runs p-code and that there was a interpreter for IBM DOS.
USCD Pascal was also used for the IBM versions, but with an x86 version of the interpreter.
The first 64 bytes of WIZ1.DSK would imply that this version was created no earlier than 1987 or that it was recompiled in after 1987.
00000000: eb38 9080 0800 0000 0053 7973 7465 6d20 .8.......System
00000010: 626f 6f74 7374 7261 7020 7632 2e30 2044 bootstrap v2.0 D
00000020: 5344 440d 0a28 4329 2031 3938 3720 5257 SDD..(C) 1987 RW
00000030: 492c 2049 6e63 2e0d 0a00 bb00 7c8c c88e I, Inc......|...
00000040: d08b e38e c031 c08e d8eb 1f00 3ec5 373e .....1......>.7>
The following strings from the WIZ1.DSK file seem significant:
No file SYSTEM.INTERP
SYSTEM.PASCAL
There are some strings from the game itself:
$PROVING GROUNDS OF THE MAD OVERLORD!
NO RACE
HUMAN
DWARF
GNOME
HOBBIT
FIGHTER
MAGE.LIBR
PRIEST
THIEF
BISHOP
SAMURAI
LORD
NINJA
AFRAID
ASLEEPIBR
P-LYZE
STONED
DEAD
ASHES
LOST
UNALIGN
GOOD
NEUTRALb
EVIL
There is what looks like PASCAL or BASIC code in the binary:
PROCEDURE PlotStr;
VAR S:Str255;
BEGIN
YTNOM
F=RJ
NAYR
CRAZY YRRAB
ELMER
id:=0; noGold.Hi:=0;
#totGold:=noGold;
#FOR i:=0 TO numInParty-1 DO
&BEGIN
)BigAdd(totGold,Party[i].Gold);
)Party[i].Gold:=noGold
&END;
#Party[N].Gold:=totGold
END;
There is a around 100 or so occourances of this HLL code strings being found. The SAVE.DSK looks like its a copy of WIZ1.DSK that is modifiable.
None of the strings from the game play are in the files. When the program was compiled, the strings must have been convereted to the routines necessary to draw the characters to the screen?
This is all I know. My goal is to path the game such that the level up function favors positive changes in stats.
- How can I positively identify what ABI this program is compiled to?
- If it was written in PASCAL, then is there a PASCAL specific debugger/disassembler/decompiler that can make things easier?
- Does anyone have any information or tips to help me with this process.
I do know x86 asm for real mode and segmented mode but I have never used that knowledge for reversing a real 16-bit application.