Function at 0x516d50
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x748526
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x899944]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0x14]
mov edi, dword [ebp + 0x18]
mov esi, ecx
cmp dword [esi + 0xc], 0x4901fb2a
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x8c], ecx
jne 0x516df3
movzx edx, byte [edi + 0xad]
push edx
push str.connect
push edi
lea ecx, [ebp - 0x98]
call fcn.00474f30
mov eax, dword [esi + 0xb4]
mov dword [ebp - 4], 0
cmp eax, 0xffffffff
jne 0x516dfa
mov dword [ebx + 0x24], 5
mov eax, dword [edi]
mov edx, dword [eax + 0x14]
push str.Cannot_connect__invalid_socket
mov ecx, edi
call edx
lea ecx, [ebp - 0x98]
mov dword [ebp - 4], 0xffffffff
call fcn.00474f80
xor al, al
jmp 0x51708c
mov ecx, dword [ebp - 0x88]
mov ecx, dword [ecx + 0xba0]
mov dword [ebp - 0x88], ecx
test ecx, ecx
jne 0x516e1a
mov dword [ebp - 0x88], 0x1499700
lea edx, [ebp - 0x9c]
push edx
push 0x8004667e
push eax
mov dword [ebp - 0x9c], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
call sub.KERNEL32.dll_GetTickCount
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x8c]
mov edx, dword [esi + 0xb4]
push eax
push ecx
push edx
call dword [sym.imp.WS2_32.dll_connect]
cmp dword [esi + 0xc], 0x4901fb2a
jne 0x516de1
test eax, eax
je 0x516f4f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x516fe7
cmp byte [edi + 0xad], 0
je 0x516ea0
mov eax, dword [edi]
mov edx, dword [eax + 0x18]
push str.Waiting_for_the_connect_to_complete...
mov ecx, edi
call edx
mov eax, dword [ebp - 0x88]
push eax
push str.connectTimeoutMs
mov ecx, edi
call fcn.00474a80
mov ecx, dword [ebp - 0x88]
push edi
push ebx
push 1
push 0
push ecx
mov ecx, esi
call fcn.005135a0
cmp dword [esi + 0xc], 0x4901fb2a
jne 0x516de1
test al, al
je 0x516fb1
mov ecx, dword [esi + 0xb4]
lea edx, [ebp - 0x8c]
push edx
lea eax, [ebp - 0x88]
push eax
push 0x1007
push 0xffff
push ecx
mov dword [ebp - 0x88], 0
mov dword [ebp - 0x8c], 4
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x516f41
cmp dword [ebp - 0x88], eax
je 0x516f4f
mov edx, dword [edi]
mov eax, dword [edx + 0x14]
push str.getsockopt_indicates_an_error.
mov ecx, edi
call eax
mov ecx, dword [ebp - 0x88]
push edi
push 0
push ecx
call fcn.005126e0
add esp, 0xc
mov ecx, esi
mov dword [ebx + 0x24], 7
call fcn.00513cb0
jmp 0x516de1
mov edx, dword [edi]
mov eax, dword [edx + 0x14]
push str.Failed_to_get_SO_ERROR_on_socket.
mov ecx, edi
call eax
cmp dword [esi + 0xc], 0x4901fb2a
jne 0x516de1
mov byte [esi + 0xb0], 1
mov byte [esi + 0xb2], 0
cmp byte [edi + 0xad], 0
je 0x51704f
lea ecx, [ebp - 0x84]
call fcn.0040ac30
cmp dword [esi + 0xb8], 2
mov byte [ebp - 4], 1
mov dword [ebp - 0x88], 0
push edi
jne 0x517005
lea edx, [ebp - 0x88]
push edx
lea eax, [ebp - 0x84]
push eax
mov ecx, esi
call fcn.005146f0
jmp 0x51701a
cmp byte [ebx + 0x11], 0
je 0x516fc0
mov dword [ebx + 0x24], 4
jmp 0x516fce
xor ecx, ecx
cmp byte [ebx + 0x10], cl
sete cl
add ecx, 6
mov dword [ebx + 0x24], ecx
push edi
push str.failedWaitToConnect
mov ecx, ebx
call fcn.004a7220
mov ecx, esi
call fcn.00513cb0
jmp 0x516de1
push edi
push ebx
push eax
mov dword [ebx + 0x24], 7
call fcn.005126e0
add esp, 0xc
mov ecx, esi
call fcn.00513cb0
jmp 0x516de1
lea ecx, [ebp - 0x88]
push ecx
lea edx, [ebp - 0x84]
push edx
mov ecx, esi
call fcn.00514810
lea eax, [ebp - 0x84]
push eax
push str.myIP
mov ecx, edi
call fcn.00474890
mov ecx, dword [ebp - 0x88]
push ecx
push str.myPort
mov ecx, edi
call fcn.00474a80
lea ecx, [ebp - 0x84]
mov byte [ebp - 4], 0
call fcn.0040acf0
push edi
lea ecx, [esi + 0x20]
call fcn.004a6970
push edi
lea ecx, [esi + 0x68]
call fcn.004a6970
cmp byte [edi + 0xad], 0
je 0x517078
mov edx, dword [edi]
mov eax, dword [edx + 0x18]
push str.socket_connect_successful.
mov ecx, edi
call eax
lea ecx, [ebp - 0x98]
mov dword [ebp - 4], 0xffffffff
call fcn.00474f80
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0070bb4c
mov esp, ebp
pop ebp
ret 0x14