Function at 0x402fb4
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 [0x50b384]
xor eax, ebp
mov dword [ebp + 0x81c], eax
push 0x28
mov eax, 0x4c5ede
call fcn.0048eff5
mov esi, dword [ebp + 0x828]
test esi, esi
jne 0x402fea
push 8
pop eax
jmp 0x403201
and dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], esi
call fcn.0040cbf3
test al, al
je 0x403014
push str.GetNamedPipeClientProcessId
push 0x4cec18
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.004025df
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 0x4031ff
and dword [ebp - 0x24], 0
and dword [ebp - 0x18], 0
lea ecx, [ebp]
call fcn.00402581
lea ecx, [ebp + 0x410]
call fcn.004025a1
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40307b
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor eax, eax
cmp dword [ebp - 0x28], eax
je 0x4030e4
cmp dword [ebp - 0x20], eax
je 0x4030e4
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x2c]
push eax
push ebx
call dword [ebp - 0x20]
test eax, eax
je 0x4030e4
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x2c]
je 0x4030e4
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 0x403037
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 0x4030d8
cmp dword [ebp - 0x24], 0x410
mov eax, dword [ebp]
jne 0x403226
test eax, eax
je 0x4031b1
cmp eax, 3
je 0x4031b4
cmp dword [ebp + 0xc], 0x400
ja 0x4031b1
mov ecx, dword [ebp - 0x1c]
push eax
call fcn.00402f6c
test eax, eax
jne 0x40314b
mov eax, dword [ebp]
or dword [ebp + 0x414], 0xffffffff
mov dword [ebp + 0x410], eax
jmp 0x403193
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 0x403193
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.004025fb
jmp 0x4030d8
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 0x403037
mov eax, dword [ebp - 0x1c]
cmp byte [eax + 0x11], 0
jne 0x403037
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.0048ebcd
add ebp, 0x820
leave
ret 4
mov dword [ebp + 0x410], eax
mov dword [ebp + 0x414], 0xfffffffe
jmp 0x4030c7