Function at 0x40e260
Capabilities:
Connect pipe
Create pipe

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x118
cmp qword [rcx + 0x98], 0
mov rbx, rcx
mov rsi, rdx
mov ebp, r8d
mov r12d, r9d
je 0x40e29d
lea r8, str.isClosed__
lea rcx, str.src_agent_NamedPipe.cc
mov edx, 0xd0
call fcn.00418fa0
mov edi, ebp
and edi, 3
je 0x40e630
lea rcx, [rsp + 0x60]
or edi, 0x40080000
call fcn.00415d80
mov rax, qword [rsp + 0x60]
test rax, rax
je 0x40e443
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x80], 0
mov dword [rsp + 0x70], 0x18
mov qword [rsp + 0x78], rax
call fcn.00416d90
mov r8d, eax
lea rax, [rsp + 0x70]
mov dword [rsp + 0x30], 0x7530
mov dword [rsp + 0x20], r12d
mov r9d, 1
mov edx, edi
mov qword [rsp + 0x38], rax
mov eax, dword [rsp + 0x170]
mov rcx, rsi
mov dword [rsp + 0x28], eax
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov rdi, rax
call fcn.00414460
test al, al
jne 0x40e543
cmp rdi, 0xffffffffffffffff
je 0x40e611
mov rcx, rsi
call sub.msvcrt.dll_wcslen
mov qword [rsp + 0x20], rax
mov r8, qword [rbx + 8]
mov r9, rsi
xor edx, edx
mov rcx, rbx
call fcn.0049a9e0
mov qword [rbx + 0x98], rdi
lea rdi, [rsp + 0x40]
mov dword [rbx + 0x48], ebp
mov rcx, rdi
call fcn.0040dcd0
lea rbp, [rbx + 0x40]
xor edx, edx
mov rcx, rbp
call fcn.00414db0
mov rax, qword [rsp + 0x40]
mov edx, 1
mov rcx, rdi
mov qword [rsp + 0x40], 0
mov qword [rbx + 0x40], rax
call fcn.00414db0
lea rdx, [rbx + 0x20]
mov qword [rbx + 0x20], 0
mov qword [rdx + 8], 0
mov qword [rdx + 0x10], 0
mov rax, qword [rbx + 0x40]
mov rcx, qword [rbx + 0x98]
mov qword [rbx + 0x38], rax
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
test edi, edi
sete cl
cmp eax, 0x217
sete dl
test cl, dl
jne 0x40e465
test edi, edi
jne 0x40e465
cmp eax, 0x3e5
je 0x40e40c
lea r8, str.false___ConnectNamedPipe_call_failed_
lea rcx, str.src_agent_NamedPipe.cc
mov edx, 0xfa
call fcn.00418fa0
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x40e433
mov rax, qword [rcx]
lea rdx, [0x004308c0]
mov rax, qword [rax + 8]
cmp rax, rdx
jne 0x40e660
call fcn.004aaf10
nop
add rsp, 0x118
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea r8, str.sd___error_creating_data_pipe_SECURITY_DESCRIPTOR_
lea rcx, str.src_agent_NamedPipe.cc
mov edx, 0xd8
call fcn.00418fa0
mov rax, qword [rsp + 0x60]
jmp 0x40e2c6
call fcn.00414460
test al, al
je 0x40e52c
lea rdi, [rsp + 0xd0]
test rsi, rsi
lea rax, [rdi + 0x10]
mov qword [rsp + 0xd0], rax
je 0x40e740
mov rcx, rsi
call sub.msvcrt.dll_wcslen
lea r12, [rax + rax]
mov rdx, r12
sar rdx, 1
cmp rdx, 7
mov qword [rsp + 0x58], rdx
ja 0x40e6f0
cmp rdx, 1
mov rcx, qword [rsp + 0xd0]
je 0x40e735
test rdx, rdx
jne 0x40e718
lea rsi, [rsp + 0xf0]
xor eax, eax
mov qword [rsp + 0xd8], rdx
mov word [rcx + rdx*2], ax
mov rdx, rdi
mov rcx, rsi
call fcn.00414ea0
mov rdx, qword [rsp + 0xf0]
lea rcx, str.Server_pipe___s__connected
call fcn.00413ac0
mov rcx, qword [rsp + 0xf0]
add rsi, 0x10
cmp rcx, rsi
je 0x40e516
call fcn.004aaf10
mov rcx, qword [rsp + 0xd0]
add rdi, 0x10
cmp rcx, rdi
je 0x40e52c
call fcn.004aaf10
xor edx, edx
mov rcx, rbp
call fcn.00414db0
mov rcx, rbx
call fcn.0040e130
jmp 0x40e40c
lea r12, [rsp + 0x90]
test rsi, rsi
lea rax, [r12 + 0x10]
mov qword [rsp + 0x90], rax
je 0x40e6c0
mov rcx, rsi
call sub.msvcrt.dll_wcslen
lea r13, [rax + rax]
mov rdx, r13
sar rdx, 1
cmp rdx, 7
mov qword [rsp + 0x50], rdx
ja 0x40e673
cmp rdx, 1
mov rcx, qword [rsp + 0x90]
je 0x40e650
test rdx, rdx
jne 0x40e69b
lea r13, [rsp + 0xb0]
xor r8d, r8d
mov qword [rsp + 0x98], rdx
mov word [rcx + rdx*2], r8w
mov rdx, r12
mov rcx, r13
call fcn.00414ea0
mov rdx, qword [rsp + 0xb0]
lea rcx, str.opened_server_pipe___s___handle___p
mov r8, rdi
call fcn.00413ac0
mov rcx, qword [rsp + 0xb0]
add r13, 0x10
cmp rcx, r13
je 0x40e5ed
call fcn.004aaf10
mov rcx, qword [rsp + 0x90]
add r12, 0x10
cmp rcx, r12
je 0x40e333
call fcn.004aaf10
cmp rdi, 0xffffffffffffffff
jne 0x40e33d
lea r8, str.handle___INVALID_HANDLE_VALUE___Could_not_open_server_pipe_
lea rcx, str.src_agent_NamedPipe.cc
mov edx, 0xe7
call fcn.00418fa0
jmp 0x40e33d
lea r8, str._openMode__OpenMode::Duplex____0
lea rcx, str.src_agent_NamedPipe.cc
mov edx, 0xd1
call fcn.00418fa0
jmp 0x40e2a8
movzx eax, word [rsi]
mov word [rcx], ax
jmp 0x40e59d
call rax
nop
add rsp, 0x118
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov rcx, r12
call fcn.0049c7b0
mov rcx, rax
mov qword [rsp + 0x90], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0xa0], rax
mov rdx, rsi
mov r8, r13
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x90]
jmp 0x40e59d
lea rcx, [0x004b2c58]
call fcn.004a4e20
mov rbx, rax
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x40e6df
mov rax, qword [rcx]
call qword [rax + 8]
mov rcx, rbx
call fcn.00424a70
nop word [rax + rax]
lea rdx, [rsp + 0x58]
xor r8d, r8d
mov rcx, rdi
call fcn.0049c7b0
mov rcx, rax
mov qword [rsp + 0xd0], rax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0xe0], rax
mov rdx, rsi
mov r8, r12
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x58]
mov rcx, qword [rsp + 0xd0]
jmp 0x40e4cb
movzx eax, word [rsi]
mov word [rcx], ax
jmp 0x40e4cb
lea rcx, [0x004b2c58]
call fcn.004a4e20
mov rcx, qword [rsp + 0xb0]
add r13, 0x10
mov rbx, rax
cmp rcx, r13
je 0x40e765
call fcn.004aaf10
mov rcx, qword [rsp + 0x90]
add r12, 0x10
cmp rcx, r12
je 0x40e6cf
call fcn.004aaf10
jmp 0x40e6cf