Function at 0x140051d14
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 - 7]
sub rsp, 0xa0
mov rax, qword [0x14016e040]
xor rax, rsp
mov qword [rbp - 1], rax
mov rdi, qword [rbp + 0x77]
mov qword [rbp - 0x29], rdi
mov r14, qword [rbp + 0x7f]
xor r12d, r12d
mov ebx, r12d
xorps xmm0, xmm0
movdqu xmmword [rbp - 0x49], xmm0
xorps xmm1, xmm1
movdqu xmmword [rbp - 0x39], xmm1
lea r15d, [r12 + 1]
mov qword [rbp - 0x51], r15
lea r13d, [r12 + 4]
cmp qword [rdx + 0x10], r12
je 0x140051d87
mov rbx, rdx
cmp qword [rdx + 0x18], 0xf
jbe 0x140051d81
mov rbx, qword [rdx]
mov qword [rbp - 0x59], r13
jmp 0x140051da2
cmp qword [rcx + 0x10], r12
je 0x140051d9a
mov rbx, rcx
cmp qword [rcx + 0x18], 0xf
jbe 0x140051d9a
mov rbx, qword [rcx]
mov dword [rbp - 0x55], r9d
mov dword [rbp - 0x59], r12d
mov edx, r8d
lea rcx, [rbp - 0x21]
call fcn.140002224
nop
lea rdx, [rbp - 0x21]
cmp qword [rbp - 9], 0xf
cmova rdx, qword [rbp - 0x21]
lea r9, [rbp - 0x61]
lea r8, [rbp - 0x59]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x140051e3c
mov rdx, qword [rbp - 9]
cmp rdx, 0xf
jbe 0x140051e0d
inc rdx
mov rcx, qword [rbp - 0x21]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140051e08
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140051fb9
call fcn.140118f64
movdqa xmm0, xmmword [0x1401544b0]
movdqu xmmword [rbp - 0x11], xmm0
mov byte [rbp - 0x21], r12b
mov rcx, qword [rdi + 0x38]
test rcx, rcx
je 0x140052118
mov rax, qword [rcx]
cmp rcx, rdi
setne dl
call qword [rax + 0x20]
jmp 0x140052114
mov rbx, qword [rbp - 0x61]
test rbx, rbx
je 0x140051f71
mov dword [rsp + 0x28], 0x81
mov dword [rsp + 0x20], r12d
xor r9d, r9d
mov r8d, dword [rbx + 0xc]
mov edx, dword [rbx + 8]
mov ecx, dword [rbx + 4]
call qword [sym.imp.WS2_32.dll_WSASocketW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140051e8f
mov r8d, dword [rbx + 0xc]
mov edx, dword [rbx + 8]
mov ecx, dword [rbx + 4]
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x140051f60
cmp byte [rbp + 0x6f], r12b
je 0x140051eb3
mov dword [rbp - 0x69], r15d
mov dword [rsp + 0x20], r13d
lea r9, [rbp - 0x69]
mov r8d, r15d
mov edx, 6
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rcx, qword [rdi + 0x38]
test rcx, rcx
je 0x140051eca
mov qword [rbp - 0x69], rsi
mov rax, qword [rcx]
lea rdx, [rbp - 0x69]
call qword [rax + reloc.WS2_32.dll_recv]
cmp dword [rbx + 4], 0x17
jne 0x140051eef
mov dword [rbp - 0x69], r12d
mov dword [rsp + 0x20], r13d
lea r9, [rbp - 0x69]
mov edx, 0x29
lea r8d, [rdx - 0xe]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
mov dword [rbp - 0x69], r15d
lea r8, [rbp - 0x69]
mov edx, 0x8004667e
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov r8d, dword [rbx + 0x10]
mov rdx, qword [rbx + 0x20]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x140051fc0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x140051f37
mov rax, qword [r14 + 8]
mov dword [rax], 2
jmp 0x140051f57
mov r8, qword [r14 + 0x18]
mov rdx, qword [r14 + 0x10]
mov r8, qword [r8]
mov rdx, qword [rdx]
mov rcx, rsi
call fcn.14003d1f4
mov rcx, qword [r14 + 8]
mov dword [rcx], eax
test eax, eax
je 0x140051fc0
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov rbx, qword [rbx + 0x28]
test rbx, rbx
jne 0x140051e49
mov rbx, qword [rbp - 0x61]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
nop
mov rdx, qword [rbp - 9]
cmp rdx, 0xf
jbe 0x1400520ed
inc rdx
mov rcx, qword [rbp - 0x21]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400520e8
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400520e8
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
nop
mov dword [rbp - 0x69], r12d
lea r8, [rbp - 0x69]
mov edx, 0x8004667e
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov rax, qword [r14 + 0x28]
mov rcx, qword [rax]
movabs r15, 0x20c49ba5e353f7cf
mov rax, r15
imul rcx
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov rcx, qword [r14 + 0x20]
imul r8d, dword [rcx], 0x3e8
add edx, r8d
mov dword [rbp - 0x69], edx
mov dword [rsp + 0x20], r13d
lea r9, [rbp - 0x69]
mov ebx, 0xffff
mov r8d, 0x1006
mov edx, ebx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rcx, qword [r14 + 0x38]
mov rax, r15
imul qword [rcx]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov rax, qword [r14 + 0x30]
imul ecx, dword [rax], 0x3e8
add edx, ecx
mov dword [rbp - 0x69], edx
mov dword [rsp + 0x20], r13d
lea r9, [rbp - 0x69]
mov r8d, 0x1005
mov edx, ebx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rax, qword [r14 + 8]
mov dword [rax], r12d
mov rcx, qword [rbp - 0x61]
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
nop
mov rdx, qword [rbp - 9]
cmp rdx, 0xf
jbe 0x1400520b9
inc rdx
mov rcx, qword [rbp - 0x21]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400520b4
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140051fb9
call fcn.140118f64
movdqa xmm0, xmmword [0x1401544b0]
movdqu xmmword [rbp - 0x11], xmm0
mov byte [rbp - 0x21], r12b
mov rcx, qword [rdi + 0x38]
test rcx, rcx
je 0x1400520e3
mov rax, qword [rcx]
cmp rcx, rdi
setne dl
call qword [rax + 0x20]
mov qword [rdi + 0x38], r12
mov rax, rsi
jmp 0x14005211c
call fcn.140118f64
movdqa xmm0, xmmword [0x1401544b0]
movdqu xmmword [rbp - 0x11], xmm0
mov byte [rbp - 0x21], r12b
mov rcx, qword [rdi + 0x38]
test rcx, rcx
je 0x140052118
mov r8, qword [rcx]
cmp rcx, rdi
setne dl
call qword [r8 + 0x20]
mov qword [rdi + 0x38], r12
or rax, 0xffffffffffffffff
mov rcx, qword [rbp - 1]
xor rcx, rsp
call fcn.140118ad0
mov rbx, qword [rsp + 0xf0]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret