C # import the DLL into the EXE and shell it

Source: Internet
Author: User

Ilmerge runs in the V2.0. Net runtime, but it is also able to merge V1 or V1.1 assemblies. However it can merge PDB files only for V2 assemblies.

Currently, ilmerge works only on Windows-based platforms. It does not yet support rotor or mono.

Download: http://download.microsoft.com/download/1/3/4/1347C99E-9DFB-4252-8F6D-A3129A069F79/ILMerge.msi

Because the three-tier architecture is used, there are many DLL files under the running directory. At the end of the release, I plan to merge the DLL files into the EXE files. Ilmerge, a free software released by Microsoft, can do this. After studying it, its usage is as follows:

1. Merge file1.dll and file2.dll to destination. dll.
Ilmerge/ndebug/Target: dll/out: C: \ destination. dll/log c: \ file1.dll c: \ file2.dll

2. Merge file1.dll1_file2.dllwith myapp.exeto newapp.exe
Ilmerge/ndebug/Target: winexe/out: C: \ newapp.exe/log c: \ myapp.exe c: \ file1.dll c: \ file2.dll

Note: When merge is exe, myapp.exe must be written before file1.dll and file2.dll.

after the build, you will get an EXE file. If you want to do something evil, you can merge the DLL of some cracking software into your exe. The premise is that all the DLL files are hosted. If you try to merge the DLL files written in C ++, it will fail. A tool called mergebin.exe can be used to merge hosted and unmanaged DLL files. I haven't studied the usage yet, and it seems quite difficult. This tool is ADO. NET 2.0 data provider for SQLite written by the author, he published the system. data. SQLite. dll can be referenced by DOTNET Program or directly called by C/C ++ programs, this dll is a hosted and unmanaged hybrid DLL, which is really awesome! Mergebin.exe is in its source code package. If you are interested, you can study it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.