Function at 0x140016ec0
Capabilities:
Connect pipe

Disassembly:
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0x90
mov qword [rbp + 0x17], 0xfffffffffffffffe
mov qword [rsp + 0xd0], rbx
mov rax, qword [0x1404716f0]
xor rax, rsp
mov qword [rbp + 0x2f], rax
mov r14d, edx
mov rdi, rcx
cmp byte [rcx + 0x19], 0
jne 0x140017021
cmp qword [rcx + 8], 0xffffffffffffffff
je 0x140016f10
mov al, 1
jmp 0x1400170e1
lea rax, [rbp - 0x19]
mov qword [rbp - 0x11], rax
movd xmm0, r14d
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [0x1403a8a08]
movsd qword [rbp - 0x19], xmm0
lea rcx, [rbp + 0x1f]
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__ftime64_s]
imul rbx, qword [rbp + 0x1f], 0x3e8
movzx eax, word [rbp + 0x27]
add rbx, rax
movsd xmm0, qword [rbp - 0x19]
mulsd xmm0, qword [0x1403a8e10]
cvttsd2si rax, xmm0
sub rbx, rax
lea rsi, [rdi + 0x1b]
xor r15d, r15d
mov qword [rbp - 0x11], rsi
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rdi + 8], 0xffffffffffffffff
jne 0x140016fb1
mov rdx, rdi
lea rcx, [rbp - 0x19]
call fcn.140018b20
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x40000000
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0000000
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rdi + 8], rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp qword [rdi + 8], 0xffffffffffffffff
jne 0x140016f09
cmp byte [rdi + 0x1a], 0
jne 0x14001701a
test r14d, r14d
js 0x140016fee
lea rcx, [rbp + 0x1f]
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__ftime64_s]
imul rcx, qword [rbp + 0x1f], 0x3e8
movzx eax, word [rbp + 0x27]
add rcx, rax
cmp rcx, rbx
jg 0x14001701a
mov rcx, qword [0x14047d1e8]
test rcx, rcx
jne 0x14001700a
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140016f63
mov edx, 1
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140016f63
xor al, al
jmp 0x1400170e1
movzx eax, byte [rcx + 0x18]
test al, al
jne 0x1400170e1
xor eax, eax
mov qword [rbp - 9], rax
mov qword [rbp - 1], rax
mov qword [rbp + 7], rax
mov qword [rbp + 0xf], rax
xor r9d, r9d
xor r8d, r8d
lea edx, [rax + 1]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rbp + 0xf], rax
lea rdx, [rbp - 9]
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x1400170d3
call qword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x217
je 0x1400170cf
sub eax, 1
je 0x14001707f
sub eax, 0x1cd
jne 0x1400170d3
cmp byte [rdi + 0x1a], 0
jne 0x1400170c8
mov rax, qword [rbp + 0xf]
mov qword [rbp + 0x1f], rax
mov rax, qword [rdi + 0x10]
mov qword [rbp + 0x27], rax
mov r9d, 0xffffffff
test r14d, r14d
cmovns r9d, r14d
xor r8d, r8d
lea rdx, [rbp + 0x1f]
lea ecx, [r8 + 2]
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x1400170be
mov al, 1
mov byte [rdi + 0x18], al
jmp 0x1400170d3
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_CancelIo]
xor al, al
mov byte [rdi + 0x18], al
jmp 0x1400170d3
mov byte [rdi + 0x18], 1
mov rcx, qword [rbp + 0xf]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, byte [rdi + 0x18]
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.14010a310
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret