Solved

combine two exe files

Posted on 1998-02-16
4
1,539 Views
Last Modified: 2013-12-03
Is there a way of combining two exe files using binary
editor ? How should I write my exe file so that
when I append any exe file to my exe file with binary editor
my exe runs first then when completed the appended exe
starts running
0
Comment
Question by:hasmet
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 1411310
Answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1411311
Yes and no.  You could place the second EXE in the resource data for the first EXE.  This would combine them into one and the first one could be run fine.  However, you can not run the second EXE.  Each EXE begins with a header that Windows needs to run the EXE.  There is no way to get windows to run the second EXE when it is embedded in the first because it will look at the first EXE's header.  (It could be possible to modify the first EXE's header to specify the information needed to load the second, but this can't be done while the first EXE is running, because the file will be read only.)

If you have to do it this way, one way around it would be to have the first exe write out the second exe (from its resource data) to a temporary EXE file, run the temporary EXE, then delete the temporary EXE file.

A better option might be to rethink your design.  It sounds a little weird.  Perhaps the second EXE should be made into a DLL?

0
 
LVL 1

Author Comment

by:hasmet
ID: 1411312
dont they add that virus programs to the exe files to run
together ?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1411313
Why are you asking?  --  just kidding.

one way what a virus does this is that it stores the EXE file at the end of the virus EXE (kindof like windows resources).  Then when the virus is loaded and done its work, it rewrites the stored EXE over the virus+stored EXE.  This works in DOS, but not windows, since the EXE is not open read only in DOS.

A more typical solution would be to add a small viral stub (not a real EXE) to the end of the infected EXE.  The modify the eXE's header to start execution in the stub.  The viral stub then executes the original starting point when it is done.  This technique is ot practival for anything more than a simple stub.  A real EXE won't work because it has fix-up's and dynamic links.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now