Need to View the contents of an EXE file

A

adirajuv

I wrote a program in VC++ 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.
 
P

Phlip

adirajuv said:
I wrote a program in VC++ 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?

You can disassemble it and look at the opcodes. That's all. Storing any
representation of your source would waste precious image size in an EXE.
If not, is there a way I can atleast view the contents of the exe file?

Under VC++, you can debug it and watch its opcodes tick. You'l get no hits
where the opcodes came from, so a slew of 20 of them might come from one
statement. And optimizations will blur together the statements. After a lot
of research, you'l be able to pick out the algorithms, and learn to focus on
the important parts.

Write whatever you wrote again. I know that's a wrench, but the second time
around is always better anyway.
 
A

adirajuv

Thanx Phlip and Ben. Its actually not too big a file. less than 500KB.
To be honest, I only wanted to find a way to read thru the exe file.
Its a short program that ftp's my website and uploads a document there.
I cannot access the server from work. So was just wondering, If I
create an exe and send it to one of my friends, if they would be able
to get my password from the exe.

Thanks.
 
A

Alvin

Thanx Phlip and Ben. Its actually not too big a file. less than 500KB.
To be honest, I only wanted to find a way to read thru the exe file.
Its a short program that ftp's my website and uploads a document there.
I cannot access the server from work. So was just wondering, If I
create an exe and send it to one of my friends, if they would be able
to get my password from the exe.

Thanks.

Yes, if you write your password as:

std::string passwd = "qwerty";

then they will be able to get your password.

The string literal (not the passwd but the quoted stuff) will appear as
clear text.

If you have access to a Linux box, run the command:

strings myprog.exe

Then you will see all the strings in the exe file.
 
M

MSR

Suprising that noone has (yet) told you this is a wrong group and your
question has nothing to do with starndard C++ .

--MSR
 
K

Kai-Uwe Bux

Thanx Phlip and Ben. Its actually not too big a file. less than 500KB.
To be honest, I only wanted to find a way to read thru the exe file.
Its a short program that ftp's my website and uploads a document there.
I cannot access the server from work. So was just wondering, If I
create an exe and send it to one of my friends, if they would be able
to get my password from the exe.

Thanks.

Now, that is an entirely different story. If you put your password in there
as constant data, very likely they can:

a) Constant data very often is grouped together in a special segment in the
executable. Opening the file in a text- or hex-editor will likely reveal
the value of any compiled in strings.

b) Running your exe-file within a debugger also can reveal that value.

c) The unix utility "strings" is a notoriously easy way of dumping all
compile time string constants from an executable.


Best

Kai-Uwe Bux
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top