hello
can anyone tell me how i can convert exe back to c source. any program or disassembler?
Printable View
hello
can anyone tell me how i can convert exe back to c source. any program or disassembler?
Impossible to convert back to C.
Get the source in form of assembly is not impossible, but makes it incredibly difficult to read the program.
There are other reverse engineering tools out there, but none of them are easy.
In short: there's no realistic way of doing it. If the source is lost, so is your program.
there are tools that convert exe to C, but this C-code is not far from assembler and is very hard to read...
closest thing i could think of would be the "copy as C-source" option in a hex editor but shell code wouldn't help very much.
As someone else described it in the same question asked a few months ago, this is like expecting to be able to produce flour, milk and eggs from a cake. It's not going to happen.
There are commercial and hobby programs that will make something that can be compiled by a compiler out of the machine code in an executable file, but it's not C code like you or I would write it - it may for example not make any difference between a for-loop and a while-loop, and do-while loops may also become while-loops. Switch statements can often become a sequence of if-statements, structs and regular variables will be hard to tell apart, etc, etc. Variable names and fucntion names will obviously also only be for those symbols that are available in the executable (such as calls to DLL's, etc).
--
Mats
http://www.hex-rays.com/decompiler.shtml
Still not terribly good though, and you need to know a lot about the program you are decompiling.
Especially with the optimizing compilers out there today, "going backwards" really isn't currently an option.
So you need a license at €1500 + a IDA Pro at €690. And whilst I'm sure it will produce OK code to recompile, it probably won't tell you much of what the source code actually looked like...
--
Mats
Clever dick's little video in the browser froze my computer. Highly un-impressive
I was going to name hex-rays, but someone already did.
Matsp is right though - it's impossible to get the exact same source code. Just consider the comments for example - those aren't even hinted, AT ALL, in the machine code.
However, the code provided by hex-rays is the closest you can get. It *is* working C code, but it is very, very primitive and annoying to read. Vars are named like v1, v2, and so on, and the code pretty much just a direct translation of the machine code to C code.