Function at 0x502e78
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, 0xffffff7c
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x84], ecx
mov dword [ebp - 0x80], ecx
mov dword [ebp - 0x7c], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00404f40
lea ebx, [ebp - 0x18]
lea esi, [ebp - 0x14]
xor eax, eax
push ebp
push 0x5030e8
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
push ebp
push 0x50308b
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [0x50c844], 0
je 0x502ed8
push 0
mov eax, dword [0x50c844]
push eax
call sub.kernel32.dll_TerminateProcess
mov eax, 0x1388
call fcn.00408ee8
mov dword [ebx], eax
mov dword [ebp - 0x68], 0xc
xor eax, eax
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], 0xffffffff
push 0
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xc]
push eax
call sub.kernel32.dll_CreatePipe
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x502f38
mov eax, dword [ebp - 8]
mov edx, 0x503100
call fcn.00404ae4
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00501258
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x5030c2
lea eax, [ebp - 0x5c]
xor ecx, ecx
mov edx, 0x44
call fcn.004034dc
mov dword [ebp - 0x5c], 0x44
mov dword [ebp - 0x30], 0x101
mov word [ebp - 0x2c], 0
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x78]
push eax
lea eax, [ebp - 0x5c]
push eax
push 0
push 0
push 0
push 0xffffffffffffffff
push 0
push 0
mov eax, dword [ebp - 4]
call fcn.00404f50
push eax
push 0
call sub.kernel32.dll_CreateProcessA
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x502fba
mov eax, dword [ebp - 8]
mov edx, 0x503120
call fcn.00404ae4
mov eax, dword [ebx]
call fcn.00402b40
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00501258
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x5030c2
mov eax, dword [ebp - 0x78]
mov dword [0x50c844], eax
push 0
push 0
push esi
push 1
mov eax, dword [ebx]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_PeekNamedPipe
test eax, eax
je 0x503036
cmp dword [esi], 0
je 0x50301e
push 0
push esi
push 0x1000
mov eax, dword [ebx]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_ReadFile_1
cmp eax, 1
sbb eax, eax
inc eax
test al, al
je 0x503036
mov eax, dword [ebx]
mov edx, dword [esi]
mov byte [eax + edx], 0
lea eax, [ebp - 0x7c]
mov edx, dword [ebx]
call fcn.00404c88
mov edx, dword [ebp - 0x7c]
mov eax, dword [ebp - 8]
call fcn.00404d58
mov eax, dword [ebp - 8]
jmp 0x50302d
push 0
mov eax, dword [ebp - 0x78]
push eax
call sub.kernel32.dll_WaitForSingleObject
test eax, eax
je 0x503036
push 0x64
call sub.kernel32.dll_Sleep_1
jmp 0x502fc2
mov eax, dword [ebx]
mov edx, dword [esi]
mov byte [eax + edx], 0
lea eax, [ebp - 0x80]
mov edx, dword [ebx]
call fcn.00404c88
mov edx, dword [ebp - 0x80]
mov eax, dword [ebp - 8]
call fcn.00404d58
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x74]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x78]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebx]
call fcn.00402b40
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x5030c2
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5030ef
lea eax, [ebp - 0x84]
mov edx, 3
call fcn.00404ab4
lea eax, [ebp - 4]
call fcn.00404a90
ret