Function at 0x405370
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Print debug messages
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x56ae98
mov eax, dword fs:[0]
push eax
mov eax, 0x4078
call fcn.00543450
mov eax, dword [0x5c6590]
xor eax, esp
mov dword [esp + 0x4070], eax
push ebx
push esi
mov eax, dword [0x5c6590]
xor eax, esp
push eax
lea eax, [esp + 0x4084]
mov dword fs:[0], eax
push 0
push 0x59ab5c
mov ecx, edi
mov dword [esp + 0x4094], 0
call fcn.004028c0
push 0
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x18]
push edx
mov dword [esp + 0x28], 0xc
mov dword [esp + 0x2c], 0
mov dword [esp + 0x30], 1
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x405439
push str.Error_on_CreatePipe___
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov dword [esp + 0x408c], 0xffffffff
mov eax, dword [esp + 0x4094]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405432
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x4055b9
push 0x40
lea ecx, [esp + 0x2c]
push 0
push ecx
mov dword [esp + 0x30], 0x44
call fcn.00540cb0
mov eax, dword [esp + 0x1c]
add esp, 0xc
cmp dword [esp + 0x4098], 0
mov dword [esp + 0x64], eax
mov dword [esp + 0x60], eax
je 0x405474
mov edx, 5
mov word [esp + 0x54], dx
jmp 0x40547b
xor eax, eax
mov word [esp + 0x54], ax
lea esi, [esp + 0x4094]
mov dword [esp + 0x50], 0x101
call fcn.00405310
lea ecx, [esp + 0x6c]
push ecx
lea edx, [esp + 0x28]
push edx
push 0
push 0
push 0
push 1
push 0
push 0
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x4054f6
push str.Error_on_CreateProcess___
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov dword [esp + 0x408c], 0xffffffff
mov eax, dword [esp + 0x4094]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405432
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x4055b9
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4000
lea edx, [esp + 0x80]
push 0
push edx
call fcn.00540cb0
add esp, 0xc
cmp dword [esp + 0x409c], 0
je 0x40557b
mov edx, dword [esp + 0xc]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [esp + 0x18]
push eax
push 0x3fff
lea ecx, [esp + 0x88]
push ecx
push edx
mov dword [esp + 0x28], 0
call ebx
test eax, eax
je 0x40557b
nop
lea eax, [esp + 0x7c]
push eax
mov esi, edi
call fcn.00408bd0
mov eax, dword [esp + 0xc]
push 0
lea ecx, [esp + 0x18]
push ecx
push 0x3fff
lea edx, [esp + 0x88]
push edx
push eax
call ebx
test eax, eax
jne 0x405550
mov ecx, dword [esp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x408c], 0xffffffff
mov eax, dword [esp + 0x4094]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4055b4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x4084]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [esp + 0x4070]
xor ecx, esp
call fcn.0053e694
add esp, 0x4084
ret 0xc