Function at 0x508740
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5fc763
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x6baac0]
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 edi, ecx
cmp dword [edi + 0xd0], 0x4901fb2a
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0x14]
mov esi, dword [ebp + 0x18]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
je 0x508795
xor al, al
jmp 0x508906
movzx eax, byte [esi + 0xad]
lea ecx, [ebp - 0x28]
push eax
push str.connect
xorps xmm0, xmm0
mov dword [ebp - 0x20], 0
push esi
movq qword [ebp - 0x28], xmm0
call fcn.00430cf0
mov ecx, dword [edi + 0x294]
mov dword [ebp - 4], 0
cmp ecx, 0xffffffff
jne 0x5087e4
mov dword [ebx + 0x24], 5
mov ecx, esi
mov eax, dword [esi]
push str.Cannot_connect__invalid_socket
call dword [eax + 0x14]
jmp 0x5088fa
mov eax, dword [ebp - 0x14]
mov edx, 0x1499700
mov dword [ebp - 0x1c], 1
mov eax, dword [eax + 0xcb8]
test eax, eax
cmove eax, edx
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x1c]
push eax
push 0x8004667e
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
call sub.KERNEL32.dll_GetTickCount
push dword [ebp + 0x10]
push dword [ebp - 0x18]
push dword [edi + 0x294]
call dword [sym.imp.WS2_32.dll_connect]
cmp dword [edi + 0xd0], 0x4901fb2a
jne 0x5088fa
test eax, eax
je 0x508991
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x50897a
cmp byte [esi + 0xad], 0
je 0x508875
mov eax, dword [esi]
mov ecx, esi
push str.Waiting_for_the_connect_to_complete...
call dword [eax + 0x18]
push dword [ebp - 0x14]
mov ecx, esi
push str.connectTimeoutMs
call fcn.00431470
push esi
push ebx
push 1
push 0
push dword [ebp - 0x14]
mov ecx, edi
call fcn.0050c8d0
cmp dword [edi + 0xd0], 0x4901fb2a
jne 0x5088fa
test al, al
je 0x50893e
lea eax, [ebp - 0x18]
mov dword [ebp - 0x14], 0
push eax
lea eax, [ebp - 0x14]
mov dword [ebp - 0x18], 4
push eax
push 0x1007
push 0xffff
push dword [edi + 0x294]
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x508924
cmp dword [ebp - 0x14], eax
je 0x508991
mov eax, dword [esi]
mov ecx, esi
push str.getsockopt_indicates_an_error.
call dword [eax + 0x14]
push esi
push 0
push dword [ebp - 0x14]
call fcn.0050abb0
add esp, 0xc
mov dword [ebx + 0x24], 7
mov ecx, edi
call fcn.005098b0
xor bl, bl
lea ecx, [ebp - 0x28]
call fcn.00430db0
mov al, bl
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.005ebe04
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esi]
mov ecx, esi
push str.Failed_to_get_SO_ERROR_on_socket.
call dword [eax + 0x14]
cmp dword [edi + 0xd0], 0x4901fb2a
je 0x5089a1
jmp 0x5088fa
cmp byte [ebx + 0x11], 0
je 0x50895a
push esi
push str.failedWaitToConnect
mov ecx, ebx
mov dword [ebx + 0x24], 4
call fcn.004efde0
jmp 0x5088f3
xor eax, eax
mov ecx, ebx
cmp byte [ebx + 0x10], al
push esi
sete al
add eax, 6
push str.failedWaitToConnect
mov dword [ebx + 0x24], eax
call fcn.004efde0
jmp 0x5088f3
push esi
push ebx
push eax
mov dword [ebx + 0x24], 7
call fcn.0050abb0
add esp, 0xc
jmp 0x5088f3
cmp dword [edi + 0xd0], 0x4901fb2a
jne 0x5088fa
mov byte [edi + 0x290], 1
mov byte [edi + 0x292], 0
cmp byte [esi + 0xad], 0
je 0x508a35
push 0x74
lea eax, [ebp - 0x9c]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x9c]
call fcn.00420e20
cmp dword [edi + 0x298], 2
lea eax, [ebp - 0x14]
push esi
push eax
lea eax, [ebp - 0x9c]
mov byte [ebp - 4], 1
mov dword [ebp - 0x14], 0
mov ecx, edi
push eax
jne 0x5089ff
call fcn.005076c0
jmp 0x508a04
call fcn.005077e0
lea eax, [ebp - 0x9c]
mov ecx, esi
push eax
push str.myIP
call fcn.004317e0
push dword [ebp - 0x14]
mov ecx, esi
push str.myPort
call fcn.00431470
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 0
call fcn.00420e70
push esi
lea ecx, [edi + 0xe0]
call fcn.004e4510
push esi
lea ecx, [edi + 0x128]
call fcn.004e4510
cmp byte [esi + 0xad], 0
je 0x508a62
mov eax, dword [esi]
mov ecx, esi
push str.socket_connect_successful.
call dword [eax + 0x18]
mov bl, 1
jmp 0x5088fc