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

Function safe_execute_python

windows/injection.py:428–438  ·  view source on GitHub ↗
(process, code)

Source from the content-addressed store, hash-verified

426 pass
427
428def safe_execute_python(process, code):
429 t = execute_python_code(process, code)
430 t.wait() # Wait terminaison of the thread
431 if t.exit_code == 0:
432 return True
433 if t.exit_code == STATUS_THREAD_IS_TERMINATING or process.is_exit:
434 raise WindowsError("{0} died during execution of python command".format(process))
435 if t.exit_code != 0xffffffff:
436 raise ValueError("Unknown exit code {0}".format(hex(t.exit_code)))
437 data = retrieve_last_exception_data(process)
438 raise RemotePythonError(data)

Callers

nothing calls this directly

Calls 4

execute_python_codeFunction · 0.85
RemotePythonErrorClass · 0.85
waitMethod · 0.45

Tested by

no test coverage detected