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


Python wintypes.LPCVOID屬性代碼示例

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


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

示例1: control_service

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import LPCVOID [as 別名]
def control_service(service_handle, control, service_status):
	"""See: ControlService function
	https://msdn.microsoft.com/en-us/library/windows/desktop/ms682108(v=vs.85).aspx
	"""
	ControlService_Fn = ctypes.windll.Advapi32.ControlService	 	#BOOL WINAPI ControlService(
	ControlService_Fn.argtypes = [							#
		wintypes.SC_HANDLE,									#	_In_  SC_HANDLE        hService,
		wintypes.DWORD,										#	_In_  DWORD            dwControl,
		wintypes.LPCVOID 							        #	_Out_ LPSERVICE_STATUS lpServiceStatus
	]
	ControlService_Fn.restype = wintypes.BOOL
	bool = ControlService_Fn(
		service_handle,
		control,
		service_status
	)
	return bool 
開發者ID:FSecureLABS,項目名稱:win_driver_plugin,代碼行數:19,代碼來源:driverlib.py

示例2: read_process_memory

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import LPCVOID [as 別名]
def read_process_memory(
    handle: wintypes.HANDLE,
    base_address: wintypes.LPVOID,
    buffer: wintypes.LPCVOID,
    size: ctypes.c_size_t,
    size_ptr: ctypes.POINTER(ctypes.c_size_t),
) -> wintypes.BOOL:
    pass 
開發者ID:NeKitDS,項目名稱:gd.py,代碼行數:10,代碼來源:win.py

示例3: write_process_memory

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import LPCVOID [as 別名]
def write_process_memory(
    handle: wintypes.HANDLE,
    base_address: wintypes.LPVOID,
    buffer: wintypes.LPCVOID,
    size: ctypes.c_size_t,
    size_ptr: ctypes.POINTER(ctypes.c_size_t),
) -> wintypes.BOOL:
    pass 
開發者ID:NeKitDS,項目名稱:gd.py,代碼行數:10,代碼來源:win.py

示例4: jitInject

# 需要導入模塊: from ctypes import wintypes [as 別名]
# 或者: from ctypes.wintypes import LPCVOID [as 別名]
def jitInject(path, shellcode):
	info = win32process.CreateProcess(None, path, None, None, False, 0x04, None, None, win32process.STARTUPINFO())  
	page_rwx_value = 0x40
	process_all = 0x1F0FFF
	memcommit = 0x00001000

	shellcode_length = len(shellcode)
	process_handle = info[0].handle # phandle

	VirtualAllocEx = windll.kernel32.VirtualAllocEx
	VirtualAllocEx.restype = LPVOID
	VirtualAllocEx.argtypes = (HANDLE, LPVOID, DWORD, DWORD, DWORD)

	WriteProcessMemory = ctypes.windll.kernel32.WriteProcessMemory
	WriteProcessMemory.restype = BOOL
	WriteProcessMemory.argtypes = (HANDLE, LPVOID, LPCVOID, DWORD, DWORD)

	CreateRemoteThread = ctypes.windll.kernel32.CreateRemoteThread
	CreateRemoteThread.restype = HANDLE
	CreateRemoteThread.argtypes = (HANDLE, LPSECURITY_ATTRIBUTES, DWORD, LPTHREAD_START_ROUTINE, LPVOID, DWORD, DWORD)

	lpBuffer = VirtualAllocEx(process_handle, 0, shellcode_length, memcommit, page_rwx_value)
	print(hex(lpBuffer))
	WriteProcessMemory(process_handle, lpBuffer, shellcode, shellcode_length, 0)
	CreateRemoteThread(process_handle, None, 0, lpBuffer, 0, 0, 0)
	print('JIT Injection, done.')
# -------------------------------------------------- # 
開發者ID:aaaddress1,項目名稱:shellDev.py,代碼行數:29,代碼來源:shellDev.py


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