How to enumerate modules in python 64bit

后端 未结 1 1717
一个人的身影
一个人的身影 2021-01-05 17:11

I have a block of code that works great in 32bit, and I\'m trying to make it work in 64bit as well. When running the process, the sizeof(structure) seems to be returning in

相关标签:
1条回答
  • 2021-01-05 17:24

    Try using the correct definition:

    class MODULEENTRY32(Structure):
        _fields_ = [( 'dwSize' , DWORD ) , 
                    ( 'th32ModuleID' , DWORD ),
                    ( 'th32ProcessID' , DWORD ),
                    ( 'GlblcntUsage' , DWORD ),
                    ( 'ProccntUsage' , DWORD ) ,
                    ( 'modBaseAddr' , POINTER(BYTE) ) ,
                    ( 'modBaseSize' , DWORD ) , 
                    ( 'hModule' , HMODULE ) ,
                    ( 'szModule' , c_char * 256 ),
                    ( 'szExePath' , c_char * 260 ) ]
    
    0 讨论(0)
提交回复
热议问题