Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packing an exe + dll into one executable (not .NET) [duplicate]

Tags:

dll

People also ask

Can you compile a DLL into an EXE?

Yes, it is possible to merge . NET executables with libraries. There are multiple tools available to get the job done: ILMerge is a utility that can be used to merge multiple .

How do I combine DLL files?

Just merge them into the executable. I think ILMerge expects the out to be a exe, not a DLL. Also remove the double backslash in the paths, its finicky and does not do good exception handling. For instance the current version of ILMerge will throw the same error if you give it paths that have spaces in them.

What is the difference between the DLL and the EXE in .NET framework?

Difference between exe and dll-1. EXE is an extension used for executable files while DLL is the extension for a dynamic link library. 2.An EXE file can be run independently while a DLL is used by other applications. 3.An EXE file defines an entry point while a DLL does not.


Have a look at BoxedApp. Good luck!


Have a look at Thinstall ThinApp


Try Powerpacker. Evalaze is another free virtualization solution. Enigma Virtual Box FREEWARE Edition


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.


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.