Function at 0x140050660
Capabilities:
Connect socket

Disassembly:
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbp
push rbx
sub rsp, 0x78
mov r15d, r9d
mov r14, r8
mov r13, rdx
mov r12, rcx
mov edi, dword [rsp + 0xe0]
xor ebx, ebx
test r12, r12
mov ebp, dword [rsp + 0xf0]
mov rax, qword [0x140079508]
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x58], 0
mov dword [rsp + 0x64], 0
je 0x140050d97
mov rsi, r12
test r13, r13
je 0x140050dac
mov dword [rsp + 0x60], 4
imul r8d, dword [rsi + 0x2c20], 0x3e8
mov edx, dword [rsi + 0x2c20]
xor eax, eax
test ebp, ebp
mov ebp, 1
mov ecx, reloc.WS2_32.dll_ntohs
jne 0x1400506ec
mov ebp, 0
cmp edx, 0
cmove ebp, eax
cmove r8d, ecx
mov dword [rsp + 0x50], r8d
mov rax, qword [rsi + 0x1aa0]
test rax, rax
je 0x14005088d
mov rdx, qword [rax + 0x28]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x30]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x38]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x40]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x48]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x50]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x58]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x60]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x68]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x70]
test rdx, rdx
je 0x14005088d
mov rdx, qword [rax + 0x78]
test rdx, rdx
je 0x14005088d
mov rax, qword [rax + 0x80]
test rax, rax
je 0x14005088d
mov rcx, rsi
mov edx, 0x60
call fcn.14000afa0
test rax, rax
je 0x140050dcc
mov qword [rsp + 0x58], rax
pxor xmm0, xmm0
movaps xmmword [rsp + 0x40], xmm0
mov eax, 2
mov word [rsp + 0x40], ax
mov ecx, r15d
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x42], ax
lea rax, [rsp + 0xe8]
test edi, edi
jne 0x1400507f5
mov r14, rax
mov edx, dword [r14]
mov dword [rsp + 0x44], edx
lea r8, [rsp + 0x40]
mov rax, qword [rsi + 0x1aa0]
mov rdx, qword [rsi + 0x1a98]
mov rcx, rsi
mov r9d, 0x10
call qword [rax + 0x80]
mov rdx, qword [rsp + 0x58]
mov dword [rdx], eax
mov rax, qword [rsp + 0x58]
mov dword [rax + 8], 1
mov rdx, qword [rsp + 0x58]
mov ecx, dword [rdx]
test ecx, ecx
jl 0x140050ad3
mov dword [rdx + 4], r15d
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov rcx, qword [rsp + 0x58]
add rcx, 0xc
lea rdx, [0x140063c00]
mov r8, rax
call qword [sym.imp.MSVCR80.dll_sprintf]
mov rax, qword [rsp + 0x58]
mov qword [r13], rax
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
xor eax, eax
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
lea rdx, [rsp + 0x58]
mov rcx, r12
call fcn.140050346
test eax, eax
jne 0x140050dec
mov rax, qword [rsp + 0x58]
mov qword [r13], rax
pxor xmm0, xmm0
movaps xmmword [rsp + 0x40], xmm0
mov eax, 2
mov word [rsp + 0x40], ax
mov ecx, r15d
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x42], ax
lea rax, [rsp + 0xe8]
test edi, edi
je 0x1400508db
mov rax, r14
mov edx, dword [rax]
mov dword [rsp + 0x44], edx
mov rax, qword [rsp + 0x58]
mov dword [rax + 4], r15d
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov rcx, qword [rsp + 0x58]
add rcx, 0xc
lea rdx, [0x140063c00]
mov r8, rax
call qword [sym.imp.MSVCR80.dll_sprintf]
mov rax, qword [rsi + 0x1aa0]
test rax, rax
je 0x140050980
mov rdx, qword [rax + 0x28]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x30]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x38]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x40]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x48]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x50]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x58]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x60]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x68]
test rdx, rdx
je 0x140050980
mov rdx, qword [rax + 0x70]
test rdx, rdx
je 0x140050980
mov rax, qword [rax + 0x78]
test rax, rax
jne 0x140050d02
test ebp, ebp
je 0x1400509a0
mov rdx, qword [rsp + 0x58]
mov rcx, rsi
mov r8d, 1
call fcn.140055552
cmp eax, 0xffffffff
je 0x140050cce
mov rax, qword [rsp + 0x58]
lea rdx, [rsp + 0x40]
movsxd rcx, dword [rax]
mov r8d, 0x10
call qword [sym.imp.orauts.dll_connect]
test eax, eax
jge 0x140050c22
test ebp, ebp
je 0x140050c13
call qword [sym.imp.orauts.dll_WSAGetLastError]
cmp eax, 0x2733
jl 0x1400509e1
cmp eax, 0x2734
jle 0x140050b2c
cmp eax, 0x2714
je 0x1400509ef
cmp eax, 0x2747
jne 0x140050a4e
add ebx, 1
cmp ebx, 3
jae 0x140050a4e
mov rdx, qword [rsp + 0x58]
test rdx, rdx
jne 0x140050b12
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov r10, qword [rsp + 0x58]
mov dword [rsp + 0x28], 0x19
mov rcx, r12
lea r8, str.Retry_connection_to_host_:__s_n
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x20], r10
mov r9d, 5
mov qword [rsp + 0x30], rax
mov edx, 0x1000000
call fcn.14001f070
jmp 0x1400506fb
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov rbx, qword [rsp + 0x58]
mov dword [rsp + 0x28], 0x19
mov rcx, r12
lea r8, str.CONNECT_ERROR_:_Socket__d_to_host_:__s_n
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x20], rbx
mov r9d, 5
mov qword [rsp + 0x30], rax
mov edx, 0x1000000
call fcn.14001f070
mov rdx, qword [rsp + 0x58]
mov ebp, 3
test rdx, rdx
je 0x140050ab6
mov rcx, rsi
call fcn.140050278
mov rdx, qword [rsp + 0x58]
mov rcx, rsi
call fcn.140050222
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
mov eax, ebp
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, r12
call fcn.14000adf4
mov edx, 0x7fffffff
mov rcx, r12
lea r8, str.sgslunnNewCtn:_Unable_to_create_communication_endpoint_n
xor r9d, r9d
call fcn.14001f070
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
mov eax, 2
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, rsi
call fcn.140050278
mov rdx, qword [rsp + 0x58]
mov rcx, rsi
call fcn.140050222
jmp 0x140050a05
mov r8d, dword [rsp + 0x50]
mov rdx, qword [rsp + 0x58]
mov rcx, rsi
call fcn.140050058
test eax, eax
jne 0x140050bca
mov rax, qword [rsp + 0x58]
lea rbx, [rsp + 0x60]
movsxd rcx, dword [rax]
mov edx, 0xffff
mov r8d, 0x1007
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x64]
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jl 0x140050bca
mov eax, dword [rsp + 0x64]
xor ebp, ebp
test eax, eax
jne 0x140050bca
mov rdx, qword [rsp + 0x58]
mov rcx, rsi
mov r8d, 2
call fcn.140055552
cmp eax, 0xffffffff
jne 0x140050ab6
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x28], 0
mov rcx, r12
lea r8, str.non_blocking_switch_failed_on__d_n
mov qword [rsp + 0x20], rax
mov edx, 0x1000000
mov r9d, 5
call fcn.14001f070
jmp 0x140050ab6
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov rbx, qword [rsp + 0x58]
mov dword [rsp + 0x28], 0x19
mov rcx, r12
lea r8, str.CONNECT_ERROR_:_Timeout_or_Error_on_Socket__d_to_host_:__s_n
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x20], rbx
mov r9d, 5
mov qword [rsp + 0x30], rax
mov edx, 0x1000000
call fcn.14001f070
jmp 0x140050a92
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
jmp 0x140050a58
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov rbx, qword [rsp + 0x58]
mov dword [rsp + 0x28], 0x19
mov rcx, r12
lea r8, str.sd__d_connected_to:__s_n
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x20], rbx
mov r9d, 5
mov qword [rsp + 0x30], rax
mov edx, 0x1000000
call fcn.14001f070
test ebp, ebp
je 0x140050c82
mov rdx, qword [rsp + 0x58]
mov rcx, rsi
mov r8d, 2
call fcn.140055552
cmp eax, 0xffffffff
je 0x140050c9f
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
xor eax, eax
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x28], 0
mov rcx, r12
lea r8, str.non_blocking_switch_failed_on__d_n
mov qword [rsp + 0x20], rax
mov edx, 0x1000000
mov r9d, 5
call fcn.14001f070
jmp 0x140050c82
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x28], 0
mov rcx, r12
lea r8, str.Setting_non_blocking_failed_on__d_n
mov qword [rsp + 0x20], rax
mov edx, 0x1000000
mov r9d, 5
call fcn.14001f070
xor ebp, ebp
jmp 0x1400509a0
mov rbx, qword [rsp + 0x58]
mov rdx, qword [rsi + 0x1a98]
mov r8d, dword [rbx]
lea r9, [rsp + 0x40]
mov rcx, rsi
mov dword [rsp + 0x20], shutdown
call rax
test eax, eax
jl 0x140050d88
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov rbx, qword [rsp + 0x58]
mov dword [rsp + 0x28], 0x19
mov rcx, r12
lea r8, str.sd__d_connected_to:__s_n
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x20], rbx
mov r9d, 5
mov qword [rsp + 0x30], rax
mov edx, 0x1000000
call fcn.14001f070
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
xor eax, eax
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, dword [rsp + 0x44]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
jmp 0x140050a58
mov dword [rsp + 0x60], 0
call fcn.140006c40
mov rsi, rax
jmp 0x1400506b5
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
mov eax, 3
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [rsp + 0x68]
call fcn.14005fbf0
mov eax, 5
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [rsp + 0x68]
mov ebx, eax
call fcn.14005fbf0
mov eax, ebx
add rsp, 0x78
pop rbx
pop rbp
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
ret