Function at 0x518410
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Read file on windows
Read pipe
Terminate process

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff74
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x8c], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00405904
mov eax, dword [ebp - 8]
test eax, eax
je 0x51843f
xor edx, edx
mov dword [eax], edx
xor eax, eax
push ebp
push 0x518668
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0xd], 0
mov eax, dword [ebp - 8]
call fcn.00405450
mov dword [ebp - 0x34], 0xc
mov dword [ebp - 0x2c], 0xffffffff
xor eax, eax
mov dword [ebp - 0x30], eax
push 0
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
call sub.kernel32.dll_CreatePipe
test eax, eax
je 0x518647
mov eax, 0x100001
call fcn.00402f4c
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x78]
xor ecx, ecx
mov edx, 0x44
call fcn.00403c1c
mov dword [ebp - 0x78], 0x44
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x4c], 0x101
mov word [ebp - 0x48], 0
xor ebx, ebx
fld qword [ebp + 8]
fcomp dword [0x51867c]
wait
fnstsw ax
sahf
jne 0x5184e2
xor eax, eax
mov dword [ebp + 8], eax
mov dword [ebp + 0xc], 0x7ff00000
jmp 0x5184f6
call fcn.0040fd3c
fld qword [ebp + 8]
fdiv dword [0x518680]
faddp st(1)
fstp qword [ebp + 8]
wait
xor eax, eax
push ebp
push 0x518640
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x88]
push eax
lea eax, [ebp - 0x78]
push eax
push 0
push 0
push 0x8000020
push 0xffffffffffffffff
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x34]
push eax
mov eax, dword [ebp - 4]
call fcn.00405914
push eax
push 0
call sub.kernel32.dll_CreateProcessA
test eax, eax
je 0x5185b2
mov byte [ebp - 0xd], 1
push 0x64
mov eax, dword [ebp - 0x88]
push eax
call sub.kernel32.dll_WaitForSingleObject
mov esi, eax
mov eax, dword [0x581d10]
mov eax, dword [eax]
call fcn.0048f394
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x20]
push eax
push 0x100000
mov eax, dword [ebp - 0x1c]
add eax, ebx
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_PeekNamedPipe
test eax, eax
je 0x5185b2
cmp dword [ebp - 0x20], 0
jbe 0x518599
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x1c]
add eax, ebx
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_ReadFile_1
add ebx, dword [ebp - 0x20]
cmp esi, 0x102
jne 0x5185b2
call fcn.0040fd3c
fcomp qword [ebp + 8]
wait
fnstsw ax
sahf
jb 0x518536
mov eax, dword [ebp - 0x1c]
mov byte [eax + ebx], 0
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x1c]
push eax
call sub.user32.dll_OemToCharA
lea edx, [ebp - 0x8c]
mov eax, dword [ebp - 0x1c]
call fcn.0040e554
mov edx, dword [ebp - 0x8c]
mov eax, dword [ebp - 8]
call fcn.004054a4
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x518647
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x88]
push eax
call sub.kernel32.dll_GetExitCodeProcess
push 0
mov eax, dword [ebp - 0x88]
push eax
call sub.kernel32.dll_TerminateProcess
mov eax, dword [ebp - 0x1c]
call fcn.00402f80
mov eax, dword [ebp - 0x88]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x84]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x18]
push eax
call sub.kernel32.dll_CloseHandle_1
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51866f
lea eax, [ebp - 0x8c]
call fcn.00405450
lea eax, [ebp - 4]
call fcn.00405450
ret