Function at 0x401320
Capabilities:
Connect pipe
Read file on windows
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x411380
mov eax, dword fs:[0]
push eax
sub esp, 0x850
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, dword [ebp + 8]
test edi, edi
jne 0x401360
lea eax, [edi + 8]
jmp 0x401635
cmp dword [edi + 0x10], 0
mov dword [ebp - 0x854], edi
jne 0x401371
mov esi, dword [edi + 0x2c]
jmp 0x401373
xor esi, esi
mov eax, dword [edi]
mov ecx, dword [edi + 8]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x84c], eax
mov eax, dword [edi + 0x90]
mov dword [ebp - 0x850], esi
mov dword [ebp - 0x848], ecx
mov dword [ebp - 0x858], eax
lea esp, [esp]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x401633
push 0x400
lea eax, [ebp - 0x834]
mov dword [ebp - 0x20], 0
push 0
push eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x844], 0
mov dword [ebp - 0x840], 0
mov dword [ebp - 0x83c], 0
mov dword [ebp - 0x838], 0
call sub.MSVCR120.dll_memset
push 0x400
lea eax, [ebp - 0x428]
mov dword [ebp - 0x434], 0
push 0
push eax
mov dword [ebp - 0x430], 0
mov dword [ebp - 0x42c], 0
call sub.MSVCR120.dll_memset
add esp, 0x18
push 0
push esi
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
cmp dword [ebp - 0x84c], 0
je 0x4014c0
mov eax, dword [ebp - 0x858]
test eax, eax
je 0x4014c0
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x24], 0
push ecx
push esi
call eax
test eax, eax
je 0x4014c0
mov eax, dword [ebp - 0x84c]
cmp eax, dword [ebp - 0x24]
je 0x4014c0
mov eax, dword [ebp - 0x844]
push 0
mov dword [ebp - 0x434], eax
lea eax, [ebp - 0x20]
push eax
push 0x410
lea eax, [ebp - 0x844]
mov dword [ebp - 0x430], 0xfffffffa
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x40c
lea eax, [ebp - 0x434]
push eax
push esi
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, dword [ebp - 0x848]
jmp 0x4013a0
push 0
lea eax, [ebp - 0x20]
push eax
push 0x410
lea eax, [ebp - 0x844]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4014ae
cmp dword [ebp - 0x20], 0x410
mov eax, dword [ebp - 0x844]
jne 0x401653
test eax, eax
je 0x4015d8
cmp eax, 3
je 0x4015db
cmp dword [ebp - 0x838], 0x400
ja 0x4015d8
push eax
mov ecx, edi
call fcn.00401ef0
test eax, eax
jne 0x401535
mov eax, dword [ebp - 0x844]
mov dword [ebp - 0x434], eax
mov dword [ebp - 0x430], 0xffffffff
jmp 0x4015a7
push edi
lea ecx, [ebp - 0x434]
mov dword [ebp - 4], 0
push ecx
lea ecx, [ebp - 0x844]
push ecx
call eax
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
jmp 0x4015a7
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x40c
lea eax, [ebp - 0x434]
push eax
push esi
call ebx
lea eax, [edi + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, dword [ebp - 0x848]
jmp 0x4013a0
cmp eax, 3
sete bl
mov dword [ebp - 0x434], eax
xor ecx, ecx
mov eax, 0xfffffffb
test bl, bl
push ecx
cmovne eax, ecx
mov dword [ebp - 0x430], eax
lea eax, [ebp - 0x1c]
push eax
push 0x40c
lea eax, [ebp - 0x434]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, dword [ebp - 0x848]
test bl, bl
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x4013a0
cmp byte [edi + 0xc], 0
jne 0x4013a0
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.00410663
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 0x434], eax
mov dword [ebp - 0x430], 0xfffffffe
jmp 0x401499