符号初始化 python

SymInitialize python

from ctypes import *
from capstone import *

k32 = windll.kernel32
dbghelp = cdll.LoadLibrary('dbghelp.dll')

handle = k32.LoadLibraryEx(modulePath, 0, 1) #DONT_RESOLVE_DLL_REFERENCES
hproc = k32.GetCurrentProcess()

ret = dbghelp.SymInitialize(hproc, sympath, 1)

SymInitialize returns 0

GetLastError returns-1073741813

我做错了什么,用 C++ 编写的相同代码工作得很好。

我指定了准确的函数签名,现在可以使用了。

from ctypes.wintypes import HANDLE, LPCSTR, UINT 
si = windll.dbghelp.SymInitialize
si.argtypes = [HANDLE, LPCSTR, UINT]