1

New to decompiling, and code generally. Trying to decompile a windows 3.1 game (text adventure), so I can build it up again. Because at the moment it doesn't work (even on windows 3.1).

I decompiled the exe with DoDi (7z File) which was recommended in one of the answers to this question on SO.

This threw an error when decompiling the exe 'an already known error occurred'. Probably not very helpful, but I mention it just in case.

So, it decompiled fine to .mak, .frm and .bas files. I compiled the program again in Visual Basic 4, after correcting some syntax problems, but I get a totally non-interactive window in which none of the buttons work.

This makes me think that it needs to talk to the code in the dll, but is not doing so. DoDi won't decompile dlls, and I have yet to find a decompiler which will handle 16-bit (NE/New Executable) dlls.

So, I assume I need to decompile this dll too. How? The game files are in draquest.zip, which is here archived here.

5
  • No, it's very unlikely you have to decomile the DLL. COMMDLG.DLL is the dll that has the standard windows dialogs (File open/save dialog, color chooser, that kind of stuff), so it shouldn't have anything that's specific to your game. Everything that's going to be needed to interface with it will probably be in Cmdialog.vbx. Commented Oct 9, 2015 at 13:22
  • hm, thank you. I wonder why it doesn't work then. Ah well :/
    – Ne Mo
    Commented Oct 9, 2015 at 13:32
  • I would still like to decompile it if anyone knows how...
    – Ne Mo
    Commented Oct 9, 2015 at 13:53
  • 1
    I've yet to see a decompiler that produces 100% correct output except in trivial cases. In other words, you always start with the decompiled output, look for errors, fix them, repeat until everything seems ok. What might help you is try various options from here, and compare their outputs to improve your source code. Commented Oct 9, 2015 at 14:01
  • Yes, I had my hopes raised when the exe came out with nice, readable code... ah well, time to look at some of those options you provided.
    – Ne Mo
    Commented Oct 9, 2015 at 14:10

1 Answer 1

1

So, I assume I need to decompile this dll too.

As Guntram said, no, you don't need to decompile the VBX files.

So, it decompiled fine to mak, frm and bas files. I compiled the program again in Visual Basic 4, after correcting some syntax problems, but I get a totally non-interactive window in which none of the buttons work.

The window's form is defined in ONLYFORM.FRM and the code for the form's event handlers is in ONLYFORM.bas. If the event handler functions aren't firing, it's likely because the handlers aren't properly registered in ONLYFORM.FRM. However, you already have the code, so any future questions on how to fix the event handler registration should go to https://stackoverflow.com/.

2
  • I assume you mean I don't need to decompile the dll file. The VBX file can be imported into VB4 as is. Thankyou for the tip about onlyform.frm, will have a look
    – Ne Mo
    Commented Oct 9, 2015 at 22:53
  • Right, you need not decompile the VBX files nor the DLL file. Commented Oct 10, 2015 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.