Solved

combine two exe files

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

18 Experts available now in Live!

Get 1:1 Help Now