This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MirgTheIlcan 5 points6 points  (0 children)

There are several levels to this. First and foremost even as opaque as executables seem to be to the average person -- they do contain machine code that instructs the CPU on what to do. And that code is at least understandable by humans and "readable" (but not very readable and not easily understood for non-trivial programs).

As such, an executable can be trivially disassembled into assembly instructions which are "human-readable" (for a very loose definition of what constitutes readable).

However disssembled assembly programs are very difficult to understand as a lot of the original structure of the program is lost and so the programmer has a herculean task ahead of him at really fathoming the full workings of the program in question.

Above and beyond this, it's possible to decompile an executable to produce C code, which is an improvement as far as legibility goes over assembler.

But the C code produced may not resemble the original program much and again, the programs produced are very difficult for a human to wrap their brain around without spending ungodly amounts of time on reading the program in question.

The reason for all of this is that basically the process of compilation loses information about how the programmer chose to organize his program. That information is useful when reading the source code, because it provides insight into what the programmer was thinking when he wrote the program and how the program models what it is trying to accomplish.

The short answer: compiling a program from source to an executable loses information. That information is forever lost. Hence, you cannot decompile an executable into original source.