Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I wrote a simple network assistance. The login verification code identification uses the wmcode.dll provided by others, but this dynamic library is upx3 91 compressed, anti-virus software always indicates that it is poisonous, so I want to integrate the dynamic library into the main program as a resource. When necessary, the memory is loaded and used directly, but it has not been solved successfully.

What I have tried:

I mainly want to make a single file of the main program, but I don't want to release the file.
I found a lot of codes on the Internet, but they didn't succeed. Either they didn't support the compressed DLL, and I still have a superficial grasp of PE format.
Yes,I know how to embed a .dll as resources into my c++ main app,Now,Because I don't want to release this file,so,unable continue to use LoadLibrary() Load and run it,

only use the way of direct memory loading. Refer to other people's example programs. It always throws exceptions at the Dllmain() entrance and can't run.
I know that the DLL compressed by upx, no matter how it is loaded, will lead to the false alarm of virus by anti-virus software. Therefore, I have decompressed the DLL with upx, so that there will be no false alarm of virus. On this basis, I prefer to embed the decompressed DLL into the main program as a resource and load the memory directly when necessary. In this way, the program I More want to release has only one file of the main program. The problem is that now, no matter the compressed or decompressed DLL, I can't successfully load and use the memory directly. Because my permission on the website is very low, so So I can't upload relevant codes for analysis. So I left my email: 24885530@qq.com , I hope a kind person can help me sometime.
Posted
Updated 6-Feb-22 1:23am
v6
Comments
Richard MacCutchan 29-Jan-22 10:47am    
"I don't know what went wrong"
Unfortunately no one here can guess what it could be. Please use the Improve question link above, and add complete details of the code you are using, and what is not working.
Dave Kreskowiak 29-Jan-22 11:19am    
Are you asking how to embed a .DLL into your main app resources and then unpack that .DLL when needed?

1 solution

There seems to be programs that can do that. I found this with google. I don't know if it works.
DLL to Lib - Convert DLLs into static libraries[^]

UPX is not a good protection against reverse engineering, since UPX-packed programs can be unpacked by UPX itself and can also be easily recovered by debuggers/dumpers.

Unmodified UPX-packed programs are often recognized as such and unpacked by anti-virus programs.
(Source: Wikipedia)

So the probability is high that this is actually a virus.

I would recommend uncompressing.

07.02.2022
The now modified requirement states that the DLL should be included in the executable file.

Here is a possible Solution for this:
library that can be used to load a DLL completely from memory.
GitHub: MemoryModule is a library to load a DLL from memory.[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900