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

Disassembly:
push r15
push r14
mov eax, 0x10a8
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.00411340
sub rsp, rax
mov ebx, ecx
mov qword [rsp + 0x10f8], rdx
call fcn.0040ff10
cmp ebx, 1
jle 0x49721b
mov rax, qword [rsp + 0x10f8]
lea rsi, [rsp + 0x90]
lea rbp, [rsi + 0x10]
mov r15, qword [rax + 8]
mov qword [rsp + 0x90], rbp
test r15, r15
je 0x496f5f
mov rdx, qword [rsp + 0x10f8]
lea rdi, [rax + 0x10]
lea eax, [rbx - 2]
lea r14, [rsp + 0x70]
lea r12, str.__everyone
lea r13, [rdx + rax*8 + 0x10]
nop word [rax + rax]
mov rcx, r15
call sub.msvcrt.dll_strlen
cmp rax, 0xf
mov rbx, rax
mov qword [rsp + 0x70], rax
ja 0x496f70
mov rdx, qword [rsp + 0x90]
cmp rax, 1
mov rcx, rdx
je 0x496fb0
test rax, rax
jne 0x496f96
mov rax, qword [rsp + 0x70]
mov rcx, rsi
mov qword [rsp + 0x98], rax
mov byte [rdx + rax], 0
mov rdx, r12
call fcn.0042a170
test eax, eax
jne 0x496fc3
mov rcx, qword [rsp + 0x90]
cmp rcx, rbp
je 0x496f3e
call fcn.00496360
cmp r13, rdi
je 0x496fff
mov r15, qword [rdi]
add rdi, 8
mov qword [rsp + 0x90], rbp
test r15, r15
jne 0x496ed0
lea rcx, [0x0049b0f0]
call fcn.00490270
nop dword [rax + rax]
mov rcx, rsi
xor r8d, r8d
mov rdx, r14
call fcn.004852b0
mov rcx, rax
mov qword [rsp + 0x90], rax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0xa0], rax
mov rdx, r15
mov r8, rbx
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x90]
jmp 0x496f08
movzx eax, byte [r15]
mov byte [rdx], al
mov rdx, qword [rsp + 0x90]
jmp 0x496f08
lea rdx, [0x0049b03b]
mov rcx, rsi
call fcn.0042a170
test eax, eax
jne 0x4971a7
mov rax, qword [rsp + 0x10f8]
mov r8, qword [0x00498010]
lea rcx, str.Usage:__s____everyone__n_nCreates_the_named_pipe__ls_and_reads_messages.__Prints_each_nmessage_to_stdout.__By_default__only_the_current_user_can_send_messages._nPass___everyone_to_let_anyone_send_a_message._n_nUse_the_WINPTY_DEBUG_environment_variable_to_enable_winpty_trace_output._n_e.g._WINPTY_DEBUGtrace_for_the_default_trace_output.___Set_WINPTYDBG1_nto_enable_trace_with_older_winpty_versions._n
mov rdx, qword [rax]
call fcn.0041c630
xor ecx, ecx
call sub.msvcrt.dll_exit
lea rbx, [rsp + 0x70]
mov ecx, 6
xor eax, eax
mov rdi, rbx
rep stosd dword [rdi], eax
lea rcx, [rsp + 0x60]
call fcn.00403290
mov rax, qword [rsp + 0x68]
mov dword [rsp + 0x70], 0x18
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x78], rax
call fcn.00403fc0
or eax, 6
mov qword [rsp + 0x38], rbx
mov dword [rsp + 0x30], 0x2710
mov dword [rsp + 0x28], 0x1000
mov dword [rsp + 0x20], 0x1000
mov r9d, 1
mov r8d, eax
mov edx, 0x80003
mov rcx, qword [0x00498010]
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
cmp rax, 0xffffffffffffffff
mov rbx, rax
mov rdi, qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
je 0x4971e6
mov rbp, qword [sym.imp.msvcrt.dll___iob_func]
mov r14, qword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov r12, qword [sym.imp.KERNEL32.dll_ReadFile]
mov r13, rbp
mov r15, r14
xor edx, edx
mov rcx, rbx
call rdi
test eax, eax
je 0x497179
lea rsi, [rsp + 0x90]
mov dword [rsp + 0x5c], 0
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x5c]
mov r8d, 0x1000
mov rcx, rbx
mov rdx, rsi
call r12
test eax, eax
jne 0x497110
call r13
lea rcx, [rax + 0x60]
lea rdx, str.error:_ReadFile_on_pipe_failed_n
call fcn.0041c660
call r13
lea rcx, [rax + 0x60]
call sub.msvcrt.dll_fflush
mov rcx, rbx
call r15
jmp 0x4970a5
mov eax, dword [rsp + 0x5c]
mov byte [rsp + rax + 0x90], 0xa
call rbp
lea r9, [rax + 0x30]
mov eax, dword [rsp + 0x5c]
mov edx, 1
mov rcx, rsi
lea r8d, [rax + 1]
call sub.msvcrt.dll_fwrite
call rbp
lea rcx, [rax + 0x30]
call sub.msvcrt.dll_fflush
mov dword [rsp + 0x60], 0
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x60]
mov r8d, 2
lea rdx, [0x0049b0b8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call r14
jmp 0x4970a5
mov rbx, qword [sym.imp.msvcrt.dll___iob_func]
call rbx
lea rcx, [rax + 0x60]
lea rdx, str.error:_ConnectNamedPipe_failed_n
call fcn.0041c660
call rbx
lea rcx, [rax + 0x60]
call sub.msvcrt.dll_fflush
mov ecx, 1
call sub.msvcrt.dll_exit
lea rdx, str.__help
mov rcx, rsi
call fcn.0042a170
test eax, eax
je 0x496fda
mov rax, qword [rsp + 0x10f8]
mov r8, qword [0x00498010]
lea rcx, str.Usage:__s____everyone__n_nCreates_the_named_pipe__ls_and_reads_messages.__Prints_each_nmessage_to_stdout.__By_default__only_the_current_user_can_send_messages._nPass___everyone_to_let_anyone_send_a_message._n_nUse_the_WINPTY_DEBUG_environment_variable_to_enable_winpty_trace_output._n_e.g._WINPTY_DEBUGtrace_for_the_default_trace_output.___Set_WINPTYDBG1_nto_enable_trace_with_older_winpty_versions._n
mov rdx, qword [rax]
call fcn.0041c630
mov ecx, 1
call sub.msvcrt.dll_exit
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rbx, qword [0x00498010]
call qword [sym.imp.msvcrt.dll___iob_func]
lea rcx, [rax + 0x60]
lea rdx, str.error:_could_not_create__ls_pipe:_error__u_n
mov r9d, esi
mov r8, rbx
call fcn.0041c660
mov ecx, 1
call sub.msvcrt.dll_exit
lea rdi, [rsp + 0x70]
mov ecx, 6
xor eax, eax
mov qword [rsp + 0x48], 0
xor ebx, ebx
rep stosd dword [rdi], eax
jmp 0x497036