can i get cpp file  from exe file ??

Posted on 2004-11-07
Last Modified: 2012-08-14

i trying to find the way that i can get cpp file from the exe (that has been generated by vc++)
is it possible?

Question by:tom_mk
    LVL 3

    Accepted Solution

    I'm affraid that once compiled program can't be brought back to .cpp file ...
    And if that is the case that only in form of decomposed original in Assembler language.
    The compiling process is actually one way directions, there are numerous optimizations in questions that are being done to establich an .exe files which can't be back-tracked to restore the original file.

    I'm sorry.

    Hope this explains it ...
    LVL 55

    Assisted Solution

    by:Jaime Olivares
    Definitively no. You can't.
    A binary (.exe) file doesn't have variables information or source code information, unless it have specific debugging options.
    Release (non test) executables don't use to have this information. A simple test: open your exe file with an hexadecimal editor, if you don't see variable names, then you won't obtain nothing.
    LVL 7

    Expert Comment

    by:Murugesan Nagarajan
    LVL 19

    Assisted Solution

    This is an endless debate. The comnclusion always is - No, you cannot get your source code written in a high-level language back from a compiled binary executable.

    The reason is simple. There are irreversible factors that go into the making of an executable program. Here is what happens, in brief.

    (1) Program is compiled and a symbol table is created
    (2) Procedures and functions are compiled
    (3) Optimization, if any applicable, is done
    (4) Various compiled modules are linked to form an executable binary
    (5) OS specific headers are added to the file

    You can see that first three steps are not reversible. And they are what will make it impossible to generate the source code back. Any good decompiler can reproduce a reasnably readable assembly code from a binary executable. But converting assembly instructions again to get back the HLL source code is a huge challenge.

    I am not sure if there has been developed any intelligent decompilers that can produce source code in a high level language, but even if they do so, rest assured what they will reproduce will be significantly different from the original source code.

    LVL 1

    Expert Comment

    In fact as you know the compiler maybe you can. You'll need a computer with the headers used to compile the program, at least those you know. Then you can search for a decompiler. Search at and at
    LVL 3

    Expert Comment


    Actually, you CAN get SOURCE code back from any executable. But the chances of understanding it in any meaninful way is not good.

    The c++ source would look something  like:
    String  a001="0";
    String a002="1";
    int a003=1;
    for (a003=0; a003-<=100;a003++){}

    and where the decompiler fails to decompile the code it will throw the assembly code inline in the C++ program, which would look like :
    <cpp  code snipped>
    inline ASM
    { add ax, 3
    add ax, 3
    rot ax, 3
    bnl ax, 3
    add ax, 3
    div ax, 3
    mul ax, 3
    <more c++ code here>

    And to JUST get that virtually useless code out of the binary, you need to know exactly which compiler created the code in the first place, such as GCC, intel C++, MS vC++, and you need to know exactly what version of the compiler was used, and exactly what command line parameters were used. Theres even some tools on internet to do it. The are called DE-Compilers, or reverse compilers.

    Such as this one called DCC

    Now, having said that its also illegal to use decompilers in a corporate envioronment on someone elses code you dont own, in the USA. Due to the DMCA act which specifically forbids reverse enginerring or decrypting without permission by federal law now.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Mobile App Development with PhoneGap

    PhoneGap can help you leverage your already existing HTML5, JavaScript, and CSS skills in order to create and deploy cross-platform mobile apps.This program comprehensively covers HTML5 mobile app development from top to bottom.

    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    This article will show, step by step, how to integrate R code into a R Sweave document
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now