Function at 0x495c90
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe8
mov eax, dword [0x5c1334]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [ebp - 0xe8], eax
push esi
push edi
mov dword [ebp - 0xe4], 0
mov esi, dword [ebx]
mov dword [eax], 0xffffffff
mov eax, dword [edx + 4]
mov edi, dword [ebx]
mov dword [ebp - 0xd4], eax
mov eax, dword [ebx + 0x8c]
cmp eax, 2
mov dword [ebp - 0xd0], eax
mov eax, 0x11
mov dword [ebp - 0xe0], esi
je 0x495ced
mov eax, dword [edx + 0xc]
mov dword [ebp - 0xcc], eax
mov eax, dword [edx + 0x10]
mov dword [ebp - 0xc8], eax
cmp eax, 0x80
jbe 0x495d12
mov dword [ebp - 0xc8], 0x80
mov eax, 0x80
push eax
push dword [edx + 0x18]
lea eax, [ebp - 0xc4]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [edi + 0x1f8]
add esp, 0xc
test eax, eax
je 0x495d45
lea ecx, [ebp - 0xd4]
push ecx
push 0
push dword [edi + 0x1fc]
call eax
add esp, 0xc
jmp 0x495d5d
push dword [ebp - 0xcc]
push dword [ebp - 0xd0]
push dword [ebp - 0xd4]
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x4960f6
movzx eax, word [ebp - 0xc4]
sub eax, 2
jne 0x4960c2
lea eax, [ebp - 0x38]
mov ecx, 2
push 0x2e
push eax
lea edx, [ebp - 0xc0]
call fcn.004ade60
add esp, 8
test eax, eax
je 0x4960c2
push dword [ebp - 0xc2]
call dword [sym.imp.WS2_32.dll_ntohs]
lea eax, [ebp - 0x38]
push eax
push str.__Trying__s..._n
push esi
call fcn.00494040
add esp, 0xc
cmp dword [esi + 0x39c], 0
je 0x495e24
mov eax, dword [ebx]
mov dword [ebp - 0xd8], eax
push 4
mov eax, dword [eax + 0x39c]
mov dword [ebp - 0xdc], eax
lea eax, [ebp - 0xdc]
push eax
push 1
push 6
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x495e11
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, ebx
call fcn.00490350
push eax
push str.Could_not_set_TCP_NODELAY:__s_n
push dword [ebp - 0xd8]
call fcn.00494040
add esp, 0xc
jmp 0x495e24
push str.TCP_NODELAY_set_n
push dword [ebp - 0xd8]
call fcn.00494040
add esp, 8
mov ecx, edi
call fcn.00495b80
cmp dword [esi + 0x4a4], 0
je 0x495ede
push 4
lea eax, [ebp - 0xd8]
mov dword [ebp - 0xd8], 1
push eax
push 8
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x495e6e
push edi
push str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
push esi
call fcn.00494040
add esp, 0xc
jmp 0x495ede
mov eax, dword [esi + 0x4a8]
and eax, 0x7fffffff
mov dword [ebp - 0x44], 1
imul eax, eax, 0x3e8
push 0
push 0
mov dword [ebp - 0x40], eax
mov eax, dword [esi + 0x4ac]
and eax, 0x7fffffff
imul eax, eax, 0x3e8
mov dword [ebp - 0xd8], eax
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0xdc]
push eax
push 0
push 0
push 0xc
lea eax, [ebp - 0x44]
push eax
push 0x98000004
push edi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x495ede
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
push str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
push esi
call fcn.00494040
add esp, 0x10
mov eax, dword [esi + 0x1f0]
test eax, eax
je 0x495f05
push 0
push edi
push dword [esi + 0x1f4]
call eax
add esp, 0xc
cmp eax, 2
jne 0x495f48
mov dword [ebp - 0xe4], 1
push dword [ebp - 0xd4]
mov edx, edi
mov ecx, ebx
call fcn.00494dc0
mov esi, eax
add esp, 4
mov dword [ebp - 0xd8], esi
test esi, esi
je 0x495f6b
mov edx, edi
mov ecx, ebx
call fcn.00496410
cmp esi, 1
je 0x4960f6
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
test eax, eax
je 0x495f05
mov edx, edi
mov ecx, ebx
call fcn.00496410
mov eax, 0x2a
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0xdc]
mov dword [ebp - 0xdc], 1
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, eax
mov eax, 0x10624dd3
mul esi
shr edx, 6
imul ecx, edx, 0x3e8
mov dword [ebx + 0x2b0], edx
sub esi, ecx
imul eax, esi, 0x3e8
cmp dword [ebx + 0x2b8], 1
mov esi, dword [ebp - 0xe0]
mov dword [ebx + 0x2b4], eax
jle 0x495fd0
mov edx, dword [ebx + 0x2bc]
mov ecx, esi
call fcn.00493ad0
cmp dword [ebp - 0xe4], 0
jne 0x4960a7
cmp dword [ebx + 0x8c], 1
jne 0x4960a7
push dword [ebp - 0xc8]
lea eax, [ebp - 0xc4]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x496088
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0xdc], eax
cmp eax, 0xb
je 0x49606d
cmp eax, 0x2732
jle 0x496026
cmp eax, 0x2734
jle 0x49606d
mov edx, eax
mov ecx, ebx
call fcn.00490350
push eax
lea eax, [ebp - 0x38]
push eax
push str.Immediate_connect_fail_for__s:__s_n
push esi
call fcn.00494040
mov eax, dword [ebp - 0xdc]
add esp, 0x10
mov edx, edi
mov dword [esi + 0x863c], eax
mov ecx, ebx
call fcn.00496410
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xe8]
xor eax, eax
mov dword [ecx], edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xe8]
mov eax, dword [ebp - 0xd8]
mov dword [ecx], edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xe8]
xor eax, eax
mov dword [ecx], edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00528802
mov esp, ebp
pop ebp
ret
mov byte [ebp - 0x38], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, ebx
mov edx, esi
call fcn.00490350
push eax
push esi
mov esi, dword [ebp - 0xe0]
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push esi
call fcn.00494100
add esp, 0x10
mov edx, edi
mov ecx, ebx
call fcn.00496410
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00528802
mov esp, ebp
pop ebp
ret