Function at 0x40f238
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Create two anonymous pipes
Read file on windows
Write and execute a file
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c8
xor eax, eax
push ebx
push esi
push edi
mov dword [ebp - 0x14], eax
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], eax
cmp dword [ebp + 8], eax
je 0x40f4e8
mov esi, dword [sym.imp.KERNEL32.dll_CreatePipe]
mov dword [ebp - 0x24], eax
mov edi, 0x100000
push edi
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x10]
push eax
xor ebx, ebx
lea eax, [ebp - 8]
inc ebx
push eax
mov dword [ebp - 0x28], 0xc
mov dword [ebp - 0x20], ebx
call esi
test eax, eax
je 0x40f4b8
push edi
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x14]
push eax
call esi
test eax, eax
je 0x40f4b8
mov esi, dword [sym.imp.KERNEL32.dll_SetHandleInformation]
xor edi, edi
push edi
push ebx
push dword [ebp - 8]
call esi
test eax, eax
je 0x40f4ba
push edi
push ebx
push dword [ebp - 0xc]
call esi
test eax, eax
je 0x40f4ba
push 0x31
lea edi, [ebp - 0x34]
pop eax
call fcn.0040aead
push 0x32
lea edi, [ebp - 0xc4]
pop eax
call fcn.0040aead
mov ecx, dword [ebp + 8]
call fcn.0042bc16
mov ecx, edi
mov edx, eax
call fcn.0042bc16
lea ecx, [ebp - 0x34]
add edx, eax
call fcn.0042bc16
lea edi, [edx + eax + 1]
mov eax, edi
call fcn.0042b055
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, eax
mov dword [ebp - 0x1c], esi
test esi, esi
jne 0x40f32c
push dword [ebp - 0x14]
call ebx
push dword [ebp - 8]
call ebx
push dword [ebp - 0xc]
call ebx
push dword [ebp - 0x10]
call ebx
lea eax, [ebp - 0x34]
push eax
push dword [ebp + 8]
lea eax, [ebp - 0xc4]
push eax
push 0x4089c8
call fcn.0042bf02
add esp, 0x10
push 0x10
xor edi, edi
push edi
lea eax, [ebp - 0x44]
push eax
call fcn.0042b138
push 0x44
pop edx
push edx
push edi
lea eax, [ebp - 0x8c]
push eax
call fcn.0042b138
mov eax, dword [ebp - 0x10]
or dword [ebp - 0x60], 0x101
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x54], eax
xor eax, eax
push 0x2f
mov word [ebp - 0x5c], ax
lea esi, [ebp - 0x9c]
pop eax
mov dword [ebp - 0x8c], edx
call fcn.0040aee3
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x8c]
push eax
push edi
push edi
push edi
push 1
push edi
push edi
mov eax, esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x40f3d7
push dword [ebp - 0x14]
call ebx
push dword [ebp - 8]
call ebx
push dword [ebp - 0xc]
call ebx
push dword [ebp - 0x10]
call ebx
push dword [ebp - 0x1c]
call fcn.0042b085
jmp 0x40f4e8
mov esi, dword [ebp - 0x1c]
push edi
lea eax, [ebp - 0x18]
push eax
mov ecx, esi
mov dword [ebp - 0x18], edi
call fcn.0042bc16
inc eax
push eax
push esi
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40f410
push dword [ebp - 0x14]
call ebx
push dword [ebp - 8]
call ebx
push dword [ebp - 0xc]
call ebx
push dword [ebp - 0x10]
call ebx
push esi
jmp 0x40f3cd
push esi
call fcn.0042b085
push dword [ebp - 0x40]
call ebx
push 0xffffffffffffffff
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x44]
neg eax
sbb esi, esi
inc esi
call ebx
push dword [ebp - 0xc]
call ebx
push dword [ebp - 0x10]
call ebx
and dword [ebp + 8], edi
jmp 0x40f468
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x40f488
push dword [ebp + 8]
add eax, edi
call fcn.0042b021
push dword [ebp - 0x18]
lea ecx, [ebp - 0x1c4]
mov dword [ebp + 8], eax
push ecx
add eax, edi
push eax
call fcn.0042b0c1
add edi, dword [ebp - 0x18]
push 0
lea eax, [ebp - 0x18]
push eax
push 0x100
lea eax, [ebp - 0x1c4]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, 1
je 0x40f43f
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40f496
mov ecx, dword [ebp + 8]
mov dword [eax], ecx
jmp 0x40f49e
push dword [ebp + 8]
call fcn.0042b085
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40f4a7
mov dword [eax], edi
push dword [ebp - 0x14]
call ebx
push dword [ebp - 8]
call ebx
test esi, esi
setne al
jmp 0x40f4ea
xor edi, edi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x14], edi
je 0x40f4ca
push dword [ebp - 0x14]
call esi
cmp dword [ebp - 8], edi
je 0x40f4d4
push dword [ebp - 8]
call esi
cmp dword [ebp - 0xc], edi
je 0x40f4de
push dword [ebp - 0xc]
call esi
cmp dword [ebp - 0x10], edi
je 0x40f4e8
push dword [ebp - 0x10]
call esi
xor al, al
pop edi
pop esi
pop ebx
leave
ret 0xc