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

Disassembly:
sub esp, 0x40
push ebx
push ebp
mov eax, dword [0x4074f8]
push esi
push edi
push 1
pop ebx
mov edi, 0xbb8
xor esi, esi
push edi
push esi
push 2
or ebp, 0xffffffff
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x28], ebx
call fcn.00401ede
add esp, 0xc
test eax, eax
je 0x40434c
call fcn.00404f0f
mov ecx, eax
call fcn.0040439f
test eax, eax
je 0x40434c
push 0x10000
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
cmp eax, esi
mov dword [esp + 0x14], eax
je 0x40434c
push edi
push esi
push 2
call fcn.00401ede
add esp, 0xc
test eax, eax
je 0x40434c
push esi
push esi
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CreateEventA]
push esi
call ebx
cmp eax, esi
mov dword [0x407564], eax
je 0x40434c
push edi
push esi
push 2
mov dword [esp + 0x34], eax
call fcn.00401ede
add esp, 0xc
test eax, eax
je 0x40434c
push esi
push esi
push 1
push esi
call ebx
cmp eax, esi
mov dword [esp + 0x2c], eax
je 0x40434c
push edi
push esi
push 2
call fcn.00401ede
add esp, 0xc
test eax, eax
je 0x40434c
push 0x14
call fcn.0040168e
cmp eax, esi
pop ecx
mov dword [esp + 0x10], eax
je 0x40434c
push 1
pop ebx
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x40434c
mov eax, dword [esp + 0x10]
mov dword [esp + 0x30], 0xc
mov dword [esp + 0x34], eax
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x3c], ebx
call fcn.00403fde
test eax, eax
pop ecx
je 0x40434c
push edi
push esi
push 2
call fcn.00401ede
add esp, 0xc
test eax, eax
je 0x40434c
lea eax, [esp + 0x30]
push eax
push 0x3e8
push esi
push esi
push ebx
push 6
push 0x40080003
push dword [esp + 0x3c]
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x404190
push str.Unable_to_create_named_pipe
call fcn.00401f62
pop ecx
jmp 0x40434c
push esi
push esi
push 4
call fcn.00401ede
add esp, 0xc
test eax, eax
je 0x40434c
push esi
push dword [0x407564]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40434c
mov edi, dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x14
lea eax, [esp + 0x40]
push esi
push eax
call fcn.00401767
mov eax, dword [esp + 0x38]
add esp, 0xc
mov dword [esp + 0x4c], eax
push eax
call edi
push esi
call ebx
lea eax, [esp + 0x3c]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40422d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
je 0x40422d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x40434c
push 0xffffffffffffffff
lea eax, [esp + 0x2c]
push esi
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x40434c
push 0x14
lea eax, [esp + 0x40]
push esi
push eax
call fcn.00401767
mov eax, dword [esp + 0x38]
add esp, 0xc
mov dword [esp + 0x4c], eax
push eax
call edi
push esi
call ebx
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x1c]
push eax
push 0x10000
push dword [esp + 0x20]
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x404293
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x404345
push 0xffffffffffffffff
lea eax, [esp + 0x2c]
push esi
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x404345
lea eax, [esp + 0x18]
push esi
push eax
lea eax, [esp + 0x44]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x404345
mov eax, dword [esp + 0x14]
push dword [esp + 0x18]
lea ecx, [eax + 0x10]
push ecx
push eax
push ebp
call fcn.004034a1
mov dword [esp + 0x2c], eax
push 0x14
lea eax, [esp + 0x50]
push esi
push eax
call fcn.00401767
mov eax, dword [esp + 0x48]
add esp, 0x1c
mov dword [esp + 0x4c], eax
push eax
call edi
push esi
call ebx
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x24]
push 4
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x404320
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x404345
push 0xffffffffffffffff
lea eax, [esp + 0x2c]
push esi
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x404345
push ebp
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
push esi
push dword [0x407564]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x4041c8
xor eax, eax
cmp eax, esi
je 0x40434c
push ebp
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
call fcn.0040370b
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebp, 0xffffffff
je 0x40435f
push ebp
call edi
mov eax, dword [0x407564]
cmp eax, esi
je 0x40436b
push eax
call edi
cmp dword [esp + 0x2c], esi
je 0x404377
push dword [esp + 0x2c]
call edi
cmp dword [esp + 0x10], esi
je 0x404387
push dword [esp + 0x10]
call fcn.004016d9
pop ecx
cmp dword [esp + 0x14], esi
pop edi
pop esi
pop ebp
pop ebx
je 0x40439b
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 0x40
ret