Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

combine two exe files

Posted on 1998-02-16
4
Medium Priority
?
1,556 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 400 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

596 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