News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Is this possible?

Started by trodon, August 05, 2006, 10:22:56 AM

Previous topic - Next topic

trodon

I have one maybe stupid question but i cannot how to say because my english is poor  ::)
you probably know how .rar,.zip etc.. work
just put some file in arhiver and viola  :green
but, i was thinking about .exe file arhiver
for example open your .exe file and put notepad inside your exe file and close.
for example to save your file in .rsrc section etc...
is there any people on board that is try to make something like this?

dsouza123

It has been possible for more than a decade to turn .zip files into self extracting .exe files

Installers do something similar, binding a bunch of files together into an .exe

It is possible to to save binary data in the .rsrc section.

for example including a .bmp file

300 BITMAP DISCARDABLE "sample.bmp"

trodon

no, you are not understand my question
i im not ask question how to add bmp or how to make selfexpact Arhiver
i asking if posible to to create some exe file when open this file and for example drag some file (notepad or something like this)
and click save, to save this notepad intro this .exe file like .rar arhiver

dsouza123

An overview on the differences between an executable program (.exe)
and a text file (.txt) or some other data file (.mp3 or .wav files for example).
Also the special case of a self extracting archive executable.

An .exe program is an executable file it is Run rather than opened like a .txt (text file) or some other data file.

A text file (.txt) is opened by some program and the content can then be changed and the file resaved.

An executable (.exe) program is run by the CPU under the supervision of the OS (Operating System)

A typical process of completely assembling or compiling ( building) a program
involves assembling or compiling source code to object code
compiling resource files to object code
then linking the various object files into an executable.

Programs can access ( read/write/modify) external data files.

For a program to use a resource item or text data (internal) or an external file,
it needs to be coded to access it or it will not be used.

The normal ways of including text in a program is to add it in strings
in the .data section or even embedded in the .code section, or in resource strings,
or use a special program to convert the file to an object file which is linked in.

After the fact (after being built) a program could be patched to modify
the content of some string by a patching program or hex editor but
it typically is used when the source code or some part of the building process
isn't available or the change is very small and well defined.

The .bmp file line in the resource code file is an example
it could be some other type of file (maybe even a text file) that is included as a resource.

A self extracting executable is an atypical program, it is really just a delivery mechanism
for various files that combines the files (possibly compressed) with a stub .exe program
and some sort of index/directory of the various files into one executable.
The self extractor is used in situations where a simple archive file wont work because the
unarchiving program isn't available/installed on the computer that the files are to be
unarchived on.
The self extractor can interact with the user to determine placement and whether to
even extract the files.
The OS or an extension to it could create/modify self extracting archive programs similar to
the way Windows XP handles .zip files as compressed folders or one of the more advanced
archiver programs does by dragging some file on to an archive to add it to an existing archive.
The added file(s) would have to be attached and the internal directory of files updated
in the modified self extracting archive program.

When you mention notepad and later notepad intro do you mean a .txt (text file)
created by notepad or the actual notepad.exe executable ?

If a text file, what is the purpose of adding this to an .exe file ?

omer_akhter

Hello,

Well may be I can help here, I think trodon is trying to say that there should some sort standalone document executable. Like it should contain the data (the actual document) as well as it own veiwer so that we can take the file anywhere without worrying about the presence of some veiwer software on the target machine.

A near figure of this idea I may say is the compiled html help file. It has the document and somewhat its own veiwer which in fact is dependeant on Internet Explorer.


dsouza123

Omer, thank you for the clarification.

There have been DOS programs that did that and there is at least one windows txt2exe that does it.

The qikpad example program included in the examples could be modified to use text from a text file appended to it.
With the original size of the exe known the appended text file can be accessed at that starting point.

In effect a fixed size stub with text starting at a known offset.

Tedd

Trodon -- if this is no help, post your question in your native language :wink
It may be easier to translate your question :8)
No snowflake in an avalanche feels responsible.

trodon

QuoteWhen you mention notepad and later notepad intro do you mean a .txt (text file)
created by notepad or the actual notepad.exe executable ?

i was mean to notepad.exe and all others .exe files

P1

A exe portable self contained archive.  I like the idea.

No software to load to use.  Keep in mind, it going to be freeware.  Seeing I can not imagine how you could get any back for it.

A drawback is, it can become an attack vector for malware.

Keep us posted on your progress.

Regards,  P1  :8)