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