开发者

C++, Can't find loaded C# DLL while enumerating loaded modules

开发者 https://www.devze.com 2023-03-20 02:00 出处:网络
thank you for taking the time to read this. The situation is basically, I\'m using EnumProcessModulesEx to enumerate all the modules in a loaded process. I\'ve verified that the process I\'m getting

thank you for taking the time to read this.

The situation is basically, I'm using EnumProcessModulesEx to enumerate all the modules in a loaded process. I've verified that the process I'm getting with GetCurrentProcess is correct (via the ID). I seem to be getting all the loaded modules except the one I want! It's a C# DLL that is only loaded when the C# DLL function is called. I made s开发者_JS百科ure the DLL was loaded before I ran the enumerating function. Is there a reason this C# DLL won't show up?

I also put this enumeration after I load a couple of other C# DLLs in my C++ code. It doesn't seem to be finding those either. All of these C# DLLs are dynamically loaded. I figure it shouldn't matter because a) everything is mapped into the process address space anyways, and b) I have a C++ DLL that is injected (dynamically loaded?) and I can find that just fine. My goal is to be able to hook a C# DLL function, so being able to find these C# DLLs is a must in this project.

Thank you all again for any tips or insights! =)


EnumProcessModulesEx will not enumerate .Net DLLs. It only enumerates native DLLs.

You can use the GetAssemblies method of the current AppDomain to enumerate .Net DLLs.

0

精彩评论

暂无评论...
验证码 换一张
取 消