Listing process modules
Pymem comes with somes process utilities like listing loaded modules.
Here is a snippet that will list loaded process modules
import pymem
pm = pymem.Pymem('python.exe')
modules = list(pm.list_modules())
for module in modules:
print(module.name)
So what did that code do?
we hook pymem with python.exe process
we retrieve the list of loaded modules
for every module listed, we display its name
note: every module is an instance of MODULEINFO()