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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4115e0
mov eax, dword fs:[0]
push eax
sub esp, 0x858
mov eax, dword [0x418014]
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 ebx, dword [ebp + 8]
mov dword [ebp - 0x85c], ebx
test ebx, ebx
jne 0x401306
lea eax, [ebx + 8]
jmp 0x40163a
cmp dword [ebx + 0x10], 0
mov dword [ebp - 0x860], ebx
jne 0x401317
mov esi, dword [ebx + 0x2c]
jmp 0x401319
xor esi, esi
mov ecx, dword [ebx + 8]
mov eax, dword [ebx]
mov edi, dword [ebx + 0x90]
mov dword [ebp - 0x864], esi
mov dword [ebp - 0x850], ecx
mov dword [ebp - 0x854], eax
mov dword [ebp - 0x858], edi
nop dword [eax]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x401638
push 0x400
lea eax, [ebp - 0x83c]
mov dword [ebp - 0x24], 0
push 0
push eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x84c], 0
mov dword [ebp - 0x848], 0
mov dword [ebp - 0x844], 0
mov dword [ebp - 0x840], 0
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x43c], 0
lea eax, [ebp - 0x434]
mov dword [ebp - 0x438], 0
push 0x404
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0
push esi
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
cmp dword [ebp - 0x854], 0
je 0x401463
test edi, edi
je 0x401463
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0
push eax
push esi
mov ecx, edi
call dword [0x413248]
call edi
test eax, eax
je 0x401463
mov eax, dword [ebp - 0x854]
cmp eax, dword [ebp - 0x20]
je 0x401463
mov eax, dword [ebp - 0x84c]
push 0
mov dword [ebp - 0x43c], eax
lea eax, [ebp - 0x24]
push eax
push 0x410
lea eax, [ebp - 0x84c]
mov dword [ebp - 0x438], 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 - 0x43c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, dword [ebp - 0x850]
jmp 0x401340
push 0
lea eax, [ebp - 0x24]
push eax
push 0x410
lea eax, [ebp - 0x84c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401451
cmp dword [ebp - 0x24], 0x410
jne 0x401658
mov ecx, dword [ebp - 0x84c]
test ecx, ecx
je 0x4015dc
cmp ecx, 3
je 0x4015df
cmp dword [ebp - 0x840], 0x400
ja 0x4015dc
lea eax, [ebx + 0x14]
mov dword [ebp - 0x28], ecx
push eax
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [ebx + 0x38]
mov ecx, edi
mov edx, dword [ebp - 0x28]
mov eax, dword [edi + 4]
cmp byte [eax + 0xd], 0
jne 0x4014e9
cmp dword [eax + 0x10], edx
jae 0x4014df
mov eax, dword [eax + 8]
jmp 0x4014e3
mov ecx, eax
mov eax, dword [eax]
cmp byte [eax + 0xd], 0
je 0x4014d5
cmp byte [ecx + 0xd], 0
jne 0x40158c
cmp edx, dword [ecx + 0x10]
jb 0x40158c
cmp ecx, edi
je 0x40158c
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebx + 0x38]
call fcn.00401db0
mov edi, dword [eax]
test edi, edi
je 0x40158c
push ebx
lea eax, [ebp - 0x43c]
mov dword [ebp - 4], 0
push eax
lea eax, [ebp - 0x84c]
mov ecx, edi
push eax
call dword [0x413248]
call edi
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
jmp 0x4015a2
mov eax, dword [ebp - 0x84c]
mov dword [ebp - 0x43c], eax
mov dword [ebp - 0x438], 0xffffffff
mov edi, dword [ebp - 0x858]
lea eax, [ebp - 0x1c]
push 0
push eax
push 0x40c
lea eax, [ebp - 0x43c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, dword [ebp - 0x850]
jmp 0x401340
cmp ecx, 3
sete bl
mov dword [ebp - 0x43c], ecx
xor edx, edx
mov eax, 0xfffffffb
cmp ecx, 3
push edx
cmove eax, edx
mov dword [ebp - 0x438], eax
lea eax, [ebp - 0x1c]
push eax
push 0x40c
lea eax, [ebp - 0x43c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, dword [ebp - 0x850]
test bl, bl
mov ebx, dword [ebp - 0x85c]
je 0x401340
cmp byte [ebx + 0xc], 0
jne 0x401340
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.004102b0
mov esp, ebp
pop ebp
ret 4
mov eax, dword [ebp - 0x84c]
mov dword [ebp - 0x43c], eax
mov dword [ebp - 0x438], 0xfffffffe
jmp 0x401438