Function at 0x180045420
Capabilities:
Create a process with modified i/o handles and window
Create process on windows
Get comspec environment variable
Query environment variable

Disassembly:
mov qword [rsp + 0x10], rdx
push rbp
push r12
push r13
push r14
push r15
sub rsp, 0x220
lea rbp, [rsp + 0x50]
mov r14, rcx
mov r13, r8
xor eax, eax
mov qword [rbp + 0x200], rbx
lea rcx, str.COMSPEC
xor r8d, r8d
xor edx, edx
mov qword [rbp + 0x210], rsi
mov r12, r9
mov qword [rbp + 0x218], rdi
mov r15d, eax
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
movsxd r8, eax
test eax, eax
je 0x180045812
lea rax, [r8 + 0xf]
mov rdi, r8
movabs rcx, 0xffffffffffffff0
cmp rax, r8
ja 0x180045493
mov rax, rcx
and rax, 0xfffffffffffffff0
call fcn.18023d0d0
sub rsp, rax
lea rcx, str.COMSPEC
lea rsi, [rsp + 0x50]
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov eax, eax
test rax, rax
je 0x180045825
lea rbx, [rax + rsi]
cmp rbx, rsi
jb 0x1800454d5
cmp byte [rbx], 0x5c
je 0x1800454d5
dec rbx
cmp rbx, rsi
jae 0x1800454c8
call qword [sym.imp.KERNEL32.dll_GetVersion]
cmp eax, 0x80000000
jae 0x18004556c
lea rcx, [rbx + 1]
lea rdx, str.command.com
call fcn.18023bc24
test eax, eax
je 0x18004556c
or rbx, 0xffffffffffffffff
nop
inc rbx
cmp byte [r14 + rbx], r15b
jne 0x180045500
add rdi, 5
add rdi, rbx
lea rax, [rdi + 0xf]
cmp rax, rdi
ja 0x180045523
movabs rax, 0xffffffffffffff0
and rax, 0xfffffffffffffff0
call fcn.18023d0d0
sub rsp, rax
mov r8, rdi
lea rbx, [rsp + 0x50]
xor edx, edx
mov rcx, rbx
call fcn.180231610
lea rax, [0x180318b04]
lea r8, str._s_s_s
mov r9, rsi
mov rdx, rdi
mov rcx, rbx
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rax
call sym.extension.dll_PyOS_snprintf
jmp 0x18004576d
mov r15d, 0x104
lea rdx, [rbp + 0x90]
xor ecx, ecx
mov r8d, r15d
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
xor edx, edx
xor edi, edi
cmp byte [rbp + 0x90], dl
je 0x1800455b4
lea rax, [rbp + 0x90]
lea ecx, [rdi + 1]
nop word [rax + rax]
cmp byte [rax], 0x5c
jne 0x1800455a8
movsxd rdx, ecx
inc rax
inc edi
inc ecx
cmp byte [rax], 0
jne 0x1800455a0
or rbx, 0xffffffffffffffff
mov byte [rbp + rdx + 0x90], 0
lea rcx, [rbp + 0x90]
mov rax, rbx
nop word [rax + rax]
inc rax
cmp byte [rcx + rax], 0
jne 0x1800455d0
mov r8, r15
lea rdx, str.w9xpopen.exe
lea rcx, [rbp + 0x90]
sub r8, rax
call fcn.18023bd30
lea rdx, [rbp + 0x1a0]
lea rcx, [rbp + 0x90]
call fcn.18023cc08
test eax, eax
je 0x1800456d8
call sym.extension.dll_Py_GetExecPrefix
lea rcx, [rbp + 0x90]
mov r8, r15
mov rdx, rax
call fcn.18023bf70
mov byte [rbp + 0x193], 0
lea rax, [rbp + 0x90]
mov rcx, rbx
cmp byte [rax + rcx + 1], 0
lea rcx, [rcx + 1]
jne 0x180045635
lea rax, [rbp + 0x90]
cmp byte [rcx + rax - 1], 0x5c
je 0x180045674
lea rcx, [rbp + 0x90]
dec rcx
nop dword [rax + rax]
cmp byte [rcx + 1], 0
lea rcx, [rcx + 1]
jne 0x180045660
movzx eax, word [0x180318b3c]
mov word [rcx], ax
lea rcx, [rbp + 0x90]
mov rax, rbx
nop
inc rax
cmp byte [rcx + rax], 0
jne 0x180045680
sub r15, rax
lea rdx, str.w9xpopen.exe
lea rcx, [rbp + 0x90]
mov r8, r15
call fcn.18023bd30
lea rdx, [rbp + 0x1a0]
lea rcx, [rbp + 0x90]
call fcn.18023cc08
test eax, eax
je 0x1800456d8
mov rcx, qword [sym.extension.dll_PyExc_RuntimeError]
lea r8, str.w9xpopen.exe
lea rdx, str.Can_not_locate__s_which_is_needed_for_popen_to_work_with_your_shell_or_platform.
call sym.extension.dll_PyErr_Format
jmp 0x180045825
mov rcx, rbx
nop dword [rax + rax]
inc rcx
cmp byte [r14 + rcx], 0
jne 0x1800456e0
lea rax, [rbp + 0x90]
inc rbx
cmp byte [rax + rbx], 0
jne 0x1800456f1
movsxd rdi, edi
add rcx, rbx
add rdi, 0x12
add rdi, rcx
lea rax, [rdi + 0xf]
cmp rax, rdi
ja 0x18004571a
movabs rax, 0xffffffffffffff0
and rax, 0xfffffffffffffff0
call fcn.18023d0d0
sub rsp, rax
mov r8, rdi
lea rbx, [rsp + 0x50]
xor edx, edx
mov rcx, rbx
call fcn.180231610
lea rax, [0x180318b04]
mov qword [rsp + 0x30], r14
mov qword [rsp + 0x28], rax
lea r9, [rbp + 0x90]
lea r8, str.__s___s_s_s
mov rdx, rdi
mov rcx, rbx
mov qword [rsp + 0x20], rsi
call sym.extension.dll_PyOS_snprintf
mov r15d, reloc.WS2_32.dll_recv
xor edx, edx
lea rcx, [rbp + 0x20]
lea r8d, [rdx + 0x68]
call fcn.180231610
mov rax, qword [rbp + 0x208]
xor ecx, ecx
mov qword [rbp + 0x70], rax
lea rax, [rbp]
xor r9d, r9d
mov qword [rsp + 0x48], rax
lea rax, [rbp + 0x20]
xor r8d, r8d
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], rcx
mov rdx, rbx
mov dword [rsp + 0x28], r15d
mov dword [rbp + 0x20], 0x68
mov dword [rsp + 0x20], 1
mov dword [rbp + 0x5c], 0x101
mov qword [rbp + 0x78], r13
mov qword [rbp + 0x80], r12
mov word [rbp + 0x60], cx
call qword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x180045801
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [rbp + 0x220]
mov rcx, qword [rbp]
mov qword [rdx], rcx
mov eax, 1
jmp 0x180045827
lea rcx, str.CreateProcess
mov rdx, rbx
call fcn.1800415f0
jmp 0x180045825
mov rcx, qword [sym.extension.dll_PyExc_RuntimeError]
lea rdx, str.Cannot_locate_a_COMSPEC_environment_variable_to_use_as_the_shell
call sym.extension.dll_PyErr_SetString
xor eax, eax
mov rbx, qword [rbp + 0x200]
mov rsi, qword [rbp + 0x210]
mov rdi, qword [rbp + 0x218]
lea rsp, [rbp + 0x1d0]
pop r15
pop r14
pop r13
pop r12
pop rbp
ret