Function at 0x140394040
Capabilities:
Connect pipe
Get socket status

Disassembly:
push rbx
push rdi
push r14
sub rsp, 0x480
mov rax, qword [0x14041f010]
xor rax, rsp
mov qword [rsp + 0x460], rax
mov ebx, r8d
mov r14, rdx
mov rdi, rcx
test r8d, r8d
jle 0x140394078
lea rdx, str.Waiting_for_up_to__d_msec
call fcn.1401522a0
mov qword [rsp + 0x4b8], rsi
mov qword [rsp + 0x478], r12
mov qword [rsp + 0x470], r15
cmp r14, qword [rdi + 0x18]
je 0x140394149
call qword [sym.imp.KERNEL32.dll_GetTickCount]
lea esi, [rbx + rax]
mov ebx, 1
nop dword [rax + rax]
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], 0
xor r9d, r9d
mov qword [rsp + 0x20], rax
xor r8d, r8d
xor edx, edx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x1403940e3
cmp dword [rsp + 0x30], 0
ja 0x14039435d
cmp dword [rdi + 0x4c0], 0
je 0x140394102
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
xor edx, edx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
jmp 0x140394106
test eax, eax
je 0x14039413f
call fcn.14039be40
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, esi
sub edx, eax
test edx, edx
jle 0x1403942a3
cmp edx, ebx
mov ecx, ebx
cmovle ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
add ebx, ebx
cmp ebx, 0xa
jle 0x1403940b0
mov ebx, 0xa
jmp 0x1403940b0
mov eax, 2
jmp 0x1403942a8
mov eax, 0x10624dd3
movsxd rsi, r14d
imul ebx
lea r12, str.channel_write_input
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
imul eax, edx, 0x3e8
mov dword [rsp + 0x30], edx
sub ebx, eax
imul eax, ebx, 0x3e8
mov dword [rsp + 0x34], eax
nop word [rax + rax]
mov r8, qword [0x140468020]
lea r10d, [r14 + 1]
xor edx, edx
mov qword [rsp + 0x258], rsi
mov dword [rsp + 0x250], 1
mov dword [rsp + 0x40], edx
test r8, r8
je 0x140394258
nop dword [rax]
mov r9, qword [r8 + 0x378]
cmp r9, 0xffffffffffffffff
je 0x14039424c
cmp qword [r8 + 0x418], 0
mov rax, qword [r8 + 0x470]
jne 0x140394202
test rax, rax
je 0x14039424c
cmp dword [r8 + 0x488], 0
je 0x1403941ee
mov eax, dword [rax]
cmp dword [r8 + 0x490], eax
jge 0x14039424c
jmp 0x140394202
mov ecx, dword [r8 + 0x48c]
cmp ecx, dword [r8 + 0x490]
jg 0x14039424c
cmp ecx, dword [rax]
jg 0x14039424c
xor eax, eax
test edx, edx
je 0x14039421d
movsxd r9, r9d
nop dword [rax + rax]
cmp qword [rsp + rax*8 + 0x48], r9
je 0x14039421d
inc eax
cmp eax, edx
jb 0x140394210
cmp eax, edx
jne 0x14039423c
cmp edx, 0x40
jae 0x14039423c
movsxd rdx, dword [r8 + 0x378]
mov qword [rsp + rax*8 + 0x48], rdx
mov edx, dword [rsp + 0x40]
inc edx
mov dword [rsp + 0x40], edx
mov eax, dword [r8 + 0x378]
cmp eax, r10d
jl 0x14039424c
lea r10d, [rax + 1]
mov r8, qword [r8]
test r8, r8
jne 0x1403941b0
lea rax, [rsp + 0x30]
xor r9d, r9d
lea r8, [rsp + 0x40]
mov qword [rsp + 0x20], rax
lea rdx, [rsp + 0x250]
mov ecx, r10d
call qword [sym.imp.WSOCK32.dll_select]
mov edi, eax
call fcn.140013154
mov rbx, rax
call qword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov dword [rbx], eax
cmp edi, 0xffffffff
jne 0x1403942dc
call fcn.140013154
cmp dword [rax], 0x2714
je 0x140394180
mov eax, 1
mov r15, qword [rsp + 0x470]
mov r12, qword [rsp + 0x478]
mov rsi, qword [rsp + 0x4b8]
mov rcx, qword [rsp + 0x460]
xor rcx, rsp
call fcn.140001200
add rsp, 0x480
pop r14
pop rdi
pop rbx
ret
test edi, edi
jle 0x1403942a3
lea rdx, [rsp + 0x250]
mov rcx, r14
call qword [sym.imp.WSOCK32.dll___WSAFDIsSet]
test eax, eax
jne 0x14039435d
mov rbx, qword [0x140468020]
test rbx, rbx
je 0x140394180
cmp qword [rbx + 0x418], 0
je 0x14039432c
xor r9d, r9d
mov qword [rsp + 0x20], r12
lea r8, [0x1403b051f]
mov rcx, rbx
lea edx, [r9 + 3]
call fcn.14039add0
jmp 0x140394350
mov rcx, qword [rbx + 0x470]
test rcx, rcx
je 0x140394350
cmp dword [rbx + 0x488], 0
je 0x140394348
call fcn.14039b690
jmp 0x140394350
mov rcx, rbx
call fcn.14039a930
mov rbx, qword [rbx]
test rbx, rbx
jne 0x140394305
jmp 0x140394180
xor eax, eax
jmp 0x1403942a8