0

Possible Duplicate:
Is there a C++ decompiler?
Is there a decompiler that will work on Visual Studio 6 C++

I need any way to decompile exe file which written in MFC, I tried IDA Pro, but it convert the file into assembly and no so good, because it has a lot of question marks characters. If the directly converting file in to code is impossible, is there any way to convert assembly to C++? :(

thanks

Community
  • 1
  • 1
SWE
  • 131
  • 2
  • 7
  • 20

1 Answers1

1

No. The compliation process destroys all metadata, including variable names, and the optimisation process makes it difficult to recover even a pseudocode replica of the original source.

Here's a highly simplified example. Let's say you write "foo++", where foo is an int. Depending on the compiler, this could compile to any of the following:

  • inc dword ptr [esp+12h] - foo is kept as a local on the stack
  • inc dword ptr [00000f00h] - foo is a heap variable
  • add dword ptr [00000f00h], 1 - another way to increment
  • mov eax, dword ptr [esp+12h]; inc eax - move from the stack in to eax, then increment
  • etc...

The possibilities are practically endless.

Your best bet is to look into something like Hex-Rays Decompiler, though it isn't cheap. It works with IDA to produce pseudo-C code, which you can use to discover how particular functions and routines work.

Polynomial
  • 27,674
  • 12
  • 80
  • 107
  • Also take a look at this question: http://stackoverflow.com/questions/273145/is-it-possible-to-decompile-a-windows-exe-or-at-least-view-the-assembly – Polynomial Apr 18 '12 at 19:40
  • which option I must choose in : new assembly database panel ? – SWE Apr 18 '12 at 19:46
  • I don't understand the question. What software are you using? What are you trying to do? – Polynomial Apr 18 '12 at 19:46
  • I am using IDA pro, I am trying to work as you said "Hex-Rays Decompiler" but I don't know which option must I select when i create new project in IDA pro – SWE Apr 18 '12 at 19:55
  • Yes, but I don't know what you're specifically trying to do with it. When you purchased Hex-Rays, you were given details on how to contact support. You should go talk to them - might as well get your money's worth, considering the €1721 you just spent! – Polynomial Apr 18 '12 at 19:58