MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / create_console

Function create_console

windows/utils/winutils.py:72–86  ·  view source on GitHub ↗

Create a new console displaying STDOUT. Useful in injection of GUI process

()

Source from the content-addressed store, hash-verified

70
71
72def create_console():
73 """Create a new console displaying STDOUT.
74 Useful in injection of GUI process"""
75 winproxy.AllocConsole()
76 stdout_handle = winproxy.GetStdHandle(gdef.STD_OUTPUT_HANDLE)
77 console_stdout = create_file_from_handle(stdout_handle, "w")
78 sys.stdout = console_stdout
79
80 stdin_handle = winproxy.GetStdHandle(gdef.STD_INPUT_HANDLE)
81 console_stdin = create_file_from_handle(stdin_handle, "r")
82 sys.stdin = console_stdin
83
84 stderr_handle = winproxy.GetStdHandle(gdef.STD_ERROR_HANDLE)
85 console_stderr = create_file_from_handle(stderr_handle, "w")
86 sys.stderr = console_stderr
87
88
89def create_process(path, args=None, dwCreationFlags=0, show_windows=True):

Callers 1

pop_shellFunction · 0.85

Calls 1

create_file_from_handleFunction · 0.85

Tested by

no test coverage detected