Function at 0x140087460
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x2350]
mov eax, 0x2450
call fcn.140148660
sub rsp, rax
mov rax, qword [0x14021b0e0]
xor rax, rsp
mov qword [rbp + 0x2340], rax
mov r15d, edx
mov rbx, rcx
mov r9d, edx
lea r8, str.vncServer::EnableConnections_:_SockConnect__d_n
mov edx, 0xa
lea rcx, vtable.VNCLog.0
call fcn.140018d00
mov rax, qword [rbx + 0xf0]
test r15d, r15d
je 0x1400878e6
test rax, rax
jne 0x140087958
mov ecx, 0x2410
call fcn.140147b18
mov rsi, rax
mov qword [rsp + 0x30], rax
lea rax, vtable.vncSockConnect.0
mov qword [rsi], rax
lea rcx, [rsi + 8]
call fcn.14008a420
xor edi, edi
mov qword [rsi + 0x2408], rdi
mov qword [rbx + 0xf0], rsi
mov rcx, qword [0x14022a710]
cmp dword [rcx + 0x728], edi
je 0x14008789c
mov r14d, 0x170c
lea r13, vtable.VSocket.0
lea r12d, [rdi + 2]
nop dword [rax]
mov dword [rbx + 0xa0], r14d
lea eax, [r14 - 0x64]
mov dword [rbx + 0xa4], eax
mov r9d, r14d
lea r8, str.vncServer::EnableConnections_:_trying_port_number__d_n
mov edx, 1
lea rcx, vtable.VNCLog.0
call fcn.140018d00
mov qword [rsp + 0x40], r13
lea rcx, [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [rbp - 0x38]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov qword [rsp + 0x50], 0xffffffffffffffff
xorps xmm0, xmm0
movdqa xmmword [rsp + 0x60], xmm0
mov qword [rsp + 0x48], rdi
mov byte [rsp + 0x70], 0
mov qword [rbp - 0x10], rdi
mov qword [rbp - 4], rdi
mov byte [rbp - 8], 0
xor edx, edx
mov r8d, 0x232c
lea rcx, [rbp + 4]
call fcn.14014a5c0
mov dword [rsp + 0x58], edi
mov word [rsp + 0x71], 0
mov rax, qword [0x14022a710]
mov ecx, dword [rax + 0xd14]
mov dword [rbp + 0x2330], ecx
mov dword [rsp + 0x30], 1
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x14008763f
lea r8, str.VSocket::Close_:_closing_socket_n
mov edx, 0xa
lea rcx, vtable.VNCLog.0
call fcn.140018d00
mov edx, r12d
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_shutdown]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rsp + 0x50], 0xffffffffffffffff
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x14008763f
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x48], rdi
xor r8d, r8d
lea edx, [r8 + 1]
mov ecx, r12d
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rsp + 0x50], rax
cmp rax, 0xffffffffffffffff
je 0x14008773f
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x30]
mov edx, 0xffff
mov r8d, 4
mov rcx, rax
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jne 0x14008773a
lea rcx, [rsp + 0x40]
call fcn.14008a8d0
mov esi, dword [rbx + 0xa0]
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x14008771b
xorps xmm0, xmm0
movups xmmword [rsp + 0x30], xmm0
mov word [rsp + 0x30], r12w
lea rcx, str.localhost
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rsp + 0x34], eax
cmp eax, 0xffffffff
jne 0x1400876e7
lea rcx, str.localhost
call qword [sym.imp.WS2_32.dll_gethostbyname]
test rax, rax
je 0x14008771b
mov rax, qword [rax + 0x18]
mov rcx, qword [rax]
test rcx, rcx
je 0x14008771b
mov eax, dword [rcx]
mov dword [rsp + 0x34], eax
movzx ecx, si
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x32], ax
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0x30]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x14008771b
lea rcx, [rsp + 0x40]
call fcn.14008a8d0
jmp 0x14008773a
mov rcx, qword [rbx + 0xf0]
mov rax, qword [rcx]
mov r8d, dword [rbx + 0xa0]
mov rdx, rbx
call qword [rax + reloc.WS2_32.dll_htonl]
test eax, eax
jne 0x140087807
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x40], r13
cmp rax, 0xffffffffffffffff
je 0x140087784
lea r8, str.VSocket::Close_:_closing_socket_n
mov edx, 0xa
lea rcx, vtable.VNCLog.0
call fcn.140018d00
mov edx, r12d
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_shutdown]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rsp + 0x50], 0xffffffffffffffff
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x1400877a2
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x48], rdi
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0x1400877b0
call fcn.140147b10
lea rcx, [rbp - 0x38]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
nop
inc r14d
lea eax, [r14 - 0x170c]
cmp eax, 0x63
jl 0x140087530
mov rcx, qword [rbx + 0xf0]
test rcx, rcx
je 0x1400877f9
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov qword [rbx + 0xf0], rdi
xor eax, eax
jmp 0x14008795d
mov qword [rsp + 0x40], r13
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x14008784e
lea r8, str.VSocket::Close_:_closing_socket_n
mov edx, 0xa
lea rcx, vtable.VNCLog.0
call fcn.140018d00
mov edx, r12d
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_shutdown]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rsp + 0x50], 0xffffffffffffffff
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x14008786c
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x48], rdi
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0x14008787a
call fcn.140147b10
lea rcx, [rbp - 0x38]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
nop
jmp 0x1400878b7
mov rax, qword [rsi]
mov r8d, dword [rbx + 0xa0]
mov rdx, rbx
mov rcx, rsi
call qword [rax + reloc.WS2_32.dll_htonl]
test eax, eax
je 0x1400877e3
mov rax, qword [rbx]
mov edx, dword [rbx + 0x100]
mov rcx, rbx
call qword [rax + 0x1b8]
mov r9d, r15d
lea r8, str.vncServer::EnableConnections_:_SockConnect__Done__d_n
mov edx, 0xa
lea rcx, vtable.VNCLog.0
call fcn.140018d00
jmp 0x140087958
test rax, rax
je 0x140087946
lea r8, str.vncServer::EnableConnections_:_KillAuthClients___fix_up_a_lock_up__n
mov edx, 9
lea rcx, vtable.VNCLog.0
call fcn.140018d00
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x50]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x68]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x60]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x78]
mov rcx, qword [rbx + 0xf0]
test rcx, rcx
je 0x14008793d
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
xor edi, edi
mov qword [rbx + 0xf0], rdi
mov rax, qword [rbx]
mov edx, dword [rbx + 0x100]
mov rcx, rbx
call qword [rax + 0x1b8]
mov eax, 1
mov rcx, qword [rbp + 0x2340]
xor rcx, rsp
call fcn.140147af0
mov rbx, qword [rsp + 0x24a0]
add rsp, 0x2450
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret