當前位置: 首頁>>代碼示例>>Python>>正文


Python win32con.PROCESS_ALL_ACCESS屬性代碼示例

本文整理匯總了Python中win32con.PROCESS_ALL_ACCESS屬性的典型用法代碼示例。如果您正苦於以下問題:Python win32con.PROCESS_ALL_ACCESS屬性的具體用法?Python win32con.PROCESS_ALL_ACCESS怎麽用?Python win32con.PROCESS_ALL_ACCESS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在win32con的用法示例。


在下文中一共展示了win32con.PROCESS_ALL_ACCESS屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import PROCESS_ALL_ACCESS [as 別名]
def __init__(self, pid):
        handle = self.handle = ctypes.windll.kernel32.OpenProcess(
            READ_ACCESS, # win32con.PROCESS_ALL_ACCESS,
            False,
            pid)

        # Close the handle on GC so we do not leak handles.
        self._closer = weakref.ref(self, lambda x: CloseHandle(handle)) 
開發者ID:google,項目名稱:rekall,代碼行數:10,代碼來源:windows_processes.py

示例2: _readListViewItems

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import PROCESS_ALL_ACCESS [as 別名]
def _readListViewItems(hwnd, column_index=0):
    # Allocate virtual memory inside target process
    pid = ctypes.create_string_buffer(4)
    p_pid = ctypes.addressof(pid)
    GetWindowThreadProcessId(hwnd, p_pid)  # process owning the given hwnd
    hProcHnd = OpenProcess(win32con.PROCESS_ALL_ACCESS, False, struct.unpack("i", pid)[0])
    pLVI = VirtualAllocEx(hProcHnd, 0, 4096, win32con.MEM_RESERVE | win32con.MEM_COMMIT, win32con.PAGE_READWRITE)
    pBuffer = VirtualAllocEx(hProcHnd, 0, 4096, win32con.MEM_RESERVE | win32con.MEM_COMMIT, win32con.PAGE_READWRITE)

    # Prepare an LVITEM record and write it to target process memory
    lvitem_str = struct.pack('iiiiiiiii', *[0, 0, column_index, 0, 0, pBuffer, 4096, 0, 0])
    lvitem_buffer = ctypes.create_string_buffer(lvitem_str)
    copied = ctypes.create_string_buffer(4)
    p_copied = ctypes.addressof(copied)
    WriteProcessMemory(hProcHnd, pLVI, ctypes.addressof(lvitem_buffer), ctypes.sizeof(lvitem_buffer), p_copied)

    # iterate items in the SysListView32 control
    num_items = win32gui.SendMessage(hwnd, commctrl.LVM_GETITEMCOUNT)
    item_texts = []
    for item_index in range(num_items):
        win32gui.SendMessage(hwnd, commctrl.LVM_GETITEMTEXT, item_index, pLVI)
        target_buff = ctypes.create_string_buffer(4096)
        ReadProcessMemory(hProcHnd, pBuffer, ctypes.addressof(target_buff), 4096, p_copied)
        item_texts.append(target_buff.value)

    VirtualFreeEx(hProcHnd, pBuffer, 0, win32con.MEM_RELEASE)
    VirtualFreeEx(hProcHnd, pLVI, 0, win32con.MEM_RELEASE)
    win32api.CloseHandle(hProcHnd)
    return item_texts 
開發者ID:ynzheng,項目名稱:pyautotrade_tdx,代碼行數:31,代碼來源:winguiauto.py

示例3: GetProcessNameFromHwnd

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import PROCESS_ALL_ACCESS [as 別名]
def GetProcessNameFromHwnd(self, hwnd):
		'''Acquire the process name from the window handle for use in the log filename.
		'''
		threadpid, procpid = win32process.GetWindowThreadProcessId(hwnd)
		
		# PROCESS_QUERY_INFORMATION (0x0400) or PROCESS_VM_READ (0x0010) or PROCESS_ALL_ACCESS (0x1F0FFF)
		
		mypyproc = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, procpid)
		procname = win32process.GetModuleFileNameEx(mypyproc, 0)
		return procname 
開發者ID:tuwid,項目名稱:darkc0de-old-stuff,代碼行數:12,代碼來源:logwriter.py

示例4: beNice

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import PROCESS_ALL_ACCESS [as 別名]
def beNice(very_nice=False):
        if very_nice:
            value = BELOW_NORMAL_PRIORITY_CLASS
        else:
            value = IDLE_PRIORITY_CLASS

        pid = GetCurrentProcessId()
        handle = OpenProcess(PROCESS_ALL_ACCESS, True, pid)
        SetPriorityClass(handle, value) 
開發者ID:tuwid,項目名稱:darkc0de-old-stuff,代碼行數:11,代碼來源:tools.py

示例5: run

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import PROCESS_ALL_ACCESS [as 別名]
def run(self):
        try:
            self.handle = ctypes.windll.kernel32.OpenThread(  # @UndefinedVariable
                win32con.PROCESS_ALL_ACCESS, False, int(QThread.currentThreadId()))
        except Exception as e:
            print('get thread handle failed', e)
        print('thread id', int(QThread.currentThreadId()))
        for i in range(1, 101):
            print('value', i)
            self.valueChanged.emit(i)
            QThread.sleep(1) 
開發者ID:PyQt5,項目名稱:PyQt,代碼行數:13,代碼來源:SuspendThread.py


注:本文中的win32con.PROCESS_ALL_ACCESS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。