Function at 0x18020ed30
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push rbp
push rbx
push rdi
push r13
push r15
lea rbp, [rsp - 0x70]
sub rsp, 0x170
mov rax, qword [0x1803c1370]
xor rax, rsp
mov qword [rbp + 0x50], rax
movsxd rdi, edx
mov r13, rcx
mov r15, r8
mov rcx, qword [rcx + rdi*8 + 0x120]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [r13 + rdi*8 + 0x120], 0xffffffffffffffff
mov byte [r15], 0
test edi, edi
jne 0x18020f0a9
mov rax, qword [r13 + 0x50]
mov qword [rsp + 0x160], r14
mov r14, qword [rax + 0x28]
test r14, r14
je 0x18020f0a1
mov qword [rsp + 0x1b8], rsi
mov qword [rsp + 0x168], r12
mov eax, dword [r14 + 4]
mov rdx, qword [r14 + 0x20]
mov r12, qword [r13]
mov dword [rsp + 0x40], eax
mov eax, dword [r13 + 0x9c]
mov ebx, 0x80
mov dword [rsp + 0x44], eax
mov eax, dword [r14 + 0xc]
lea rcx, [rsp + 0x50]
mov dword [rsp + 0x48], eax
mov eax, dword [r14 + 0x10]
cmp eax, ebx
cmova eax, ebx
mov r8d, eax
mov dword [rsp + 0x4c], eax
call sub.MSVCR100.dll_memcpy
mov byte [r15], 0
mov rax, qword [r12 + 0x238]
test rax, rax
je 0x18020ee10
mov rcx, qword [r12 + 0x240]
lea r8, [rsp + 0x40]
xor edx, edx
call rax
jmp 0x18020ee23
mov r8d, dword [rsp + 0x48]
mov edx, dword [rsp + 0x44]
mov ecx, dword [rsp + 0x40]
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x18020f04f
mov ecx, dword [rsp + 0x40]
lea r8, [rbp - 0x30]
lea rdx, [rsp + 0x54]
mov r9, rbx
call fcn.180213b50
test rax, rax
je 0x18020ee9e
lea r8, [rbp - 0x30]
lea rdx, str.__Trying__s...
mov rcx, r12
call fcn.180203670
lea rbx, [r12 + 0x8868]
lea r9, [rbp - 0x30]
lea r8, [0x18026156c]
mov rcx, rbx
mov edx, 0x2e
call fcn.180212380
mov rcx, r13
sub rcx, rbx
nop word [rax + rax]
movzx eax, byte [rbx]
inc rbx
mov byte [rcx + rbx + 0x57], al
test al, al
jne 0x18020ee90
cmp byte [r12 + 0x3ee], 0
je 0x18020eeb4
mov rdx, rsi
mov rcx, r13
call fcn.18020e760
mov rax, qword [r12 + 0x228]
test rax, rax
je 0x18020eed9
mov rcx, qword [r12 + 0x230]
xor r8d, r8d
mov rdx, rsi
call rax
test eax, eax
jne 0x18020f046
mov r8d, dword [rsp + 0x40]
mov rdx, rsi
mov rcx, r13
call fcn.18020e370
mov rcx, rsi
test eax, eax
jne 0x18020f049
lea r8, [rsp + 0x30]
mov edx, 0x8004667e
mov dword [rsp + 0x30], 1
call qword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [r13 + 0x9c], 1
jne 0x18020efba
mov r8d, dword [rsp + 0x4c]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_connect]
mov ebx, eax
cmp eax, 0xffffffff
jne 0x18020efa4
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
cmp eax, 0xb
je 0x18020ef79
cmp eax, 0x2732
jle 0x18020ef4f
cmp eax, 0x2734
jle 0x18020ef79
mov edx, eax
mov rcx, r13
call fcn.180213960
lea r8, [rbp - 0x30]
lea rdx, str.Failed_to_connect_to__s:__s
mov r9, rax
mov rcx, r12
call fcn.180203720
mov dword [r12 + 0x86ec], edi
jmp 0x18020efbc
xor r8d, r8d
mov rdx, rsi
or rcx, 0xffffffffffffffff
call fcn.18021f6a0
cmp eax, 0xffffffff
jne 0x18020ef91
or ebx, eax
jmp 0x18020efbc
test eax, eax
jne 0x18020ef9a
lea ebx, [rax + 1]
jmp 0x18020efa9
movsx ebx, al
and ebx, 4
shr ebx, 1
jmp 0x18020efbc
cmp eax, 1
jne 0x18020efbc
cmp dword [r12 + 0x668], 2
je 0x18020f086
jmp 0x18020efbc
xor ebx, ebx
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x34], 4
call qword [sym.imp.KERNEL32.dll_SleepEx]
lea r11, [rsp + 0x34]
lea r9, [rsp + 0x30]
mov edx, 0xffff
mov r8d, 0x1007
mov rcx, rsi
mov qword [rsp + 0x20], r11
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
je 0x18020f005
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x18020f009
mov eax, dword [rsp + 0x30]
test eax, eax
je 0x18020f018
cmp eax, 0x2748
je 0x18020f018
xor cl, cl
jmp 0x18020f01a
mov cl, 1
test ebx, ebx
jne 0x18020f05d
test cl, cl
jne 0x18020f073
mov edx, eax
mov rcx, r13
mov dword [r12 + 0x86ec], eax
call fcn.180213960
lea rdx, [0x180271050]
mov rcx, r12
mov r8, rax
call fcn.180203670
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov r14, qword [r14 + 0x28]
test r14, r14
je 0x18020f091
jmp 0x18020edaa
cmp ebx, 1
jne 0x18020f022
lea rdx, str.Timeout_n
mov rcx, r12
call fcn.180203670
jmp 0x18020f046
lea rdx, str.connected_n
mov rcx, r12
mov byte [r15], 1
call fcn.180203670
mov qword [r13 + 0x120], rsi
mov qword [r13 + 0x50], r14
mov rsi, qword [rsp + 0x1b8]
mov r12, qword [rsp + 0x168]
mov r14, qword [rsp + 0x160]
mov al, 1
mov rcx, qword [rbp + 0x50]
xor rcx, rsp
call fcn.180227610
add rsp, 0x170
pop r15
pop r13
pop rdi
pop rbx
pop rbp
ret