tags:

views:

4608

answers:

9

Hi,

Is anybody aware of a program that can pack several DLL and a .EXE into one executable. I am not talking about .NET case here, I am talking about general DLLs, some of which I generate in C++, some of others are external DLL I have no control over.

My specific case is a python program packaged with py2exe, where I would like to "hide" the other DLL by packing them. The question is general enough though.

The things that had a look at:

  • ILMerge: specific to .NET
  • NETZ: specific to .NET
  • UPX: does DLL compression but not multiple DLL + EXE packing
  • FileJoiner:
Almost got it. It can pack executable + anything into one exe but when opened, it will launch the default opener for every file that was packed. So, if the user user dlldepend installed, it will launch it (becaues that's the default dll opener).

Maybe that's not possible ?


Summary of the answers:

DLL opening is managed by the OS, so packing DLL into executable means that at some point, they need to be extracted to a place where the OS can find them. No magic bullet.

So, what I want is not possible.

Unless...

We change something in the OS. Thanks Conrad for pointing me to ThinInstall, which virtualise the application and the OS loading mechanism. With ThinInstall, it is possible to pack everything in one exe (DLL, registry settings, ...).

A: 

Have you tried Google for this?

http://www.google.com/search?q=combine+dll+and+exe+into+one+file

The top two links looks promising.

Ok, google is fast! It has already linked to this SO question.

Anyway, the two top links I was referring to was, plus some others I found:

Lasse V. Karlsen
Yes I did try google although your search terms look better than mine.Anyway, first link just points to ILMerge, second one to FileJoin which does not do what I need.
Bluebird75
A: 

You can add the DLLs as binary resources in your EXE. At startup, your EXE can then extract the resources into a temporary folder, and LoadLibrary() the resulting DLLs.

Arnout
+2  A: 

If the executable statically links to the DLL, i.e. there are no calls to LoadLibrary, then I don't think there are any mechanisms to pack the DLL into the executable since the DLL load is done by the OS application loader prior to the "main" function being called. The only way around this as far as I'm aware is to put the exe and the dlls into another exe. This wrapper exe unpacks the real exe and dlls into a temporary folder and starts the exe, deleting the files when the exe exits.

If you are calling LoadLibrary/Ex to load the dll, extract the dll from the exe resources to a file prior to the call to LoadLibrary/Ex.

The real problem is that the LoadLibrary function does a lot of fixing up of addresses when the library is loaded and only works when loading from a file.

Skizz

Skizz
I suppose the question is 'is it possible to write a linker that grabs code from a DLL in the way code can be grabbed from a LIB file and add it to the EXE being linked'?
Skizz
The wrapper .EXE is the approach I use. Obviously nowadays you need to think a little bit about where you unpack everything to - don't assume you can unpack into \program files\... without needing to be run-as-admin
Will Dean
+2  A: 

Have a look at Thinstall

Conrad
A: 

MoleBox Pro does exactly what you want, but it is shareware, and, unless you buy a full version, packed executables will show a Dialog Box at startup, saying something like "This file was packed by a trial version of MoleBox, please do not distribute it"

You can downliad it here: link

Unfortunately, I've been unable to find a fully satisfying and free solution

A: 

Have you looked at my cheap-utility list?

There supposed to be several inexpensive (i.e., rather cheap) tools that would link non-net app's DLL(s) together, such as:

1.) Molebox Pro (eu 100) 2.) BitArt's Fusion ($160) 3.) VB Wrap ($100) 4.) PE Bundle ($30)

Additionally, at "www.oreans.com" you might find a protection-oriented program bundle for eu 320, that, as they claim, can link either Win32 or ".Net" files together; however, when I asked them for a specific scenarion, where I would use their "XBundler For Win32/.NET" in order to pack a ".Net" EXE, and then would try to run it on Windos 98 (without the framework), they said it wouldn't work. :-(

EXE Admirer

A: 

I was told it is possible to ask a shared object link to another shared object thus combine them into one in Linux

But it won't work for Windows native dlls, one thing occurrs to me is we can just use the linker to link all the objs together, regardless of which project they belongs to originally. Of course, they need to have similar link options.

lz_prgmr
A: 

Have a look at BoxedApp. Good luck!

Art
A: 

http://www.softhypermarket.com/File-Joiner-download_50739.html has a virus DON NOT download

hfada