Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Self-extracting exe?

Status
Not open for further replies.

inetd

Technical User
Jan 23, 2002
115
HK
How can I write a program which is a self-extract exe file so that some files are embeded in the exe?
 
Well, I'm not an expert but first of all there is programs allowing You to make an self-extracting exe, like Windows Commander. But if what You're looking for is an exe that extracts some files, saves them AND continues to run I would choose to make the extracting program and then add the files to extract as datas to the program.


Totte
 
I'm not sure...but I think it would go something like this.

Write the extracting file first. All it does is open itself up and go to byte location 300. (assuming that the executable is 299 bytes). Then it reads 100 kbytes, writes it to the correct file, reads the next 100 kbytes, writes those to another file, etc. Close the file.

Now don't run this program yet or it will do nothing since you haven't attached the files to the end of the executable.

Write another program that takes the self-extracting one and appends the other files to the end of it.

Now run this new self-extracting file, and it should work. It wouldn't be that much more difficult to add zipping routines to it then either.

This seems like a logical approach to me since files are just executed from the first opcode in them til they return...which would realistically be in the middle of the executable in this case. I've never tried it though, so let me know if it works. :)

Chris
 
Adding to what Superna03 said, there are several zip utilities for BCB. One is JZIP at Another is with TurboPower's Abbrevia .

James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
should be no problem to embed one or more files in another file.

if an embedded file is 20000 char long just store the char's as a char string or array. then when you extract it , it will just be as simple as writing the string or array to file. the compression will be the dificult part though. useful in delivering selfextracting installations of software, ie, trojans "excuseme" i mean legit software.

oh and dont forget the timed release of the trojan, I mean sofware. ;-)

my 'as usual' oversimplification of the task at hand.

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top