Function at 0x407840
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Create process suspended
Get common file path
Read file on windows

Disassembly:
sub esp, 0x534
push ebx
push ebp
push esi
push edi
xor ebx, ebx
mov ecx, 0x31
xor eax, eax
lea edi, [esp + 0x7d]
mov byte [esp + 0x7c], bl
mov byte [esp + 0x144], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x145]
push ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x20]
lea ecx, [esp + 0x14]
push eax
lea edx, [esp + 0x1c]
push ecx
push edx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], 0xc
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], 1
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x4078ef
mov eax, dword [esp + 0x54c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [eax], 0x23000003
mov dword [eax + 4], ebx
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x4078d5
push eax
call esi
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x407a87
push eax
call esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x534
ret
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0x44
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
mov eax, dword [esp + 0x10]
mov ebp, dword [sym.imp.MSVCRT.dll_putchar]
push 0x30
mov dword [esp + 0x6c], eax
mov dword [esp + 0x68], eax
mov word [esp + 0x5c], bx
mov dword [esp + 0x58], 0x101
call ebp
add esp, 4
lea ecx, [esp + 0x7c]
push 0xc8
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x30
call ebp
mov edi, str.cmd.exe__c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x80]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x30
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call ebp
mov ebp, dword [esp + 0x554]
mov ecx, dword [esp + 0x550]
lea edx, [esp + 0x84]
mov eax, dword [ebp + 4]
push eax
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_strncat]
add esp, 0x14
lea eax, [esp + 0x6c]
lea ecx, [esp + 0x28]
lea edx, [esp + 0x7c]
push eax
push ecx
push 0
push 0
push 0
push 1
push 0
push 0
push edx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x4079f1
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp + 4], eax
mov eax, dword [esp + 0x14]
mov dword [ebp], 0x23000003
test eax, eax
je 0x4079d7
push eax
call esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x407a87
push eax
call esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x534
ret
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x144]
push eax
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x14c]
push 0x400
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x407a5f
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x548]
mov eax, ecx
lea esi, [esp + 0x144]
lea edi, [ebx + edx]
push 0x32
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add ebx, dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4079fc
mov eax, dword [esp + 0x14]
mov dword [ebp], 0
test eax, eax
mov dword [ebp + 4], ebx
je 0x407a78
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x407a87
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x534
ret