Automatic Decompiler

Program-Transformation.Org: The Program Transformation Wiki
Every few months, I get an email asking where to find an automatic decompiler that will take a binary as input and produce good quality C or C++ code for maintaining an application. Usually, the correspondent owns the binary code, but somehow they don't have the source code and would like it back.

Regrettably, the state of the art in decompilation is such that this is still not possible. About the closest thing to such an automatic decompiler is REC (Reverse Engineering Decompiler). But it doesn't generate compilable C, just C-like code that helps understand a binary program.

One day, the Boomerang decompiler may be good enough to use for this purpose, but it's probably at least one, probably several years away from that state.

So the best I can recommend is a good disassembler, such as [IDA Pro]. It will not be automatic; the disassembler can make a lot of guesses automatically, but it leaves many decisions up to the user. With enough work, and an expert user, you will probably be able to generate code that is good enough to maintain. But you will have to use assembly language experts to maintain the code, and they are less common than they used to be. Also, your code will only work on one machine; you don't have the option of porting it to another machine (so if it starts on an Intel machine, it will stay on Intel machines).

This is not what many people expect, and not what they want to hear. But it's the reality for the time being.