By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,470 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,470 IT Pros & Developers. It's quick & easy.

Need to View the contents of an EXE file

P: n/a
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

Nov 14 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Currently there are no tools that does this. For java there are
decoders but definitely for an c++ executable.

Nov 14 '05 #2

P: n/a
Currently there are no tools that does this. For java there are
decoders but definitely not for an c++ executable.

Nov 14 '05 #3

P: n/a
On 12 May 2005 01:01:29 -0700, in comp.lang.c , ad******@gmail.com
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 =----
Nov 14 '05 #4

P: n/a
ad******@gmail.com 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

Nov 14 '05 #5

P: n/a
On 12 May 2005 01:01:29 -0700, ad******@gmail.com
<ad******@gmail.com> 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
Nov 14 '05 #6

P: n/a
Seems like everyone agrees, writing the code from scratch would be the
best thing to do.

Thanks for the input.

Nov 14 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.