Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all dlls loaded by a process with Python?

I want to list all the dlls loaded by a process, like this:

enter image description here

How could I get the information with Python on Windows?

like image 749
wong2 Avatar asked Apr 05 '11 14:04

wong2


People also ask

How can I see what DLLs are loaded by a process?

Unzip it and run the executable (procexp.exe) on the target machine as an administrator. Once running, enable viewing of loaded DLLs by either pressing CTRL+D or using the View > Lower Pane View > DLLs entry from the menu bar. Select the target process in the upper pane. The lower pane should now show loaded modules.

What tool shows all the files and DLLs being used by a process?

ListDLLs v3. ListDLLs is a utility that reports the DLLs loaded into processes. You can use it to list all DLLs loaded into all processes, into a specific process, or to list the processes that have a particular DLL loaded.

What are DLL libraries?

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Each program can use the functionality that is contained in this DLL to implement an Open dialog box.


1 Answers

Using the package psutil it is possible to get a portable solution! :-)

# e.g. finding the shared libs (dll/so) our python process loaded so far ...
import psutil, os
p = psutil.Process( os.getpid() )
for dll in p.memory_maps():
  print(dll.path)
like image 115
Zappotek Avatar answered Sep 21 '22 15:09

Zappotek