Function at 0x180015160
Capabilities:
Connect socket
Get socket status
Resolve dns

Disassembly:
push rbp
push rdi
push r14
push r15
sub rsp, 0x2e8
mov rax, qword [0x180068020]
xor rax, rsp
mov qword [rsp + 0x2d0], rax
cmp qword [rcx], 0xffffffffffffffff
mov r14, r9
mov r15, r8
mov qword [rsp + 0x30], 0
mov rbp, rdx
mov rdi, rcx
je 0x1800151b1
lea rdx, str.Trying_to_connect_but_already_connected.
call fcn.180011ef0
mov eax, 0xffffffff
jmp 0x18001544f
mov rcx, rbp
mov qword [rsp + 0x2e0], rsi
call fcn.18000ad50
mov rsi, rax
test rax, rax
jne 0x1800151e0
lea rdx, str.Out_of_memory:_Failed_to_strdup_server_address.
mov rcx, rdi
call fcn.180011ef0
lea eax, [rsi - 1]
jmp 0x180015447
cmp byte [rax], 0x5b
mov qword [rsp + 0x320], rbx
mov rbx, rsi
jne 0x18001522d
lea rbx, [rax + 1]
mov edx, 0x5d
mov rcx, rbx
call fcn.1800236cc
test rax, rax
jne 0x18001522a
mov rcx, rsi
call fcn.18000ad20
mov r8, rbp
lea rdx, str.Invalid_address:_s__Missing___in_IPv6_address
mov rcx, rdi
call fcn.180011ef0
mov eax, 0xffffffff
jmp 0x18001543f
mov byte [rax], 0
lea r9, [rsp + 0x30]
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_getaddrinfo]
mov rcx, rsi
mov ebx, eax
call fcn.18000ad20
test ebx, ebx
je 0x18001526a
mov r8, rbp
lea rdx, str.Invalid_address:_s__Can_not_resolv_into_IPv4_v6.
mov rcx, rdi
call fcn.180011ef0
mov eax, 0xffffffff
jmp 0x18001543f
xor edx, edx
lea rcx, [rsp + 0x40]
mov r8d, 0x80
call fcn.180022f00
mov rax, qword [rsp + 0x30]
mov r8d, dword [rax + 4]
cmp r8d, 2
je 0x1800152da
cmp r8d, 0x17
je 0x1800152b5
lea rdx, str.Unknown_address_family_:_d._Only_IPv4_IPv6_supported_so_far.
mov rcx, rdi
call fcn.180011ef0
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
mov eax, 0xffffffff
jmp 0x18001543f
mov rax, qword [rax + 0x20]
mov esi, 0x1c
movups xmm0, xmmword [rax]
movups xmmword [rsp + 0x40], xmm0
movsd xmm1, qword [rax + 0x10]
movsd qword [rsp + 0x50], xmm1
mov eax, dword [rax + 0x18]
mov dword [rsp + 0x58], eax
jmp 0x1800152eb
mov rax, qword [rax + 0x20]
mov esi, reloc.WS2_32.dll_recv
movups xmm0, xmmword [rax]
movups xmmword [rsp + 0x40], xmm0
mov ecx, 0x1bd
call qword [sym.imp.WS2_32.dll_htons]
mov rcx, qword [rsp + 0x30]
mov word [rsp + 0x42], ax
mov ebx, dword [rcx + 4]
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
xor r8d, r8d
mov qword [rdi + 0x60], r15
mov ecx, ebx
mov qword [rdi + 0x68], r14
lea edx, [r8 + 1]
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rdi], rax
cmp rax, 0xffffffffffffffff
jne 0x18001535b
call fcn.18002cb90
mov ebx, dword [rax]
call fcn.18002cb90
mov ecx, dword [rax]
call fcn.180034c30
mov r8, rax
lea rdx, str.Failed_to_open_smb2_socket._Errno:_s__d_.
mov r9d, ebx
mov rcx, rdi
call fcn.180011ef0
mov eax, 0xffffffff
jmp 0x18001543f
mov rcx, rax
call fcn.1800150d0
mov rcx, qword [rdi]
mov edx, 1
mov r8d, edx
call fcn.180015100
mov rcx, qword [rdi]
lea rdx, [rsp + 0x40]
mov r8d, esi
call qword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x180015395
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x1800153fe
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x18001543d
xor edx, edx
lea rcx, [rsp + 0xc0]
mov r8d, 0x208
call fcn.180022f00
mov rax, qword [rdi]
lea r8, [rsp + 0xc0]
mov qword [rsp + 0xc8], rax
xor r9d, r9d
lea rax, [rsp + 0x38]
mov dword [rsp + 0xc0], 1
xor edx, edx
mov qword [rsp + 0x20], rax
xor ecx, ecx
mov qword [rsp + 0x38], 2
call qword [sym.imp.WS2_32.dll_select]
cmp eax, 1
je 0x18001543d
call fcn.18002cb90
mov ebx, dword [rax]
call fcn.18002cb90
mov ecx, dword [rax]
call fcn.180034c30
mov r8, rax
lea rdx, str.Connect_failed_with_errno_:__s__d_
mov r9d, ebx
mov rcx, rdi
call fcn.180011ef0
mov rcx, qword [rdi]
call qword [sym.imp.WS2_32.dll_closesocket]
mov eax, 0xffffffff
mov qword [rdi], 0xffffffffffffffff
jmp 0x18001543f
xor eax, eax
mov rbx, qword [rsp + 0x320]
mov rsi, qword [rsp + 0x2e0]
mov rcx, qword [rsp + 0x2d0]
xor rcx, rsp
call fcn.180010bf0
add rsp, 0x2e8
pop r15
pop r14
pop rdi
pop rbp
ret