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

Disassembly:
push ebp
sub esp, 0x81c
lea ebp, [esp - 4]
mov eax, dword [0x509354]
xor eax, ebp
mov dword [ebp + 0x81c], eax
push 0x28
mov eax, 0x4c520e
call fcn.0048e685
mov esi, dword [ebp + 0x828]
test esi, esi
jne 0x4031a8
push 8
pop eax
jmp 0x4033bf
and dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], esi
call fcn.004025b9
test al, al
je 0x4031d2
push str.GetNamedPipeClientProcessId
push 0x4cdc28
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x20], eax
mov ecx, esi
call fcn.00402646
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x34], eax
mov eax, dword [esi + 4]
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x28], eax
mov esi, 0x40c
push 0
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x4033bd
and dword [ebp - 0x24], 0
and dword [ebp - 0x18], 0
lea ecx, [ebp]
call fcn.00402573
lea ecx, [ebp + 0x410]
call fcn.00402593
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x403239
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor eax, eax
cmp dword [ebp - 0x28], eax
je 0x4032a2
cmp dword [ebp - 0x20], eax
je 0x4032a2
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x2c]
push eax
push ebx
call dword [ebp - 0x20]
test eax, eax
je 0x4032a2
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x2c]
je 0x4032a2
mov eax, dword [ebp]
push 0
mov dword [ebp + 0x410], eax
lea eax, [ebp - 0x24]
push eax
push 0x410
lea eax, [ebp]
push eax
push ebx
mov dword [ebp + 0x414], 0xfffffffa
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x18]
push eax
push esi
lea eax, [ebp + 0x410]
push eax
push ebx
call edi
push ebx
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
jmp 0x4031f5
push 0
lea eax, [ebp - 0x24]
push eax
push 0x410
lea eax, [ebp]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403296
cmp dword [ebp - 0x24], 0x410
mov eax, dword [ebp]
jne 0x4033e4
test eax, eax
je 0x40336f
cmp eax, 3
je 0x403372
cmp dword [ebp + 0xc], 0x400
ja 0x40336f
mov ecx, dword [ebp - 0x1c]
push eax
call fcn.0040312c
test eax, eax
jne 0x403309
mov eax, dword [ebp]
or dword [ebp + 0x414], 0xffffffff
mov dword [ebp + 0x410], eax
jmp 0x403351
push dword [ebp - 0x1c]
and dword [ebp - 4], 0
lea ecx, [ebp + 0x410]
push ecx
lea ecx, [ebp]
push ecx
call eax
add esp, 0xc
or dword [ebp - 4], 0xffffffff
jmp 0x403351
push 0
lea eax, [ebp - 0x18]
push eax
push esi
lea eax, [ebp + 0x410]
push eax
push ebx
call edi
mov ecx, dword [ebp - 0x1c]
call fcn.00402662
jmp 0x403296
cmp eax, 3
mov dword [ebp + 0x410], eax
sete byte [ebp - 0x11]
xor eax, eax
cmp byte [ebp - 0x11], al
push 0
setne al
dec eax
and eax, 0xfffffffb
mov dword [ebp + 0x414], eax
lea eax, [ebp - 0x18]
push eax
push esi
lea eax, [ebp + 0x410]
push eax
push ebx
call edi
push ebx
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
cmp byte [ebp - 0x11], 0
je 0x4031f5
mov eax, dword [ebp - 0x1c]
cmp byte [eax + 0x11], 0
jne 0x4031f5
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 + 0x81c]
xor ecx, ebp
call fcn.0048e25d
add ebp, 0x820
leave
ret 4
mov dword [ebp + 0x410], eax
mov dword [ebp + 0x414], 0xfffffffe
jmp 0x403285