Function at 0x140040130
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push rbp
push rbx
push rsi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x240]
sub rsp, 0x340
mov rax, qword [0x1400a1080]
xor rax, rsp
mov qword [rbp + 0x230], rax
mov r15, qword [rcx]
xor r12b, r12b
movsxd rax, r8d
mov r14, rcx
lea r13, [rcx + rax*8]
mov qword [r13 + 0x4d0], 0xffffffffffffffff
mov eax, dword [rdx + 4]
mov rbx, qword [rcx]
mov ecx, dword [rcx + 0x32c]
mov dword [rsp + 0x70], eax
xor eax, eax
cmp ecx, 3
setne al
inc eax
mov dword [rsp + 0x74], eax
mov eax, reloc.WS2_32.dll_recvfrom
cmp ecx, 3
jne 0x1400401a2
mov eax, dword [rdx + 0xc]
mov dword [rsp + 0x78], eax
mov eax, dword [rdx + 0x10]
mov dword [rsp + 0x7c], eax
cmp eax, 0x80
jbe 0x1400401c1
mov dword [rsp + 0x7c], 0x80
mov eax, 0x80
mov rdx, qword [rdx + 0x20]
lea rcx, [rbp - 0x80]
mov r8d, eax
call sub.VCRUNTIME140.dll_memcpy
cmp qword [rbx + 0x738], 0
je 0x140040208
mov dl, 1
mov rcx, rbx
call fcn.14002dd10
mov rcx, qword [rbx + 0x740]
lea r8, [rsp + 0x70]
xor edx, edx
call qword [rbx + 0x738]
xor edx, edx
mov rcx, rbx
mov rsi, rax
call fcn.14002dd10
jmp 0x14004021e
mov r8d, dword [rsp + 0x78]
mov edx, dword [rsp + 0x74]
mov ecx, dword [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
mov qword [rsp + 0x398], rdi
cmp rsi, 0xffffffffffffffff
je 0x1400406bf
cmp dword [r14 + 0x32c], 5
jne 0x140040247
mov edx, 1
mov rcx, rsi
call fcn.14004c490
mov ecx, dword [r14 + 0x328]
test ecx, ecx
je 0x140040260
mov eax, dword [rbp - 0x68]
cmp dword [rsp + 0x70], 0x17
cmove eax, ecx
mov dword [rbp - 0x68], eax
movzx eax, word [rbp - 0x80]
xor ebx, ebx
cmp eax, 2
je 0x14004027c
cmp eax, 0x17
jne 0x14004066a
lea rdx, [rbp - 0x78]
mov ecx, eax
jmp 0x140040285
lea rdx, [rbp - 0x7c]
mov ecx, 2
mov r9d, reloc.WLDAP32.dll_Ordinal_46
lea r8, [rbp]
call fcn.1400686b0
test rax, rax
je 0x14004066a
movzx ecx, word [rbp - 0x7e]
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r9d, ax
lea r8, [rbp]
lea rdx, str.__Trying__s:_ld..._n
mov rcx, r15
call fcn.14003de90
mov eax, dword [rsp + 0x70]
cmp eax, 2
je 0x1400402cc
cmp eax, 0x17
jne 0x14004033e
cmp dword [rsp + 0x74], 1
jne 0x14004033e
mov dil, 1
cmp byte [r15 + 0xf23], bl
je 0x140040341
mov r12, qword [r14]
lea r9, [rsp + 0x54]
mov edx, 6
mov dword [rsp + 0x54], 1
mov rcx, rsi
mov dword [rsp + 0x20], 4
lea r8d, [rdx - 5]
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140040339
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rbp + 0x130]
mov ecx, eax
call fcn.140027590
mov r8, rax
lea rdx, str.Could_not_set_TCP_NODELAY:__s_n
mov rcx, r12
call fcn.14003de90
xor r12b, r12b
jmp 0x140040341
xor dil, dil
mov eax, dword [0x1400a9280]
mov dword [rsp + 0x54], 0x4020
mov dword [rsp + 0x50], ebx
mov dword [rsp + 0x58], 4
test eax, eax
jne 0x14004038d
xor edx, edx
lea ecx, [rax + 6]
lea r9d, [rax + 3]
lea r8d, [rax + 2]
call fcn.140040bd0
test al, al
je 0x140040381
mov dword [0x1400a9280], 2
jmp 0x1400403e4
mov dword [0x1400a9280], 1
jmp 0x140040392
cmp eax, 2
je 0x1400403e4
lea rax, [rsp + 0x58]
mov edx, 0xffff
lea r9, [rsp + 0x50]
mov qword [rsp + 0x20], rax
mov r8d, 0x1001
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x1400403c3
mov eax, dword [rsp + 0x54]
cmp dword [rsp + 0x50], eax
jg 0x1400403e4
lea r9, [rsp + 0x54]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 0x1001
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
test dil, dil
je 0x1400404cf
cmp byte [r15 + 0xf2c], bl
je 0x1400404cf
lea r9, [rsp + 0x50]
mov dword [rsp + 0x50], 1
mov edx, 0xffff
mov dword [rsp + 0x20], 4
mov r8d, 8
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x14004043e
mov r8, rsi
lea rdx, str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
mov rcx, r15
call fcn.14003de90
jmp 0x1400404cf
mov ecx, dword [r15 + 0xe8c]
mov dword [rsp + 0x60], 1
call fcn.14002b9e0
imul ecx, eax, 0x3e8
mov dword [rsp + 0x50], ecx
mov dword [rsp + 0x64], ecx
mov ecx, dword [r15 + 0xe90]
call fcn.14002b9e0
imul ecx, eax, 0x3e8
lea r8, [rsp + 0x60]
lea rax, [rsp + 0x58]
mov edx, 0x98000004
mov dword [rsp + 0x50], ecx
mov dword [rsp + 0x68], ecx
xor ecx, ecx
mov qword [rsp + 0x40], rcx
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], ecx
lea r9d, [rcx + 0xc]
mov qword [rsp + 0x20], rcx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x1400404cf
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, esi
lea rdx, str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
mov r9d, eax
mov rcx, r15
call fcn.14003de90
cmp qword [r15 + 0x728], rbx
je 0x14004050a
mov dl, 1
mov rcx, r15
call fcn.14002dd10
mov rcx, qword [r15 + 0x730]
xor r8d, r8d
mov rdx, rsi
call qword [r15 + 0x728]
xor edx, edx
mov rcx, r15
mov edi, eax
call fcn.14002dd10
cmp edi, 2
jne 0x140040555
mov r12b, 1
mov eax, dword [rsp + 0x70]
cmp eax, 2
je 0x140040518
cmp eax, 0x17
jne 0x14004056e
lea rcx, [rbp - 0x80]
call fcn.140068620
mov r8d, dword [rsp + 0x70]
mov r9d, eax
mov rdx, rsi
mov rcx, r14
call fcn.14003fa80
mov ebx, eax
test eax, eax
je 0x14004056e
mov rdx, rsi
mov rcx, r14
call fcn.14003e970
cmp ebx, 1
je 0x1400406bf
mov eax, ebx
jmp 0x1400406c4
test edi, edi
je 0x14004050a
mov rdx, rsi
mov rcx, r14
call fcn.14003e970
mov eax, Ordinal_45
jmp 0x1400406c4
mov edx, 1
mov rcx, rsi
call fcn.14004c490
lea rcx, [rsp + 0x60]
call fcn.140044fb0
cmp dword [r14 + 0x688], 1
movups xmm0, xmmword [rax]
movups xmmword [r14 + 0x678], xmm0
jle 0x1400405af
mov rdx, qword [r14 + 0x690]
mov r8d, 3
mov rcx, r15
call fcn.14002d270
test r12b, r12b
jne 0x14004065f
cmp dword [r14 + 0x32c], 4
je 0x14004065f
cmp byte [r14 + 0x66f], r12b
jne 0x1400405f8
mov r8d, dword [rsp + 0x7c]
lea rdx, [rbp - 0x80]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x1400405f8
test ebx, ebx
jne 0x14004065b
mov qword [r13 + 0x4d0], rsi
mov eax, ebx
jmp 0x1400406c4
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
cmp eax, 0xb
je 0x140040652
lea ecx, [rax - 0x2733]
cmp ecx, 1
jbe 0x140040652
mov r8d, 0x100
lea rdx, [rbp + 0x30]
mov ecx, eax
call fcn.140027590
mov r9, rax
lea r8, [rbp]
lea rdx, str.Immediate_connect_fail_for__s:__s_n
mov rcx, r15
call fcn.14003de90
mov rdx, rsi
mov dword [r15 + 0x11b0], ebx
mov rcx, r14
call fcn.14003e970
mov ebx, 7
mov eax, ebx
jmp 0x1400406c4
xor ebx, ebx
mov qword [r13 + 0x4d0], rsi
mov eax, ebx
jmp 0x1400406c4
mov qword [r13 + 0x4d0], rsi
xor eax, eax
jmp 0x1400406c4
mov byte [rbp], bl
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x273f
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ebx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov r8d, 0x100
lea rdx, [rbp + 0x30]
mov ecx, ebx
mov rdi, rax
call fcn.140027590
mov r8d, dword [rdi]
lea rdx, str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov r9, rax
mov rcx, r15
call fcn.14003dd10
mov rdx, rsi
mov rcx, r14
call fcn.14003e970
xor eax, eax
jmp 0x1400406c4
mov eax, 7
mov rdi, qword [rsp + 0x398]
mov rcx, qword [rbp + 0x230]
xor rcx, rsp
call fcn.140076fa0
add rsp, 0x340
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbx
pop rbp
ret