Solved

combine two exe files

Posted on 1998-02-16
4
1,543 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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