Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to decompile a C++ executable file [duplicate]

I lost the source code to an executable file but still have the actual file. Is there any way to retrieve the original C++ code?

like image 561
T. Lang Avatar asked May 03 '18 01:05

T. Lang


People also ask

Can C code be decompiled?

As Srdjan has said, in general decompilation of a C (or C++) program is not possible. There is too much information lost during the compilation process. For example consider a declaration such as int x this is 'lost' as it does not directly produce any machine level instruction.

Can we decompile EXE file?

It can reliably decompile any . NET assembly into equivalent C# or IL code. The decompiler supports multiple formats including libraries (. dll), executables (.exe), and Windows metadata files (.

Can binary code be decompiled?

Decompilation is the procedure of transforming binary programs into a high-level representation, such as source code, for human analysts to examine. While modern decompilers can reconstruct and recover much information that is discarded during compilation, inferring variable names is still extremely difficult.

Can you decompile compiled code?

Decompilation is the process used to produce source code from compiled code. In order to accomplish this we are partnering with ILSpy, a popular open source project, which provides first class, cross platform symbol generation and decompliation.


2 Answers

You cannot get the original source code but you can decompile the binary into source code using tools given in this similar question: Is there a C++ decompiler?

The output source code will not look like the original as the compiler will have optimised the original source when generating the executable.

like image 55
Milk Avatar answered Oct 05 '22 22:10

Milk


Short answer NO.

Long answer, because C++ doesn't use some intermediate code like C# or Java you cannot decompile the app in some readable format. But if you can read assembly maybe you can save some time.

like image 37
Alks Avatar answered Oct 05 '22 21:10

Alks