Python winappdbg:使用内核32函数

Python winappdbg:使用内核32函数,python,windows,Python,Windows,我尝试使用函数GetProcessTimeshprocess 我使用以下代码: p = debug.excel(argv,bFollow=True) win32.kernel32.GetProcessTimes(p) 但这不起作用 此函数接受给定的4个参数5 有人能帮忙吗?我忘了什么 谢谢我可以建议您自己打电话吗?摘自python本身: 我忘了什么三个论点;不,不是。GetProcessTimes只需一次。。。错误在kernel32.py中……我诙谐的评论是想说,除非你发布一些更详细的信息,否

我尝试使用函数GetProcessTimeshprocess

我使用以下代码:

p = debug.excel(argv,bFollow=True)
win32.kernel32.GetProcessTimes(p)
但这不起作用

此函数接受给定的4个参数5

有人能帮忙吗?我忘了什么


谢谢

我可以建议您自己打电话吗?摘自python本身:


我忘了什么三个论点;不,不是。GetProcessTimes只需一次。。。错误在kernel32.py中……我诙谐的评论是想说,除非你发布一些更详细的信息,否则很难帮助你。例如:您确定错误是由GetProcessTimes引发的吗?否错误是由kernel32.py中的_GetProcessTimes引发的。我使用了错误的API,但是我没有找到任何这个函数的例子。。
# if you have win32 process
import win32process
def getprocesstimes_systimes():
    d = win32process.GetProcessTimes(win32process.GetCurrentProcess())
    return (d['UserTime'] / WIN32_PROCESS_TIMES_TICKS_PER_SECOND,
        d['KernelTime'] / WIN32_PROCESS_TIMES_TICKS_PER_SECOND)

# otherwise, ctypes approach
import ctypes
def getprocesstimes_systimes():
    creationtime = ctypes.c_ulonglong()
    exittime = ctypes.c_ulonglong()
    kerneltime = ctypes.c_ulonglong()
    usertime = ctypes.c_ulonglong()
    rc = ctypes.windll.kernel32.GetProcessTimes(
        ctypes.windll.kernel32.GetCurrentProcess(),
        ctypes.byref(creationtime),
        ctypes.byref(exittime),
        ctypes.byref(kerneltime),
        ctypes.byref(usertime))
    if not rc:
        raise TypeError('GetProcessTimes() returned an error')
    return (usertime.value / WIN32_PROCESS_TIMES_TICKS_PER_SECOND,
            kerneltime.value / WIN32_PROCESS_TIMES_TICKS_PER_SECOND)