Author Topic: SCI01 interp decompiling  (Read 2888 times)

0 Members and 1 Guest are viewing this topic.

Offline Charles

SCI01 interp decompiling
« on: December 10, 2020, 04:58:52 PM »
So I was procrastinating on another project and idly wondering what it would take to decompile the SCI01 interpreter and re-incorporate text parser code into SCI11.

This is a nearly 30 year old program.. surely there must be decent decompilation software out there now, right?  I found one called Reko Decompiler that looked promising.  I opened it up, but it reported the file was compressed with LZEXE.  I noticed that Eric already knew that, and has already decompressed it in the SCI01 template.  But when I opened it up again in Reko, I found it was still partially compressed a second time with EXEPACKER.

So after hunting far and wide, I finally found a dead link to a DOS program that can unpack EXEPACKER files. A trip to the WayBackMachine found a working link, and in DOSBOX I was able to uncompress it yet again.

Now, Reko was able to process the thing. And here's where I've reached my level of incompetence. There were a small handful of errors decompressing, but there looks to be actual code -- that is bereft of any ral variable names -- so it might as well be gibberish to me.  Anyway, I've gone as far as I probably can with it, but I thought it was interesting that the EXE was compressed in two different ways, and wanted to share. I've also attached the hard to find unpack.exe, if somebody else wanted to give it a go.

Offline AGKorson

Re: SCI01 interp decompiling
« Reply #1 on: December 10, 2020, 10:05:20 PM »
You might have better luck with Ida Pro. it's a highly capable disassembler. It's a commercial tool, but they have made one of their earlier versions available for free, and it works great on MSDOS programs.

I took a quick look at Reko- it couldn't even figure out the entry point for simple DOS programs. Not sure how well it would do with a program as complex as SCI.

Decompiling (disassembling) is a lot of work, and a bit of an art. I've spent years disassembling AGI. I have Version 2.917 100% disassembled, and other version mostly done (I only go to them when I'm looking for differences).  But it took A LOT of work.

If someone is serious about trying to decompile/disassemble SCI, it can be done, but just be sure you understand what your getting yourself into!

Offline Kawa

Re: SCI01 interp decompiling
« Reply #2 on: December 11, 2020, 05:48:04 AM »
I agree that IDA might be a bigger help.

I would also like to suggest having SCI11, both source and unpacked exe, to compare against, since a lot of code (but not all) would be similar.

But most of all? The goal. Restoring the Said and Parse commands, and maybe SetSynonyms? The SCI16 archive includes the NL directory, which is by all means those two commands so you could maybe backport them in. But one tricky part here would be that the script block format changed after SCI01 -- the part that was split off into the .HEP resource contains blocks for local variable valuess, objects, classes, and strings, leaving the code for those objects and classes in the .SCR resource. Back when it was just the one .SCR, there was a block for said specs too. So you might want to change the NLP system to use the near strings block for its said specs instead, and SCI Companion to store said specs there likewise, if it's SCI11.

So good luck.

Offline ZvikaZ

Re: SCI01 interp decompiling
« Reply #3 on: December 14, 2020, 02:39:31 AM »
You might also want to try Ghidra. It's a reverse engineering tool written by the NSA, and made public.

Offline Kawa

Re: SCI01 interp decompiling
« Reply #4 on: December 14, 2020, 08:46:20 AM »
After having used both, I gotta admit I prefer IDA. But either works for this purpose I guess.

SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.044 seconds with 22 queries.