from ctypes import *
from my_debugger_defines import *
kernel23 = windll.kernel32
class debugger():
def __init__(self):
pass
def load(self,path_to_exe):
creation_flags = DEBUG_PROCESS
startupinfo = STARTUPINFO()
process_information = PROCESS_INFORMATION()
startupinfo.dwFlags = 0x1
startupinfo.wShowWindow = 0x0
startupinfo.cb = sizeof(startupinfo)
if kernel32.CreateProcessA(path_to_exe,
None,
creation_flags,
None,
None,
byref(startupinfo),
byref(process_information)):
print "[*] we have successfully lauched the process!"
print "[*] pid: %d "%process_information.dwProcessId
else:
print "[*] error: 0x%08x."%kernel32.GetLastError()
附程序,完全按照别人的代码写的啊,为什么就说kernel32没定义呢,第15行,和最后一行