Function at 0x140124570
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0xf0
mov rax, qword [0x140232230]
xor rax, rsp
mov qword [rsp + 0xd0], rax
mov rbp, qword [rcx]
mov rsi, qword [rsp + 0x150]
mov qword [r9], 0xffffffffffffffff
mov eax, dword [rdx + 4]
xor ebx, ebx
mov r13, r9
mov dword [rsp + 0x40], eax
mov eax, dword [rcx + 0x94]
mov dword [rsp + 0x24], r8d
mov r14, rdx
mov rdi, rcx
mov qword [rsp + 0x30], rsi
mov r12d, ebx
mov dword [rsp + 0x44], eax
cmp eax, 2
jne 0x1401245de
mov dword [rsp + 0x48], select
jmp 0x1401245e5
mov eax, dword [rdx + 0xc]
mov dword [rsp + 0x48], eax
mov eax, dword [rdx + 0x10]
mov rdx, qword [rdx + 0x20]
mov ecx, 0x80
cmp eax, ecx
cmova eax, ecx
lea rcx, [rsp + 0x50]
mov r8d, eax
mov dword [rsp + 0x4c], eax
call fcn.1401669c0
mov dword [rsi], ebx
mov rax, qword [rbp + 0x218]
test rax, rax
je 0x140124627
mov rcx, qword [rbp + 0x220]
lea r8, [rsp + 0x40]
xor edx, edx
call rax
jmp 0x14012463a
mov r8d, dword [rsp + 0x48]
mov edx, dword [rsp + 0x44]
mov ecx, dword [rsp + 0x40]
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x14012464a
xor eax, eax
jmp 0x1401249a0
cmp word [rsp + 0x50], 2
mov qword [rsp + 0xe8], r15
lea r15, [rdi + 0xde]
jne 0x140124949
lea rcx, [rsp + 0x54]
mov r8d, 0x2e
mov rdx, r15
call fcn.14013eba0
test rax, rax
je 0x140124949
movzx ecx, word [rsp + 0x52]
call qword [sym.imp.WS2_32.dll_ntohs]
lea r8, [rdi + 0x60]
lea rdx, str.__Trying__s...
movzx eax, ax
mov rcx, rbp
mov dword [rdi + 0x10c], eax
mov rax, qword [r15]
mov qword [rdi + 0x60], rax
mov rax, qword [r15 + 8]
mov qword [rdi + 0x68], rax
mov rax, qword [r15 + 0x10]
mov qword [rdi + 0x70], rax
mov rax, qword [r15 + 0x18]
mov qword [rdi + 0x78], rax
mov rax, qword [r15 + 0x20]
mov qword [rdi + 0x80], rax
mov eax, dword [r15 + 0x28]
mov dword [rdi + 0x88], eax
movzx eax, word [r15 + 0x2c]
mov word [rdi + 0x8c], ax
call fcn.140125a80
mov rcx, rdi
call fcn.140123df0
mov r9, qword [rbp + 0x1c0]
test r9, r9
je 0x14012470e
mov r8d, dword [r14 + 0x10]
mov rdx, qword [r14 + 0x20]
mov rcx, qword [rbp + 0x258]
call r9
cmp dword [rbp + 0x44c], ebx
je 0x140124721
mov rdx, rsi
mov rcx, rdi
call fcn.140124460
mov rcx, rsi
call fcn.1401244f0
mov rax, qword [rbp + 0x208]
test rax, rax
je 0x14012475b
mov rcx, qword [rbp + 0x210]
xor r8d, r8d
mov rdx, rsi
call rax
mov dword [rsp + 0x20], eax
cmp eax, 2
jne 0x140124753
lea r12d, [rax - 1]
jmp 0x14012475b
test eax, eax
jne 0x14012486d
mov r8d, dword [rsp + 0x40]
mov rdx, rsi
mov rcx, rdi
call fcn.140123900
mov r14d, eax
test eax, eax
je 0x14012479e
mov r8, qword [rdi + 0x38]
test r8, r8
je 0x14012478d
mov rcx, qword [rdi + 0x40]
mov rdx, rsi
call r8
mov eax, r14d
jmp 0x140124998
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov eax, r14d
jmp 0x140124998
lea r8, [rsp + 0x28]
mov edx, 0x8004667e
mov rcx, rsi
mov dword [rsp + 0x28], 1
call qword [sym.imp.WS2_32.dll_ioctlsocket]
test r12d, r12d
jne 0x1401248cd
cmp dword [rdi + 0x94], 1
jne 0x1401248b3
mov r8d, dword [rsp + 0x4c]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_connect]
mov ebx, eax
call fcn.14012f9c0
cmp dword [rdi + 0x2a0], 1
mov qword [rdi + 0x298], rax
jle 0x140124807
mov edx, dword [rdi + 0x2a4]
mov rcx, rbp
call fcn.14011d530
cmp ebx, 0xffffffff
jne 0x14012489c
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14d, eax
mov dword [rsp + 0x20], eax
cmp eax, 0xb
je 0x140124856
lea ecx, [rax - 0x2733]
cmp ecx, 1
jbe 0x140124856
mov edx, eax
mov rcx, rdi
call fcn.14013f050
lea r8, [rdi + 0x60]
lea rdx, str.Failed_to_connect_to__s:__s
mov r9, rax
mov rcx, rbp
call fcn.140125b60
mov dword [rbp + 0x87ac], r14d
jmp 0x1401248b8
mov r8d, dword [rsp + 0x24]
mov rdx, rsi
mov rcx, rdi
call fcn.140123840
mov ebx, eax
cmp eax, 3
jne 0x14012489c
mov rax, qword [rdi + 0x38]
test rax, rax
je 0x140124889
mov rcx, qword [rdi + 0x40]
mov rdx, rsi
call rax
mov eax, 0x2a
jmp 0x140124998
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov eax, 0x2a
jmp 0x140124998
cmp ebx, 1
jne 0x1401248b8
cmp dword [rbp + 0x728], 2
jne 0x1401248b8
mov qword [r13], rsi
jmp 0x140124996
test r12d, r12d
jne 0x1401248cd
lea rdx, [rsp + 0x20]
mov rcx, rsi
call fcn.140123c20
test ebx, ebx
jne 0x1401248fb
test eax, eax
je 0x140124911
mov rax, qword [rsp + 0x30]
lea rdx, str.connected_n
mov rcx, rbp
mov dword [rax], 1
call fcn.140125a80
mov rdx, rsi
mov rcx, rdi
call fcn.140123f60
mov qword [r13], rsi
jmp 0x140124996
cmp ebx, 1
jne 0x140124911
lea rdx, str.Timeout_n
mov rcx, rbp
call fcn.140125a80
jmp 0x140124935
mov edx, dword [rsp + 0x20]
mov rcx, rdi
mov dword [rbp + 0x87ac], edx
call fcn.14013f050
lea rdx, [0x1401e59ec]
mov r8, rax
mov rcx, rbp
call fcn.140125a80
mov rax, qword [rdi + 0x38]
test rax, rax
je 0x14012498d
mov rcx, qword [rdi + 0x40]
mov rdx, rsi
call rax
jmp 0x140124996
mov byte [r15], bl
mov dword [rdi + 0x10c], ebx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov rcx, rdi
mov ebx, eax
call fcn.14013f050
lea rdx, str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov r8d, ebx
mov r9, rax
mov rcx, rbp
call fcn.140125b60
mov rax, qword [rdi + 0x38]
test rax, rax
je 0x14012498d
mov rcx, qword [rdi + 0x40]
mov rdx, rsi
call rax
jmp 0x140124996
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
mov r15, qword [rsp + 0xe8]
mov rcx, qword [rsp + 0xd0]
xor rcx, rsp
call fcn.140166980
add rsp, 0xf0
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret