Page 1 of 1

Embedding an exe with your program

Posted: Sat Dec 08, 2007 4:05 am
by Mistrel
There are a few posts on this but I didn't find any of them to be very clear. Here is a simple example of how to embed an exe with your program and how to run it.

Code: Select all

If OpenFile(1,"File.exe")
  WriteData(1,?File,?FileEnd-?File)
  CloseFile(1)
EndIf

DataSection
  File:
  IncludeBinary "File.exe"
  FileEnd: 
EndDataSection

RunProgram("File.exe")

Posted: Sat Dec 08, 2007 6:23 am
by npath
This is very useful information. I will definitely use it in my projects. Thanks.

npath

Posted: Sat Dec 08, 2007 8:39 am
by superadnim
You could do this from memory, given the platform is win2000+
Meaning, no temporary files (faster since you avoid disk io).

Running from memory is what exe packers do. I don't know if theres any 9x methods though.

It's quite clear if you understand the API behind it.