MCPcopy Index your code
hub / github.com/ELMERIKH/PyinMemoryPE / write_memory

Method write_memory

windows/winobject/process.py:1058–1065  ·  view source on GitHub ↗

Write `data` at `addr`

(self, addr, data)

Source from the content-addressed store, hash-verified

1056 return winproxy.VirtualFreeEx(self.handle, addr)
1057
1058 def write_memory(self, addr, data):
1059 """Write `data` at `addr`"""
1060 data = raw_encode(data)
1061 if windows.current_process.bitness == 32 and self.bitness == 64:
1062 if not winproxy.is_implemented(winproxy.NtWow64WriteVirtualMemory64):
1063 raise ValueError("NtWow64WriteVirtualMemory64 non available in ntdll: cannot write into 64bits processus")
1064 return winproxy.NtWow64WriteVirtualMemory64(self.handle, addr, data, len(data))
1065 return winproxy.WriteProcessMemory(self.handle, addr, lpBuffer=data)
1066
1067 def low_read_memory(self, addr, buffer_addr, size):
1068 if windows.current_process.bitness == 32 and self.bitness == 64:

Callers 15

inject_python_commandFunction · 0.45
set_logfilenameMethod · 0.45
executeMethod · 0.45
write_byteMethod · 0.45
write_shortMethod · 0.45
write_dwordMethod · 0.45
write_qwordMethod · 0.45
_setup_breakpoint_BPMethod · 0.45

Calls 2

raw_encodeFunction · 0.90
is_implementedMethod · 0.80

Tested by

no test coverage detected