Need to View the contents of an EXE file

Discussion in 'C Programming' started by adirajuv@gmail.com, May 12, 2005.

  1. Guest

    I wrote a program in C long time ago and I lost my code and all the
    intermediate files. All I have is the "exe" file that was generated
    when I executed it. Can the code be retrieved from this exe file?

    If not, is there a way I can atleast view the contents of the exe file?

    Thanks in Advance
     
    , May 12, 2005
    #1
    1. Advertising

  2. marri Guest

    Currently there are no tools that does this. For java there are
    decoders but definitely for an c++ executable.
     
    marri, May 12, 2005
    #2
    1. Advertising

  3. marri Guest

    Currently there are no tools that does this. For java there are
    decoders but definitely not for an c++ executable.
     
    marri, May 12, 2005
    #3
  4. On 12 May 2005 01:01:29 -0700, in comp.lang.c ,
    wrote:

    >I wrote a program in C long time ago and I lost my code and all the
    >intermediate files. All I have is the "exe" file that was generated
    >when I executed it. Can the code be retrieved from this exe file?


    look up 'decompiler' on the web, and consider that its typically a
    'hamburger back to cow' transformation.

    >If not, is there a way I can atleast view the contents of the exe file?


    Sure, you can view the binary with any hex viewer. You can probably
    load it into a debugger like DEBUG and step through the machine code /
    assembly instructions. This would all be platform-specific though,
    and you'd need to ask in a more appropriate newsgroup.
    --
    Mark McIntyre
    CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
    CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
     
    Mark McIntyre, May 12, 2005
    #4
  5. CBFalconer Guest

    wrote:
    >
    > I wrote a program in C long time ago and I lost my code and all the
    > intermediate files. All I have is the "exe" file that was generated
    > when I executed it. Can the code be retrieved from this exe file?
    >
    > If not, is there a way I can atleast view the contents of the exe
    > file?


    You can disassemble it to machine (assembly) code. You can never
    recover the original source code. If the exe file includes
    debugging info you can regain some of the identifiers used.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
     
    CBFalconer, May 12, 2005
    #5
  6. On 12 May 2005 01:01:29 -0700,
    <> wrote:

    > I wrote a program in C long time ago and I lost my code and all the
    > intermediate files. All I have is the "exe" file that was generated
    > when I executed it. Can the code be retrieved from this exe file?


    No, the source code is totally gone long before it gets to be an
    executable file. Unless you have a 'debug' version which keeps the
    source in the EXE (some compilers did that).

    > If not, is there a way I can atleast view the contents of the exe file?


    Well, you could use a hex editor, but that's probably not what you mean.
    You can extract text strings from a file (Unix-like systems often have a
    program called 'strings' which does it) but that would likely only give
    you the string literals (and a load of garbage). If you search the web
    you may be able to find a "dis-assembler" which understands the EXE
    format (on some systems 'objdump' can do it; as I recall both MS and
    Borland had something to do it for DOS a long time ago) but the
    assembler code you get back will likely be not very recognisable.

    Sorry, I think you're better off rewriting it from scratch...

    (For DOS/Windows executables mentioned above, you could try asking on a
    MS or Windows specific newsgroup, or on Borland's ones for their
    utilities; for Unix and Unix-like utilities try a newsgroup with unix in
    the name or search for Cygwin for Unix-like utilities under Windows...)

    Chris C
     
    Chris Croughton, May 12, 2005
    #6
  7. Guest

    Seems like everyone agrees, writing the code from scratch would be the
    best thing to do.

    Thanks for the input.
     
    , May 12, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Id L
    Replies:
    2
    Views:
    4,795
    mikeb
    Mar 3, 2004
  2. prem
    Replies:
    1
    Views:
    1,613
    Shankara Narayanan
    Nov 3, 2004
  3. Replies:
    6
    Views:
    9,663
    Kai-Uwe Bux
    May 12, 2005
  4. Parthiv Joshi
    Replies:
    1
    Views:
    708
    Samuel L Matzen
    Jul 6, 2004
  5. Kamarulnizam Rahim
    Replies:
    4
    Views:
    223
    Robert Klemme
    Jan 28, 2011
Loading...

Share This Page