本文整理汇总了Python中ctypes.wintypes.LARGE_INTEGER属性的典型用法代码示例。如果您正苦于以下问题:Python wintypes.LARGE_INTEGER属性的具体用法?Python wintypes.LARGE_INTEGER怎么用?Python wintypes.LARGE_INTEGER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ctypes.wintypes
的用法示例。
在下文中一共展示了wintypes.LARGE_INTEGER属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: vmmap
# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import LARGE_INTEGER [as 别名]
def vmmap(pid, is_64=True):
base = 0
if is_64:
mbi = MEMORY_BASIC_INFORMATION_64()
addr_type = wintypes.LARGE_INTEGER
else:
mbi = MEMORY_BASIC_INFORMATION_32()
addr_type = wintypes.DWORD
proc = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION, 0, pid)
maps = []
while windll.kernel32.VirtualQueryEx(proc.handle, addr_type(base), ctypes.byref(mbi), ctypes.sizeof(mbi)) > 0:
mapperm = 0
if mbi.Protect & win32con.PAGE_EXECUTE:
mapperm = SEG_PROT_X
elif mbi.Protect & win32con.PAGE_EXECUTE_READ:
mapperm = SEG_PROT_X | SEG_PROT_R
elif mbi.Protect & win32con.PAGE_EXECUTE_READWRITE:
mapperm = SEG_PROT_X | SEG_PROT_R | SEG_PROT_W
elif mbi.Protect & win32con.PAGE_EXECUTE_WRITECOPY:
mapperm = SEG_PROT_X | SEG_PROT_R
elif mbi.Protect & win32con.PAGE_NOACCESS:
mapperm = 0
elif mbi.Protect & win32con.PAGE_READONLY:
mapperm = SEG_PROT_R
elif mbi.Protect & win32con.PAGE_READWRITE:
mapperm = SEG_PROT_R | SEG_PROT_W
elif mbi.Protect & win32con.PAGE_WRITECOPY:
mapperm = SEG_PROT_R
#print hex(mbi.BaseAddress) +"\t"+ hex(mbi.BaseAddress + mbi.RegionSize) +"\t"+ hex(mapperm)
maps.append((mbi.BaseAddress, mbi.BaseAddress + mbi.RegionSize, mapperm, ""))
base += mbi.RegionSize
win32api.CloseHandle(proc)
return maps