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

Method execute

windows/winobject/process.py:187–195  ·  view source on GitHub ↗

Execute some native code in the context of the process :return: The thread executing the code :rtype: :class:`WinThread` or :class:`DeadThread`

(self, code, parameter=0)

Source from the content-addressed store, hash-verified

185
186
187 def execute(self, code, parameter=0):
188 """Execute some native code in the context of the process
189
190 :return: The thread executing the code
191 :rtype: :class:`WinThread` or :class:`DeadThread`
192 """
193 x = self.virtual_alloc(len(code)) #Todo: free this ? when ? how ? reuse ?
194 self.write_memory(x, code)
195 return self.create_thread(x, parameter)
196
197 def query_memory(self, addr):
198 """Query the memory informations about page at ``addr``

Calls 3

virtual_allocMethod · 0.95
write_memoryMethod · 0.45
create_threadMethod · 0.45

Tested by

no test coverage detected