Solved

combine two exe files

Posted on 1998-02-16
4
1,549 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

695 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