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

后端 未结 2 1395
太阳男子
太阳男子 2020-12-30 09:02

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

\"enter

How could

相关标签:
2条回答
  • 2020-12-30 09:27

    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)
    
    0 讨论(0)
  • 2020-12-30 09:28

    Using listdlls:

    import os
    os.system('listdlls PID_OR_PROCESS_NAME_HERE')
    
    0 讨论(0)
提交回复
热议问题