How Would I: disassemble the "other" DOS Indy Adv?

All the inane chatter goes in here. If you're curious about whether we will support a game, post HERE not in General Discussion :)

Moderator: ScummVM Team

Post Reply
User avatar
samwise
Posts: 62
Joined: Sat Jan 12, 2008 5:47 pm

How Would I: disassemble the "other" DOS Indy Adv?

Post by samwise »

Hi,

Posting in The Junkyard, as this is somewhat off-topic (not directly related to ScummVM).

However, I thought I may be able to get some useful advice/help from any clever ScummVM developer bods in here.

As a learning exercise for myself, I'm considering porting the long out-of-print DOS text adventure from Angelsoft & Mindscape, Indiana Jones in Revenge of the Ancients into Z-code. For anyone not aware, Z-code games can be run on any platform that a Z-Machine Interpreter has been ported to - in a similar fashion to how ScummVM works.

Whilst a port could be done entirely by hand, it would be useful if the DOS game could be partially disassembled and the text extracted from the game - which would hopefully ensure that nothing was missed in the new port.

I have pretty much no experience at all in disassembling, but I have a feeling - given the age of this game - that disassembling it far enough to extract the text might not be too onerous. The main .COM file has "Borland v2" written in clear-text in the binary.

Bearing in mind that I *don't* have a spare copy lying around for anyone offering help, does anyone have any advice on how to get started on something like this and/or any recommended tools etc.?

I'm not really an assembler coder and don't have any aspirations to be one so if I can't get past this, I may have to file this project under the "impeded" label which would be a shame ...

Sam.

Code: Select all

69888  GAME.000
25983  GAME.COM
48128  MESSAGE
  573  START.BAT
 4280  TABLES
 6136  VOCAB
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

The REWiki has a little bit of info on re-engineering: Reverse engineering hints. Consider also posting your progress on there (and here)!

Be warned that it's usually a somewhat slow and laborous process that involves taking lots and lots of notes, as well as stepping through the program one instruction at a time, keeping an eye on variables.

The "Borland" part likely means that the Borland linker was used to create the executable. I looked at a couple strings. They're each preceded by a byte, which is the length. This means they are Pascal strings. It doesn't guarantee that the code was written in Pascal, but it's worth keeping in mind when looking closer at the executable.
Anotherguest
ScummVM Porter
Posts: 1423
Joined: Sun Oct 30, 2005 2:27 pm
Location: Malmoe, Sweden

Post by Anotherguest »

I'd rather disassemble an old dos game compared to a new windows game anyday. If the exe is rather small, a good disasm tool could give you quite readable code actually.
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

The .COM itself is 28 kb and the .000 file is 72 kb. I'm betting:

.COM contains the intialization, keyboard, screen code,
.000 contains the game logic,
VOCAB contains keywords in some fashion,
MESSAGE the game text itself,
TABLES, well, tables of some sort.

The data is encoded somehow, though. Not a simple XOR or substitution as far as I can tell, so probably compressed. But yeah, as Anotherguest says, try running the .COM and maybe .000 files through one of the multitude of deassemblers and look at it. In fact, there's a freeware DOS disassembler that generates C-code if the executable is smaller than 100k so it's perfectly usable.

http://www.itee.uq.edu.au/~cristina/dcc.html

The code will lack variables and function names.
User avatar
samwise
Posts: 62
Joined: Sat Jan 12, 2008 5:47 pm

Post by samwise »

Thanks for the suggestions, guys.

I tried running the executable through DCC but it errors about being unable to load the signature file dccxxx.sig, which I think should be a surmountable error, if I knew what I was doing.

Hmmm ... *scratches chin*

Methinks I may be out of my depth a bit here. I'll give it another shot tomorrow eve and see if I can crawl any further, perhaps with one of the debuggers mentioned on the RE wiki.

Thanks,

Sam.
User avatar
samwise
Posts: 62
Joined: Sat Jan 12, 2008 5:47 pm

Post by samwise »

Didn't get any further with DCC, but I was able to run it through IDA Pro Free ... it's not making much sense to me, tho. Think I'll have to put this on hold until I stumble across someone with more assembly skillz than me.

Ah, well.

Sam.
Anotherguest
ScummVM Porter
Posts: 1423
Joined: Sun Oct 30, 2005 2:27 pm
Location: Malmoe, Sweden

Post by Anotherguest »

In the old days I was running a very good disasm tool which gave me quite good function sections etc, so it gave like readble code if you knew what you where looking for, now I just gonna remember what it was called.

Anyhow, I used that to reimplement several games from X86 to Z80 assembler, and well.. rip some graphics. :-)
User avatar
samwise
Posts: 62
Joined: Sat Jan 12, 2008 5:47 pm

Post by samwise »

IDA Pro Free did seem to spit out useful stuff, but I'm not an assembler guy (see post #1) ... so I haven't been able to figure out what it's doing. Whilst it probably shouldn't be stupidly complex to reverse engineer the text compression, I think it's probably over my head, unfortunately - may have bitten off more than I can chew ...

Sam.
Arantor
Posts: 89
Joined: Mon Apr 02, 2007 11:10 pm

Post by Arantor »

You may actually find it'd be easier to write a clone game that behaved as the original, rather than a true port...

Just a thought, anyhow.
User avatar
samwise
Posts: 62
Joined: Sat Jan 12, 2008 5:47 pm

Post by samwise »

Oh, I had no intentions of porting the engine .. ;)

I may well try to port it manually, it's just there's no guarantee that I won't "miss" bits of text - which is why a list of the text from the game would be useful. I had the vague idea obtaining that might not be too hard, but I think I was being naive given my newbie status ...

Sam.
User avatar
samwise
Posts: 62
Joined: Sat Jan 12, 2008 5:47 pm

Post by samwise »

To conclude this thread, I have a small update.

A friend of mine has spent some time on this after I ground to a halt so early on, and has managed to extract a good proportion of the text. Details of the investigation have been documented here:

http://rewiki.regengedanken.de/wiki/Ind ... e_Ancients

Plenty for me to be working on,

Sam.
Post Reply