Function at 0x401314
Capabilities:
Create pipe
Create thread
Create two anonymous pipes
Set console window title

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
lea esi, [ebp - 0x38]
call fcn.0040198c
lea eax, [ebp - 0x18]
mov dword [esp + 4], eax
lea eax, [ebp - 0x10]
mov dword [ebp - 0x38], 0xc
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp], eax
call sub.kernel32.dll_CreatePipe
sub esp, 0x10
test eax, eax
je 0x4014dd
call sub.kernel32.dll_GetCurrentProcess
mov ebx, dword [ebp - 0x18]
mov edi, eax
call sub.kernel32.dll_GetCurrentProcess
lea edx, [ebp - 0x28]
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.kernel32.dll_DuplicateHandle
sub esp, 0x1c
test eax, eax
je 0x4014ee
lea eax, [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
lea eax, [ebp - 0x20]
mov dword [esp + 8], esi
mov dword [esp], eax
call sub.kernel32.dll_CreatePipe
sub esp, 0x10
test eax, eax
je 0x4014ff
call sub.kernel32.dll_GetCurrentProcess
mov ebx, dword [ebp - 0x10]
mov edi, eax
call sub.kernel32.dll_GetCurrentProcess
lea edx, [ebp - 0x14]
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.kernel32.dll_DuplicateHandle
sub esp, 0x1c
test eax, eax
je 0x401510
call sub.kernel32.dll_GetCurrentProcess
mov edi, dword [ebp - 0x1c]
mov ebx, eax
call sub.kernel32.dll_GetCurrentProcess
lea edx, [ebp - 0x24]
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.kernel32.dll_DuplicateHandle
sub esp, 0x1c
test eax, eax
je 0x401521
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push ebx
je 0x401532
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push ecx
je 0x401543
mov dword [esp], 0xfffffff6
call sub.kernel32.dll_GetStdHandle
mov dword [0x410004], eax
inc eax
push edx
je 0x401554
mov dword [esp], str.gdb_control_console
call sub.kernel32.dll_SetConsoleTitleA
mov ebx, 8
mov edx, 1
push edi
cmp edx, dword [ebp + 8]
jge 0x401565
mov eax, dword [ebp + 0xc]
or ecx, 0xffffffff
cld
mov edi, dword [eax + edx*4]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ebx, ecx
inc edx
jmp 0x4014bf
mov dword [esp], str.CreatePipe
call fcn.00401000
mov dword [esp], str.DuplicateHandle
call fcn.00401000
mov dword [esp], str.CreatePipe
call fcn.00401000
mov dword [esp], str.DupliateHandle
call fcn.00401000
mov dword [esp], str.DupliateHandle
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.GetStdHandle
call fcn.00401000
lea eax, [ebx + 1]
mov dword [esp], eax
call fcn.004077f0
mov edi, eax
test eax, eax
je 0x4015b5
mov dword [esp + 4], str.gdb.exe
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov ebx, 1
cmp ebx, dword [ebp + 8]
jge 0x4015ce
mov dword [esp + 4], 0x40e0fe
mov dword [esp], edi
call sub.msvcrt.dll_strcat
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + ebx*4]
mov dword [esp], edi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcat
inc ebx
jmp 0x40158b
mov dword [esp], str.out_of_memory.
call sub.msvcrt.dll_puts
or edx, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x28]
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call fcn.0040123c
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push esi
je 0x4016ce
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push ebx
je 0x4016df
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push ecx
je 0x4016f0
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x4010ca
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateThread
sub esp, 0x18
mov ebx, eax
test eax, eax
je 0x401701
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.00401188
mov eax, dword [0x410004]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push edx
je 0x401712
mov dword [section..data], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.kernel32.dll_WaitForSingleObject
inc eax
push edi
push edi
je 0x401723
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
test eax, eax
push esi
je 0x401734
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
xor edx, edx
test eax, eax
push ebx
jne 0x4015c4
jmp 0x401745
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.CreateThread
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.WaitForSingleObject
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000
mov dword [esp], str.CloseHandle
call fcn.00401000