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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r13
push r14
push r15
lea rbp, [rsp - 0x170]
sub rsp, 0x270
xor r13d, r13d
lea rdi, [rcx + 0x22c]
mov r14, r9
mov esi, r8d
mov r15, rdx
mov rbx, rcx
mov word [rdi], r13w
cmp byte [rcx + 0x449], r13b
je 0x40706f
xor al, al
jmp 0x407303
mov rax, qword [rcx + 8]
cmp rax, 0xffffffffffffffff
je 0x40709a
mov rcx, qword [rcx + 8]
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
mov dword [rsp + 0x28], 1
xorps xmm0, xmm0
mov dword [rsp + 0x20], r13d
movups xmmword [rbx + 0x10], xmm0
mov qword [rbx + 0x20], rax
xor r9d, r9d
mov dword [rbx + 0x28], eax
lea edx, [rax + 1]
movzx ecx, word [r15]
lea r8d, [rax + 6]
call qword [sym.imp.WS2_32.dll_WSASocketW]
mov qword [rbx + 8], rax
cmp rax, 0xffffffffffffffff
jne 0x40711a
lea rdx, str.socket_create_failed
mov ecx, 0xff
sub rdx, rdi
lea rax, [rcx + 0x7ffffeff]
test rax, rax
je 0x407106
movzx eax, word [rdx + rdi]
test ax, ax
je 0x407106
mov word [rdi], ax
add rdi, 2
sub rcx, 1
jne 0x4070e4
test rcx, rcx
lea rax, [rdi - 2]
cmovne rax, rdi
mov word [rax], r13w
jmp 0x407068
test r14, r14
je 0x407127
xorps xmm0, xmm0
movups xmmword [rsp + 0x50], xmm0
mov rcx, qword [rbx + 8]
lea r9, [rsp + 0x40]
mov r14d, 0xffff
mov dword [rsp + 0x40], 0x100000
mov edx, r14d
mov dword [rsp + 0x44], 0x40000
mov r8d, 0x1002
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rcx, qword [rbx + 8]
lea r9, [rsp + 0x44]
mov r8d, 0x1001
mov dword [rsp + 0x20], 4
mov edx, r14d
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rax, qword [rbx]
mov dl, 1
mov rcx, rbx
call qword [rax + 0x30]
mov rcx, qword [rbx + 8]
lea r8, [rbp + 0x1a0]
mov r14d, 0x8004667e
mov dword [rbp + 0x1a0], 1
mov edx, r14d
call qword [sym.imp.WS2_32.dll_ioctlsocket]
cmp word [r15], 0x17
mov eax, 0x1c
mov rcx, qword [rbx + 8]
mov rdx, r15
mov qword [rsp + 0x30], r13
mov qword [rsp + 0x28], r13
lea r8d, [rax - 0xc]
mov qword [rsp + 0x20], r13
cmove r8d, eax
xor r9d, r9d
call qword [sym.imp.WS2_32.dll_WSAConnect]
cmp eax, 0xffffffff
jne 0x4072e6
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x407248
mov rax, qword [rbx + 8]
lea r8, [rsp + 0x60]
mov qword [rsp + 0x68], rax
xor r9d, r9d
mov eax, 0x10624dd3
mov dword [rsp + 0x60], 1
mul esi
xor ecx, ecx
shr edx, 6
imul eax, edx, 0x3e8
mov dword [rsp + 0x48], edx
xor edx, edx
sub esi, eax
imul eax, esi, 0x3e8
mov dword [rsp + 0x4c], eax
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x4072e6
mov rax, qword [rbx + 8]
cmp rax, 0xffffffffffffffff
je 0x407273
mov rcx, qword [rbx + 8]
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 rdx, str.connect_failed
xorps xmm0, xmm0
mov ecx, 0xff
movups xmmword [rbx + 0x10], xmm0
mov qword [rbx + 0x20], rax
sub rdx, rdi
mov dword [rbx + 0x28], eax
lea rax, [rcx + 0x7ffffeff]
test rax, rax
je 0x4072b4
movzx eax, word [rdx + rdi]
test ax, ax
je 0x4072b4
mov word [rdi], ax
add rdi, 2
sub rcx, 1
jne 0x407292
test rcx, rcx
lea rax, [rdi - 2]
lea r9, [rbx + 0x2c]
cmovne rax, rdi
lea r8, str._s_direct_connect_failed
lea rdx, str.Socket
lea rcx, [0x004e0f30]
mov word [rax], r13w
call fcn.004573dc
jmp 0x407068
mov rcx, qword [rbx + 8]
lea r8, [rbp + 0x1a0]
mov edx, r14d
mov dword [rbp + 0x1a0], r13d
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov al, 1
lea r11, [rsp + 0x270]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop rdi
pop rbp
ret