Fix CurrentProcessReadSyswow for windows10

This commit is contained in:
hakril
2016-05-22 12:00:34 +02:00
parent 976ce78455
commit aaa680c61c
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -7,4 +7,5 @@ Since 0.2:
* utils.get_short_path / utils.get_long_path
* Object returned by `windows.native_exec.create_function` has an attribute `code_addr` with the address of the executable code
* add `windows.winproxy.is_implemented` Ex: windows.winproxy.is_implemented(windows.winproxy.QueryWorkingSetEx)
* registry.py handle REG_QWORD manually (_winreg does not)
* registry.py handle REG_QWORD manually (_winreg does not)
* CurrentProcessReadSyswow doest not use ``current_process.handle`` anymore but ``OpenProcess(current_process.pid)`` (Compat windows10 where method 1 doest not work)
+5 -1
View File
@@ -181,9 +181,13 @@ def get_current_process_syswow_peb():
class CurrentProcessReadSyswow(process.Process):
bitness = 64
def _get_handle(self):
print("CurrentProcessReadSyswow get_handler")
return winproxy.OpenProcess(dwProcessId=current_process.pid)
def read_memory(self, addr, size):
buffer_addr = ctypes.create_string_buffer(size)
winproxy.NtWow64ReadVirtualMemory64(current_process.handle, addr, buffer_addr, size)
winproxy.NtWow64ReadVirtualMemory64(self.handle, addr, buffer_addr, size)
return buffer_addr[:]
peb_addr = get_current_process_syswow_peb_addr()
return windows.winobject.process.RemotePEB64(peb_addr, CurrentProcessReadSyswow())