Function at 0x405840
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Create thread
Create two anonymous pipes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
push ebx
push esi
mov esi, ecx
push 0xffffffffffffffff
push dword [esi + 0x4c]
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
sete al
cmp dword [esi + 0x24], 1
sete bl
test al, al
je 0x40586e
push dword [esi + 0x4c]
call dword [sym.imp.KERNEL32.DLL_ReleaseMutex]
test bl, bl
je 0x40587c
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, esi
call fcn.00405490
mov ebx, dword [sym.imp.KERNEL32.DLL_CreatePipe]
lea eax, [ebp - 0x28]
push 0
push eax
lea eax, [ebp - 4]
mov dword [ebp - 8], 0
push eax
lea eax, [ebp - 8]
mov dword [ebp - 4], 0
push eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x28], 0xc
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 1
call ebx
test eax, eax
je 0x405872
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_GetCurrentProcess]
lea eax, [ebp - 0xc]
push 2
push 1
push 0
push eax
call edi
push eax
push dword [ebp - 4]
call edi
push eax
call dword [sym.imp.KERNEL32.DLL_DuplicateHandle]
test eax, eax
jne 0x405914
push dword [ebp - 8]
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push dword [ebp - 4]
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
call ebx
test eax, eax
jne 0x405948
push dword [ebp - 8]
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push dword [ebp - 4]
call esi
push dword [ebp - 0xc]
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4
push 2
push 0
lea ebx, [esi + 0xc]
push 0
push ebx
mov dword [ebp - 0x1c], ebx
call edi
push eax
push dword [ebp - 8]
call edi
push eax
call dword [sym.imp.KERNEL32.DLL_DuplicateHandle]
test eax, eax
jne 0x405992
push dword [ebp - 8]
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push dword [ebp - 4]
call esi
push dword [ebp - 0xc]
call esi
push dword [ebp - 0x10]
call esi
push dword [ebp - 0x14]
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4
push 2
push 0
lea eax, [esi + 8]
push 0
push eax
mov dword [ebp - 0x18], eax
call edi
push eax
push dword [ebp - 0x10]
call edi
push eax
call dword [sym.imp.KERNEL32.DLL_DuplicateHandle]
push dword [ebp - 8]
test eax, eax
jne 0x4059e0
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push dword [ebp - 4]
call esi
push dword [ebp - 0xc]
call esi
push dword [ebp - 0x10]
call esi
push dword [ebp - 0x14]
call esi
push dword [ebx]
call esi
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4
mov edi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call edi
push dword [ebp - 0x10]
call edi
push 0x44
lea eax, [ebp - 0x7c]
push 0
push eax
call fcn.00530310
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x3c], eax
xor eax, eax
mov word [ebp - 0x4c], ax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x7c]
mov dword [ebp - 0x7c], 0x44
push eax
push 0
push 0
push 0x10
push 1
push 0
push 0
push dword [ebp + 8]
mov dword [ebp - 0x50], 0x101
push 0
call dword [sym.imp.KERNEL32.DLL_CreateProcessW]
push dword [ebp - 0x34]
test eax, eax
mov eax, dword [ebp - 0x38]
mov dword [esi + 0x10], eax
setne bl
call edi
push dword [ebp - 0x14]
call edi
push dword [ebp - 4]
call edi
push dword [ebp - 0xc]
call edi
test bl, bl
jne 0x405a90
mov edi, dword [ebp - 0x18]
mov ebx, dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [edi]
call ebx
mov esi, dword [ebp - 0x1c]
push dword [esi]
call ebx
mov dword [edi], 0
xor al, al
pop edi
mov dword [esi], 0
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea eax, [esi + 0x20]
push eax
push 0
push esi
push 0x405790
push 0
push 0
call dword [sym.imp.KERNEL32.DLL_CreateThread]
mov dword [esi + 0x14], eax
test eax, eax
jne 0x405abf
mov ecx, esi
call fcn.00405490
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0xffffffffffffffff
push dword [esi + 0x18]
mov dword [esi + 0x24], 1
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x405ae1
push 0xc8
call dword [sym.imp.KERNEL32.DLL_Sleep]
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 4