Function at 0x40d520
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Read file on windows
Read pipe
Resolve function by parsing pe exports

Disassembly:
mov eax, 0x2078
call fcn.00415b80
push esi
push edi
mov ecx, 0x800
xor eax, eax
lea edi, [esp + 0x80]
xor esi, esi
rep stosd dword es:[edi], eax
mov ecx, 0x11
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
mov dword [esp + 0x2c], eax
xor ecx, ecx
mov dword [esp + 0x30], eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x38], eax
lea edx, [esp + 0x20]
mov dword [esp + 0x28], ecx
push esi
lea eax, [esp + 0x20]
push edx
lea ecx, [esp + 0x14]
push eax
push ecx
mov dword [esp + 0x30], 0xc
mov dword [esp + 0x38], 1
mov dword [esp + 0x34], esi
call dword [sym.imp.KERNEL32.dll_CreatePipe]
cmp eax, esi
jne 0x40d5a0
pop edi
xor eax, eax
pop esi
add esp, 0x2078
ret
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x2c]
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], eax
mov ecx, dword [esp + 0x2084]
lea eax, [esp + 0x3c]
push edx
push eax
push esi
push esi
push esi
push 1
push esi
push esi
push ecx
push esi
mov dword [esp + 0x64], 0x44
mov dword [esp + 0x90], 0x101
mov word [esp + 0x94], si
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
cmp eax, esi
jne 0x40d5f6
pop edi
xor eax, eax
pop esi
add esp, 0x2078
ret
push ebx
lea edx, [esp + 0x1c]
push ebp
lea eax, [esp + 0x1c]
push edx
lea ecx, [esp + 0x14]
push eax
mov eax, dword [esp + 0x1c]
push ecx
lea edx, [esp + 0x94]
push 1
push edx
push eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x40d781
mov ebp, dword [esp + 0x2090]
mov eax, dword [esp + 0x10]
push esi
cmp eax, esi
je 0x40d72b
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x90]
push 0x1fff
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d774
mov ecx, dword [esp + 0x10]
lea edi, [esp + 0x88]
xor eax, eax
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov byte [esp + ecx + 0x88], 0
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [edx]
mov edx, dword [ebp + 8]
not ecx
dec ecx
sub eax, edx
mov edi, ecx
cmp eax, edi
ja 0x40d69f
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
cmp edi, esi
jbe 0x40d742
mov ebx, dword [ebp + 8]
add ebx, edi
cmp ebx, 0xfffffffd
jbe 0x40d6b7
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
mov ecx, dword [ebp + 4]
cmp ecx, esi
je 0x40d6dd
mov al, byte [ecx - 1]
test al, al
je 0x40d6dd
cmp al, 0xff
je 0x40d6dd
cmp ebx, esi
jne 0x40d6f5
dec al
mov byte [ecx - 1], al
mov dword [ebp + 4], esi
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], esi
jmp 0x40d742
cmp ebx, esi
jne 0x40d6f0
cmp ecx, esi
je 0x40d742
push esi
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
jmp 0x40d742
cmp dword [ebp + 0xc], ebx
jae 0x40d6fe
push ebx
mov ecx, ebp
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Copy_unsigned_int_]
mov edx, dword [ebp + 4]
mov ecx, edi
mov edi, dword [ebp + 8]
lea esi, [esp + 0x88]
add edi, edx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 4]
mov dword [ebp + 8], ebx
xor esi, esi
mov byte [ebx + eax], 0
jmp 0x40d742
mov ecx, dword [esp + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40d781
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [esp + 0x20]
lea eax, [esp + 0x1c]
push edx
lea ecx, [esp + 0x14]
push eax
mov eax, dword [esp + 0x1c]
push ecx
lea edx, [esp + 0x94]
push 1
push edx
push eax
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
jne 0x40d637
jmp 0x40d781
push 0x12b53dc
call fcn.0040d510
add esp, 4
mov edx, dword [esp + 0x34]
lea ecx, [esp + 0x18]
push ecx
push edx
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
pop ebp
pop ebx
test eax, eax
jne 0x40d7a3
mov dword [esp + 0x10], 0xffffffff
mov eax, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x2c]
push ecx
call esi
mov edx, dword [esp + 0xc]
push edx
call esi
mov eax, dword [esp + 0x1c]
push eax
call esi
mov eax, dword [esp + 0x10]
pop edi
pop esi
add esp, 0x2078
ret