1

Is that possible, to combine two exe files?

I need it to work like this:

  • User is running combined.exe (combination of 2 exe files).
  • When first exe is loaded and user has clicked "Start" there (I got the source code), then second exe file will run.

Is that even possible?

ᔕᖺᘎᕊ
  • 6,393
Cyclone
  • 143
  • 2
  • 2
  • 8

4 Answers4

1

Add the second EXE file as a resource in the wrapper program. Then when you need to run it, you can extract it to a temporary directory and run it.

(I take it that by I got [sic] the source code, you mean AutoIt code?) I did only a quick check, but I think AutoIt (or at least the compiler) supports adding and extracting resources and it should support using the Windows API. As for protecting the EXE, there’s really little you can do short of strong encryption, but you can lock the file, and close it with the FILE_FLAG_DELETE_ON_CLOSE flag set to automatically delete it.

Synetech
  • 69,547
1

In the malware world people often use .exe binders to combine two and sometimes encrypt the final result to prevent detection, so you may find that much of the software available to do this will result in your application being flagged as malware.

Example of software intended for malicious purposes: File Joiner

However, if you omit the encryption stub you may find that the is not flagged, just upload to virustotal.com and check the results. I would do this regardless of which solution you choose.

user30441
  • 151
  • 2
0

You should look at EXE protectors if you don't want users to be poking at your code. It's hard to dynamically start a new process without a stub EXE of some sort, and I wouldn't even try to write EXE segments from AutoIt. (Actually, I've been able to execute pieces of assembly from AutoIt, but on Vista+ Data Execution Prevention usually kills it.)

cyanic
  • 319
  • 3
  • 11
0

This is slightly different from your example, but this is how to combine .exe's using AutoHotkey: compile the following script with First.exe and Second.exe in the same folder. After compiling, you only need to keep the single wrapper .exe.

FileCreateDir, tmp

FileInstall, First.exe, tmp\First.exe
FileInstall, Second.exe, tmp\Second.exe

RunWait, tmp\First.exe

MsgBox, 4, , Run Second.exe?

IfMsgBox, Yes
    RunWait, tmp\Second.exe

FileRemoveDir, tmp, 1

ExitApp
iglvzx
  • 23,818