I am using ctypes
and trying to get the PEB
address using the NtQueryInformationProcess
function.
The return value is 0, meaning that the function was completed successfully.
But the PROCESS_BASIC_INFORMATION
structure (given as the third argument) doesn't contain the PEB
address.
class PROCESS_BASIC_INFORMATION(Structure):
_fields_ = [
("Reserved1", c_void_p),
("PebBaseAddress", DWORD),
("Reserved2", c_void_p * 2),
("UniqueProcessId", DWORD),
("Reserved3", c_void_p)]
ntdll = WinDLL('ntdll')
NTSTATUS = LONG
ntdll.argtypes = [HANDLE, DWORD, c_void_p, DWORD, PDWORD]
ntdll.restype = NTSTATUS
processInformation = PROCESS_BASIC_INFORMATION()
processInformationLength = sizeof(PROCESS_BASIC_INFORMATION)
result = ntdll.NtQueryInformationProcess(hProcess, 0, processInformation, processInformationLength, byref(DWORD(0)))
Consider the fact that the return value is 0, what can be the problem?