Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find a list of all unmanaged DLLs loadad by my managed .net application

My managed .net application uses third party .net libraries, which use (via PInvoke) unmanaged dlls. I would like to find out, which dlls are loaded. I tried to use "Process Explorer" and "Dependency Walker", but I can only see the managed DLLs.

like image 964
Gerhard Avatar asked Aug 30 '12 09:08

Gerhard


1 Answers

Any debugger could do this (windbg for example) - but since it's a good chance you're packing Visual Studio I'll talk about how to do it in that

Attach the Visual Studio debugger to the application, remembering to select only the Native debugger as follows:

How to set debugger type to Native

Once you're attach, hit Debug -> Break and then press [CTRL] + [ALT] + [U] to bring up the Modules window (it's on the menu somewhere but I can't find it!) - here's an example shot from the Samsung Kies application my desktop (which uses WPF):

The modules list

In my case I enabled the Managed debugger too, and moved the process name to the start of the columns list for the purposes of that screenshot.

If the process name has : Native after it, then it's an unmanaged DLL (well, it could also be mixed-mode I suppose).

Note that all processes in Windows will always have a good long list of unmanaged DLLs loaded; because Windows is unmanaged at it's heart and is the ultimate host of the application.

But certainly you can use this list as a starting point and filter down from there.

like image 191
Andras Zoltan Avatar answered Oct 20 '22 01:10

Andras Zoltan