Take the 2-minute tour ×
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It's 100% free, no registration required.

I recently decided to try my hand at reverse engineer an old DOS text based game that was coded in QBasic.

I found some info online about old DOS games disassembly but mostly for Wacom compiled C/C++ binaries, but nothing on QBasic. I know that getting the original Basic code is probably impossible, but going disassembling the file with nasm I didn't get any useful info either...

Any pointers?

share|improve this question

3 Answers 3

Apparently a decompiler for DOS Basic executables already exists.

Going by examples from that page, quite a lot of the code can be recovered. I guess it used some form of P-code, or there was some additional metadata.

Descriptions of the decompiler's error messages can give some hints about various functions implemented by the Basic runtime.

share|improve this answer
  • debug with DOSBox debug-enabled builds
  • disassemble with IDA
    • try to compile your own empty qbasic EXE, and compare - this will help to telll the compiler code from the actual code of your game. You might do that automatically by creating a FLIRT-like signature of the empty EXE then import in your own EXE in IDA.
share|improve this answer

I found the debug-enabled builds a bit unwieldy. But I found the combination of DOSBox and IDA quite nice using idados. It's an IDA Pro plugin which allows you to control the debugger of a debug-enabled DOSBox build from within IDA similar to how you can control a debuggee running one of the other supported remote debuggers.

Given the existing answer by Igor this is of course like using a kitchen knife instead of a scalpel, but I thought I should mention it, as it is a more generic method for reversing DOS programs.

NB: There used to be an even older, but I think unrelated, plugin of the same name which hasn't been maintained by its original author. I still have a copy of it on my disk (at home), but the website seems to no longer exist.

share|improve this answer
    
Well, the decompiler I mention is not public so there's nothing wrong with the good old debugging. –  Igor Skochinsky Apr 3 '13 at 10:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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