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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r15
lea rbp, [rsp - 0x570]
sub rsp, 0x670
mov rsi, rdx
mov dword [rbp + 0x5a0], 1
mov rbx, r8
mov rdi, rcx
mov rcx, rsi
lea r8, [rbp + 0x5a0]
mov edx, 0x8004667e
mov r15, r9
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov r8d, dword [rbx + 0x10]
mov rcx, rsi
mov rdx, qword [rbx + 0x20]
call qword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x1401564d6
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x1401562df
mov rax, qword [rdi + 8]
mov dword [rax], 2
xor al, al
jmp 0x1401565aa
mov rax, qword [rdi + 0x18]
lea rcx, [rbp + 0x150]
mov qword [rsp + 0x690], r14
mov edx, 4
mov qword [rsp + 0x48], rsi
mov dword [rsp + 0x40], 1
mov r8, qword [rax]
mov rax, qword [rdi + 0x10]
mov r9, qword [rax]
lea rax, [rsp + 0x40]
nop dword [rax]
nop word [rax + rax]
lea rcx, [rcx + 0x80]
movups xmm0, xmmword [rax]
movups xmm1, xmmword [rax + 0x10]
lea rax, [rax + 0x80]
movups xmmword [rcx - 0x80], xmm0
movups xmm0, xmmword [rax - 0x60]
movups xmmword [rcx - 0x70], xmm1
movups xmm1, xmmword [rax - 0x50]
movups xmmword [rcx - 0x60], xmm0
movups xmm0, xmmword [rax - 0x40]
movups xmmword [rcx - 0x50], xmm1
movups xmm1, xmmword [rax - 0x30]
movups xmmword [rcx - 0x40], xmm0
movups xmm0, xmmword [rax - 0x20]
movups xmmword [rcx - 0x30], xmm1
movups xmm1, xmmword [rax - 0x10]
movups xmmword [rcx - 0x20], xmm0
movups xmmword [rcx - 0x10], xmm1
sub rdx, 1
jne 0x140156320
mov rax, qword [rax]
lea rdx, [rbp + 0x360]
mov qword [rcx], rax
lea rax, [rsp + 0x40]
mov ecx, 4
nop word [rax + rax]
lea rdx, [rdx + 0x80]
movups xmm0, xmmword [rax]
movups xmm1, xmmword [rax + 0x10]
lea rax, [rax + 0x80]
movups xmmword [rdx - 0x80], xmm0
movups xmm0, xmmword [rax - 0x60]
movups xmmword [rdx - 0x70], xmm1
movups xmm1, xmmword [rax - 0x50]
movups xmmword [rdx - 0x60], xmm0
movups xmm0, xmmword [rax - 0x40]
movups xmmword [rdx - 0x50], xmm1
movups xmm1, xmmword [rax - 0x30]
movups xmmword [rdx - 0x40], xmm0
movups xmm0, xmmword [rax - 0x20]
movups xmmword [rdx - 0x30], xmm1
movups xmm1, xmmword [rax - 0x10]
movups xmmword [rdx - 0x20], xmm0
movups xmmword [rdx - 0x10], xmm1
sub rcx, 1
jne 0x140156390
mov rcx, qword [rax]
mov qword [rdx], rcx
mov dword [rsp + 0x38], r9d
mov dword [rsp + 0x3c], r8d
lea rax, [rsp + 0x38]
lea r9, [rbp + 0x360]
mov qword [rsp + 0x20], rax
lea r8, [rbp + 0x150]
lea rdx, [rsp + 0x40]
lea ecx, [rsi + 1]
call qword [sym.imp.WS2_32.dll_select]
mov ebx, eax
test eax, eax
jns 0x14015642a
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [rax], 4
je 0x1401563f3
mov r14, qword [rsp + 0x690]
test ebx, ebx
jne 0x14015644b
mov rax, qword [rdi + 8]
mov byte [r15], 1
mov dword [rax], ntohs
xor al, al
jmp 0x1401565aa
jle 0x1401562ce
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x14015647b
lea rdx, [rbp + 0x150]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x1401562ce
lea rax, [rsp + 0x30]
mov dword [rbp + 0x5a0], 0
lea r9, [rbp + 0x5a0]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov dword [rsp + 0x30], 4
mov r8d, 0x1007
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
js 0x1401564c3
cmp dword [rbp + 0x5a0], 0
jne 0x1401564c3
xor ecx, ecx
jmp 0x1401564c8
mov ecx, 2
mov rax, qword [rdi + 8]
mov dword [rax], ecx
test ecx, ecx
jne 0x1401562d8
lea r8, [rbp + 0x5a0]
mov dword [rbp + 0x5a0], 0
mov edx, 0x8004667e
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov rax, qword [rdi + 0x28]
lea r9, [rbp + 0x5a0]
movabs rbx, 0x20c49ba5e353f7cf
mov dword [rsp + 0x20], 4
mov rcx, qword [rax]
mov rax, rbx
imul rcx
sar rdx, 7
mov rcx, rdx
shr rcx, 0x3f
add rdx, rcx
mov rcx, qword [rdi + 0x20]
imul r8d, dword [rcx], 0x3e8
mov rcx, rsi
add edx, r8d
mov r8d, 0x1006
mov dword [rbp + 0x5a0], edx
mov edx, 0xffff
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rcx, qword [rdi + 0x38]
lea r9, [rbp + 0x5a0]
mov rax, rbx
mov dword [rsp + 0x20], 4
mov r8d, 0x1005
imul qword [rcx]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov rax, qword [rdi + 0x30]
imul ecx, dword [rax], 0x3e8
add edx, ecx
mov rcx, rsi
mov dword [rbp + 0x5a0], edx
mov edx, 0xffff
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rax, qword [rdi + 8]
mov dword [rax], 0
mov al, 1
lea r11, [rsp + 0x670]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop rdi
pop rbp
ret