TransWikia.com

Can you decompile code if you Know the Complier?

Reverse Engineering Asked on November 13, 2020

My company has a small number of .exe that were written in the ’80s that are performing some minorly important tasks. Source code is gone and documentation is scarce. In order to run them we need to use DOSBox. My team wants to get the process into a modern language so we can maintain the code and if possible see how the program functions. Previous attempts to reserve engineer have failed, I believe because not enough time was allotted to work on the problem. I’ve doing some exploration to see what is possible. Thus far this is what I think I have found:

  1. Using IDA PRO 5.0 I can get the code back to assembly. The code looks functional.
  2. From the above, it appears the original code was either Pascal or Delphi.
  3. It looks like I can see what compiler (Borland) was used to create the .exe files.

My question is if I know the compiler was Borland, can I use that information to get back to a relatively correct source code? I know the variable names will be bad and it might have other issue that need to be debugged, but just getting back to the basic structure of the code with loops and defined function calls and methods would be great. If not, am I stuck trying to learn assembly to get a better idea of what is going on?

One Answer

For most languages -- especially ones that are compiled directly into machine code -- the answer to whether knowing the compiler makes it easier to decompile them is "no". I wrote a post a while ago explaining the difficulties that machine code decompilers face; none of them are made easier by knowing the compiler.

However, your question doesn't mention any of the specific machine code decompilers such as Ghidra. It has the potential to make your life a lot easier, by giving you a reasonably-good approximation of the source code that is interactive (i.e., allows you to change names and types, add comments, etc). I'd recommend giving it a look. Regardless, assembly language will be involved in the process.

Answered by Rolf Rolles on November 13, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP