简体   繁体   中英

Starting a DLL as a exe

Is it possible to load a native (C++) DLL as an executable? preferablly straight from the memory without creating EXE on the hard-drive or something similar?

Microsoft提供了Rundll32.exe ,可用于执行已明确编码为支持此用法的DLL函数。

What, specifically, would this mean? For example, what entry point would it use in the DLL?

The only way this would actually work would be if the DLL was specifically written to allow it. And if that were the case, then it's not exactly clear why you would not just create an executable file instead of a DLL in the first place.

Case in point is the RunDLL32.exe stub. It's designed to execute a function from a DLL with a specific signature as the entry point. If the DLL wasn't specifically designed to comply with this signature, then things don't go well . If you need functionality like this, you might want to consider matching the function signature required by RunDLL32.exe and using it to "execute" your DLL.

Look up rundll32.exe . But you'd better know exactly what you're doing. I'm not sure, honestly.

您可以使用LoadLibrary WinAPI调用来加载DLL。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM