Function at 0x140001060
Capabilities:
Connect socket
Get socket status
Initialize winsock library
Set socket configuration
Terminate process

Disassembly:
push rbp
push rdi
push r15
lea rbp, [rsp - 0x350]
sub rsp, 0x450
mov rax, qword [0x140006008]
xor rax, rsp
mov qword [rbp + 0x330], rax
cmp dword [0x140006624], 0
mov rdi, rcx
movzx r15d, word [0x14000662c]
mov dword [rsp + 0x38], 1
mov dword [rsp + 0x3c], 0x20000
mov dword [rsp + 0x40], 1
jne 0x1400010f7
mov ecx, 0x202
lea rdx, [rbp + 0x160]
call qword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x1400010ed
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.WSAStartup_failed__n
call fcn.140001010
mov ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_ExitProcess]
mov dword [0x140006624], 1
movzx eax, word [rdi]
mov qword [rsp + 0x448], r12
mov qword [rsp + 0x440], r14
mov r14d, reloc.WS2_32.dll_recv
cmp ax, 2
jne 0x14000111b
mov r12d, r14d
jmp 0x14000112b
cmp ax, 0x17
jne 0x140001440
mov r12d, 0x1c
movzx ecx, r15w
call qword [sym.imp.WS2_32.dll_htons]
mov edx, 1
mov qword [rsp + 0x480], rsi
mov word [rdi + 2], ax
movzx ecx, word [rdi]
lea r8d, [rdx + 5]
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
cmp eax, 0xffffffff
jne 0x14000116f
lea rcx, str.socket__
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
mov eax, 0xffffffff
jmp 0x1400011c3
mov qword [rsp + 0x478], rbx
lea r9, [rsp + 0x38]
movsxd rbx, esi
mov edx, 0xffff
mov rcx, rbx
mov dword [rsp + 0x20], 4
mov r8d, 4
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x1400011f6
lea rcx, str.setsockopt__
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_closesocket]
mov eax, 0xffffffff
mov rbx, qword [rsp + 0x478]
mov rsi, qword [rsp + 0x480]
mov r12, qword [rsp + 0x448]
mov r14, qword [rsp + 0x440]
mov rcx, qword [rbp + 0x330]
xor rcx, rsp
call fcn.140002630
add rsp, 0x450
pop r15
pop rdi
pop rbp
ret
lea r8, [rsp + 0x40]
mov edx, 0x8004667e
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov r8d, r12d
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x1400012ac
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x140001310
lea rax, [rsp + 0x48]
mov qword [rsp + 0x58], rbx
lea ecx, [rsi + 1]
mov qword [rsp + 0x20], rax
xor r9d, r9d
mov dword [rsp + 0x50], 1
lea r8, [rsp + 0x50]
mov qword [rsp + 0x48], 5
xor edx, edx
xor r12d, r12d
call qword [sym.imp.WS2_32.dll_select]
cmp eax, 1
jne 0x140001310
lea rax, [rsp + 0x30]
mov dword [rsp + 0x30], 4
lea r9, [rsp + 0x34]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov r8d, 0x1007
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_getsockopt]
cmp dword [rsp + 0x34], r12d
jne 0x140001304
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], r12d
test esi, esi
jns 0x1400013a2
cmp dword [0x140006620], 2
jl 0x1400011b6
cmp dword [0x140006624], 0
jne 0x140001325
mov ecx, 0x202
lea rdx, [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x14000131b
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.WSAStartup_failed__n
call fcn.140001010
mov ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_ExitProcess]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rsp + 0x34]
mov dword [rax], ecx
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_closesocket]
jmp 0x1400012b4
mov dword [0x140006624], 1
movzx eax, word [rdi]
mov dword [rsp + 0x30], 0x30
cmp ax, 2
je 0x140001342
cmp ax, 0x17
jne 0x140001364
mov r14d, 0x1c
lea rax, [rsp + 0x30]
xor r8d, r8d
lea r9, [rbp + 0x300]
mov qword [rsp + 0x20], rax
mov edx, r14d
mov rcx, rdi
call qword [sym.imp.WS2_32.dll_WSAAddressToStringA]
jmp 0x140001370
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x66
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea r9, [rbp + 0x300]
mov dword [rsp + 0x20], r15d
mov rcx, rax
lea r8, str.socket_connect_addr
lea rdx, str._s:_Could_not_connect_to__s_port__d_n
call fcn.140001010
jmp 0x1400011b6
mov edx, 6
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x38]
mov rcx, rbx
lea r8d, [rdx - 5]
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x1400013d3
lea rcx, str.Could_not_set_TCP_NODELAY_on_socket
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
lea r9, [rsp + 0x3c]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 0x1001
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x140001406
lea rcx, str.Could_not_set_send_buffer_for_socket
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
lea r9, [rsp + 0x3c]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 0x1002
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x140001439
lea rcx, str.Could_not_set_receive_buffer_for_socket
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
mov eax, esi
jmp 0x1400011bb
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.ERROR:_Unsupported_address_family
call fcn.140001010
mov eax, 0xffffffff
jmp 0x1400011cb