Function at 0x140006990
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push r12
push r14
push r15
lea rbp, [rsp - 0x180]
sub rsp, 0x280
mov r12, rdx
mov r14, r9
xor edx, edx
mov r15d, r8d
mov rbx, rcx
mov word [rcx + 0x2ac], dx
cmp byte [rcx + 0x4c9], dl
je 0x1400069d0
xor al, al
jmp 0x140006d39
mov rcx, qword [rcx + 8]
mov qword [rsp + 0x2b8], rdi
mov qword [rsp + 0x2c0], r13
cmp rcx, 0xffffffffffffffff
je 0x140006a09
mov edx, 2
call qword [sym.imp.WS2_32.dll_shutdown]
mov rcx, qword [rbx + 8]
call qword [sym.imp.WS2_32.dll_closesocket]
xor edx, edx
mov qword [rbx + 8], 0xffffffffffffffff
xor eax, eax
mov dword [rsp + 0x28], 1
mov dword [rsp + 0x20], edx
lea rdi, [rbx + 0x10]
mov ecx, 7
xor r9d, r9d
rep stosd dword [rdi], eax
mov qword [rbx + 0x508], rdx
lea r8d, [rax + 6]
mov qword [rbx + 0x630], rdx
lea edx, [rax + 1]
movzx ecx, word [r12]
call qword [sym.imp.WS2_32.dll_WSASocketW]
mov qword [rbx + 8], rax
cmp rax, 0xffffffffffffffff
jne 0x140006a71
mov r9, rax
lea r8, str.socket_create_failed
mov edx, 0x100
lea rcx, [rbx + 0x2ac]
call fcn.14003c5c8
xor al, al
jmp 0x140006d29
lea r8, [rbx + 0x2c]
mov edi, reloc.WS2_32.dll_recv
test r14, r14
jne 0x140006a85
cmp word [r8], r14w
je 0x140006b04
xor eax, eax
mov byte [rbp + 0x1b0], 0
xorps xmm0, xmm0
mov qword [rsp + 0x58], rax
test r14, r14
mov dword [rsp + 0x60], eax
mov edx, 0x100
lea rcx, [rsp + 0x70]
cmovne r8, r14
lea r9, [rax - 1]
movups xmmword [rsp + 0x48], xmm0
call fcn.14003c5c8
lea rax, [rsp + 0x48]
lea r9, [rbp + 0x1b0]
mov qword [rsp + 0x20], rax
lea rdx, [rsp + 0x70]
call fcn.140065f30
xor r14d, r14d
test al, al
je 0x140006b07
cmp word [rsp + 0x48], 0x17
lea rdx, [rsp + 0x48]
mov rcx, qword [rbx + 8]
mov r8d, edi
mov eax, 0x1c
mov word [rsp + 0x4a], r14w
cmove r8d, eax
call qword [sym.imp.WS2_32.dll_bind]
jmp 0x140006b07
xor r14d, r14d
lea r9, [rbx + 0x4d4]
cmp dword [r9], 0
jbe 0x140006b31
mov rcx, qword [rbx + 8]
mov edx, 0xffff
mov r8d, 0x1005
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
lea r9, [rbx + 0x4d8]
cmp dword [r9], 0
jbe 0x140006b5b
mov rcx, qword [rbx + 8]
mov edx, 0xffff
mov r8d, 0x1006
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rcx, qword [rbx + 8]
lea r9, [rsp + 0x44]
mov edx, 0xffff
mov dword [rsp + 0x44], 1
mov r8d, 8
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rax, qword [rbx]
mov dl, 1
mov rcx, rbx
call qword [rax + 0x38]
mov rcx, qword [rbx + 8]
lea r8, [rsp + 0x40]
mov edx, 0x8004667e
mov dword [rsp + 0x40], 1
call qword [sym.imp.WS2_32.dll_ioctlsocket]
lea rcx, [rbp + 0x1b0]
mov qword [rbp + 0x1b0], r14
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rcx, qword [rbp + 0x1b0]
mov rdx, r12
test eax, eax
mov qword [rsp + 0x30], r14
mov eax, 0x1c
mov qword [rsp + 0x28], r14
cmove rcx, r14
mov qword [rsp + 0x20], r14
mov qword [rbx + 0x508], rcx
cmp word [r12], 0x17
mov rcx, qword [rbx + 8]
cmove edi, eax
xor r9d, r9d
mov r8d, edi
call qword [sym.imp.WS2_32.dll_WSAConnect]
cmp eax, 0xffffffff
jne 0x140006cfb
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x140006c78
mov rax, qword [rbx + 8]
lea r8, [rsp + 0x70]
mov qword [rsp + 0x78], rax
xor r9d, r9d
mov eax, 0x10624dd3
mov dword [rsp + 0x70], 1
mul r15d
xor ecx, ecx
shr edx, 6
imul eax, edx, 0x3e8
mov dword [rbp + 0x1b0], edx
xor edx, edx
sub r15d, eax
imul eax, r15d, 0x3e8
mov dword [rbp + 0x1b4], eax
lea rax, [rbp + 0x1b0]
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x140006cfb
mov rcx, qword [rbx + 8]
cmp rcx, 0xffffffffffffffff
je 0x140006c9f
mov edx, 2
call qword [sym.imp.WS2_32.dll_shutdown]
mov rcx, qword [rbx + 8]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rbx + 8], 0xffffffffffffffff
xor eax, eax
lea rdi, [rbx + 0x10]
mov ecx, 7
lea r8, str.connect_failed
rep stosd dword [rdi], eax
mov edx, 0x100
mov qword [rbx + 0x630], r14
lea r9, [rax - 1]
mov qword [rbx + 0x508], r14
lea rcx, [rbx + 0x2ac]
call fcn.14003c5c8
lea r9, [rbx + 0xac]
lea r8, str._s_direct_connect_failed
lea rdx, str.Socket
lea rcx, [0x14021b240]
call fcn.140065f10
xor al, al
jmp 0x140006d29
mov rcx, qword [rbx + 0x508]
call fcn.1400068e0
mov rcx, qword [rbx + 8]
lea r8, [rsp + 0x40]
mov edx, 0x8004667e
mov qword [rbx + 0x508], rax
mov dword [rsp + 0x40], r14d
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov al, 1
mov rdi, qword [rsp + 0x2b8]
mov r13, qword [rsp + 0x2c0]
mov rbx, qword [rsp + 0x2c8]
add rsp, 0x280
pop r15
pop r14
pop r12
pop rsi
pop rbp
ret