nemerle / dcc

This is a heavily updated version of the old DOS executable decompiler DCC
GNU General Public License v2.0
146 stars 27 forks source link

DCC doesn't work on Turbo Pascal COM binaries #33

Open rogerd007 opened 4 years ago

rogerd007 commented 4 years ago

DCC includes signatures for Turbo Pascal 3.01 (which only generates MS-DOS COM binaries, not EXEs), however I have not been able to get it to work on even the simplest program.

Attached is a "Hello World" example. DCC either seems to use the wrong offset for the main() function, or if I fix that (to what I think it should be -- could still be wrong!), it always complains about 80386 instructions. Turbo Pascal 3.01 doesn't generate 80386 instructions, so that's clearly not right. It seems odd that DCC includes signatures for Turbo Pascal 3.01 (TP 3.00B and TP 3.02 generate a different signature and are not recognised by DCC, so I'm sure TP 3.01 is the correct version) and yet doesn't appear to work with TP 3.01 generated binaries at all!

Does anyone have any ideas?

TP301.zip

rogerd007 commented 4 years ago

Further investigation reveals that what DCC is interpreting as instructions it doesn't know about is actually data, not code. I'll investigate the parser in further detail to try to see what can be done.