Tuesday, July 28, 2009

HOw can i convert .EXE to a .CPP file and otherwise?

This was asked and answered in the previous answerers post, but the answer is not correct.





You can convert an .EXE into a .CPP (or other program source). It just may not be as easy as you would like.





An EXE is file that contains machine code. That is the Zero's and One's that tell the computer what to do.





A CPP file is a source code file (using the C++ language).





Converting a CPP file to an EXE is the common every day practice used by programmers called compiling and linking.





Converting an EXE file into a CPP (or other source) file is called decompiling.





The first step in decompiling is called disassembling. This converts the EXE into an .ASM file. This is easy. There are many free "disassemblers" on the Internet. The ASM file is an assembly language and if you know how to read it that thay may be as far as you want to go.





If you want to get all the way to a CPP (i.e. 3rd generation language) file, you will need to translate it from the assembly to C++. You can do that manually (assuming you can read assembly language) or you can find a decompiler on the net.





These do exist for some but not all languages. Search the net for Decompiler.





You should remember, however, that EXE's can start their lives as one of many different languages. Nevertheless, you can, in theory, decompile any EXE, regardless of its original source language, into any that the decompiler supports. The resulting source code will certainly not look anything like that of the original programmer, but it should be enough to understand the approach they took in creating the program.





As for the legality, it is true that some copyrights restrict decompiling (which they wouldn't do if it wasn't possible), however, they do that to protect from copyright infringement. If you are doing this to create a competing commercial program, then you will be breaking the law. If you are doing this for academic purposes, you should be OK.

HOw can i convert .EXE to a .CPP file and otherwise?
a cpp file is a C++ file, which needs to be compiled into an exe.





However, to take an exe and make it into a cpp? that would be reverse engineering, and depending on the copyright law, may be illegal.





Generally, if you want the source of an exe you have to ask the author... otherwise you may need to write a separate program that mimics the functions.
Reply:Asked (including the capital O in 'HOw') and answered:





http://answers.yahoo.com/question/index;...


No comments:

Post a Comment