Tuesday, July 14, 2009

Extract or View C++ Source code from an exe file?

Is there any way I can extract or at least the C++ source file of an exe file. Im really in need of help Iv only got the exe file and iv lost the source code. Please Some one Help.

Extract or View C++ Source code from an exe file?
A simple answer would be, No. You cannot extract the c++ source files (.cpp) from an .exe.





You can reverse engineer the binary file. You can always get the Assembly Source code (hopefully). Cause an EXE is a binary compilation. So you cannot get the .cpp files only the assembled code which is ASSEMBLY.





You could either DEBUG the exe and see the application run in Assembly, or use some kind of reverse engineering tool like DA.PRO





Take a look at Assuming its .NET:


http://www.netdecompiler.com/index.html


http://www.junglecreatures.com





It is illegal to get the source code of an EXE. Cause if the programmer wants the user to see the source code, he could of included it. Unless your learning how to crack software, then your doing something which isn't good.
Reply:No. Once a high-level language program is compiled into the assembly code, the information of the original source is lost. You cannot get back to the source code.





There is no one-to-one relationship between a high-level language statement and an assembly instruction. One statement is normally compiled to more than one instructions. Then the compiler attempt to optimize the code by removing redundant code, or replacing a code segment with better instructions.





So, why you cannot reverse engineering back the source? First, you do not know where the boundaries of two high-level languages are. Second, after optimization, you don't even have instructions for a complete statement anymore.
Reply:no.


No comments:

Post a Comment