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

五迷三道 提交于 2019-12-31 22:01:22

问题


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

How could I get the information with Python on Windows?


回答1:


Using listdlls:

import os
os.system('listdlls PID_OR_PROCESS_NAME_HERE')



回答2:


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)


来源:https://stackoverflow.com/questions/5553917/how-to-list-all-dlls-loaded-by-a-process-with-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!