Function at 0x140013244
Capabilities:
Connect socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
mov rax, rsp
mov qword [rax + 0x18], rbx
mov dword [rax + 0x20], r9d
mov dword [rax + 0x10], edx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x3e8]
sub rsp, 0x4b0
xor edi, edi
mov esi, r8d
mov rbx, rcx
test rcx, rcx
je 0x140013630
lea eax, [rdi + 2]
lea r12d, [rdi + 0x17]
bt r8d, 0x1c
jae 0x140013293
mov r13d, r12d
btr esi, 0x1c
jmp 0x140013296
mov r13d, eax
mov eax, 1
test esi, esi
mov ecx, r13d
cmove esi, eax
xor r8d, r8d
mov edx, esi
call qword [sym.imp.WSOCK32.DLL_socket]
mov r15, rax
cmp eax, 0xffffffff
je 0x140013630
cmp r13d, r12d
jne 0x14001331b
cmp dword [0x140d2dbd0], edi
je 0x140013627
lea r8, [rbp - 0x80]
mov rdx, rbx
mov ecx, r12d
call fcn.140012f24
test eax, eax
jg 0x140013312
lea r9, [rsp + 0x58]
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [0x140d2dbd8]
test rax, rax
jne 0x140013627
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx + 0x20]
movups xmm0, xmmword [rax + 8]
movdqu xmmword [rbp - 0x80], xmm0
call qword [0x140d2dbe0]
mov r12d, dword [rbp + 0x3f0]
jmp 0x140013358
mov rcx, rbx
call qword [sym.imp.WSOCK32.DLL_inet_addr]
or r14d, 0xffffffff
mov r12d, eax
cmp eax, r14d
jne 0x140013348
mov rcx, rbx
call qword [sym.imp.WSOCK32.DLL_gethostbyname]
test rax, rax
je 0x140013348
mov rax, qword [rax + 0x18]
mov rcx, qword [rax]
mov r12d, dword [rcx]
xor eax, eax
cmp r12d, r14d
setne al
test eax, eax
je 0x140013627
mov r14d, dword [rbp + 0x418]
mov rbx, qword [rbp + 0x410]
test r14d, r14d
jne 0x140013375
test rbx, rbx
je 0x1400133ef
cmp byte [rbx], dil
je 0x1400133ef
xor edx, edx
lea rcx, [rsp + 0x40]
lea r8d, [rdx + 0x10]
call sub.msvcrt.dll_memset
mov eax, 2
mov word [rsp + 0x40], ax
test r14d, r14d
je 0x1400133a3
movzx ecx, r14w
call qword [sym.imp.WSOCK32.DLL_htons]
mov word [rsp + 0x42], ax
test rbx, rbx
je 0x1400133cf
cmp byte [rbx], dil
je 0x1400133cf
mov rcx, rbx
call fcn.140018090
mov rcx, rax
mov rbx, rax
call qword [sym.imp.WSOCK32.DLL_inet_addr]
mov rcx, rbx
mov dword [rsp + 0x44], eax
call fcn.1400180e0
jmp 0x1400133d3
and dword [rsp + 0x44], edi
lea rdx, [rsp + 0x40]
movsxd rcx, r15d
mov r8d, 0x10
call qword [sym.imp.WSOCK32.DLL_bind]
test eax, eax
jne 0x140013627
mov eax, 1
cmp esi, eax
jne 0x1400135cb
lea r14d, [rax + 0x16]
xor edx, edx
cmp r13d, r14d
jne 0x140013438
lea r8d, [rax + 0x1b]
lea rcx, [rsp + 0x60]
call sub.msvcrt.dll_memset
mov ecx, dword [rbp + 0x3f8]
mov word [rsp + 0x60], r14w
call qword [sym.imp.WSOCK32.DLL_htons]
mov word [rsp + 0x62], ax
movups xmm0, xmmword [rbp - 0x80]
movdqu xmmword [rsp + 0x68], xmm0
jmp 0x140013468
lea rcx, [rsp + 0x30]
mov r8d, 0x10
call sub.msvcrt.dll_memset
mov ecx, dword [rbp + 0x3f8]
mov eax, 2
mov word [rsp + 0x30], ax
call qword [sym.imp.WSOCK32.DLL_htons]
mov dword [rsp + 0x34], r12d
mov word [rsp + 0x32], ax
mov esi, dword [rbp + 0x408]
movsxd rbx, r15d
mov rcx, rbx
test esi, esi
jle 0x140013564
lea r8, [rbp + 0x3f0]
mov r12d, 1
mov edx, 0x8004667e
mov dword [rbp + 0x3f0], r12d
call qword [sym.imp.WSOCK32.DLL_ioctlsocket]
test eax, eax
jne 0x140013627
mov rcx, rbx
cmp r13d, r14d
jne 0x1400134b7
lea r8d, [r12 + 0x1b]
lea rdx, [rsp + 0x60]
jmp 0x1400134c2
mov r8d, 0x10
lea rdx, [rsp + 0x30]
call qword [sym.imp.WSOCK32.DLL_connect]
cmp eax, 0xffffffff
jne 0x140013627
mov eax, 0x10624dd3
lea ecx, [r15 + 1]
lea r9, [rbp + 0x1a0]
lea r8, [rbp - 0x70]
mov qword [rbp - 0x68], rbx
mov dword [rbp - 0x70], r12d
imul esi
sar edx, 6
mov qword [rbp + 0x1a8], rbx
mov dword [rbp + 0x1a0], r12d
mov eax, edx
shr eax, 0x1f
add edx, eax
lea rax, [rsp + 0x50]
mov dword [rsp + 0x50], edx
mov qword [rsp + 0x20], rax
imul edx, edx, 0x3e8
sub esi, edx
xor edx, edx
imul esi, esi, 0x3e8
mov dword [rsp + 0x54], esi
call qword [sym.imp.WSOCK32.DLL_select]
cmp eax, r12d
jne 0x140013546
lea rdx, [rbp - 0x70]
mov rcx, rbx
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
cmovne rdi, r12
and dword [rbp + 0x3f0], 0
lea r8, [rbp + 0x3f0]
mov edx, 0x8004667e
mov rcx, rbx
call qword [sym.imp.WSOCK32.DLL_ioctlsocket]
jmp 0x140013599
cmp r13d, r14d
jne 0x140013576
mov r8d, 0x1c
lea rdx, [rsp + 0x60]
jmp 0x140013581
mov r8d, 0x10
lea rdx, [rsp + 0x30]
call qword [sym.imp.WSOCK32.DLL_connect]
cmp eax, 0xffffffff
je 0x140013627
mov r12d, 1
mov edi, r12d
test rdi, rdi
je 0x140013627
mov rcx, qword [0x140d2da50]
xor edx, edx
lea r8d, [rdx + 0x18]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
je 0x140013627
and qword [rax + 0x10], 0
mov dword [rax], r12d
mov qword [rax + 8], rbx
jmp 0x140013630
movsxd rbx, r15d
lea r8, [rbp + 0x3f0]
mov edx, 0x8004667e
mov rcx, rbx
mov dword [rbp + 0x3f0], eax
call qword [sym.imp.WSOCK32.DLL_ioctlsocket]
test eax, eax
jne 0x140013627
mov rcx, qword [0x140d2da50]
lea r8d, [rax + 0x38]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
je 0x140013627
and qword [rdi + 0x10], 0
mov eax, 2
mov qword [rdi + 0x18], rbx
mov dword [rdi], eax
mov eax, dword [rbp + 0x3f8]
mov dword [rdi + 4], r12d
mov dword [rdi + 8], eax
jmp 0x140013630
movsxd rcx, r15d
call qword [sym.imp.WSOCK32.DLL_closesocket]
mov rax, rdi
mov rbx, qword [rsp + 0x500]
add rsp, 0x4b0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret