Function at 0x5117dc
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb8
mov eax, dword [0x5ca1c8]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, ecx
xor eax, eax
mov ecx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x10]
push edi
mov edi, dword [ebx]
or dword [ecx], 0xffffffff
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xac], eax
mov dword [esi], eax
lea eax, [ebp - 0xb0]
push eax
lea eax, [ebp - 0x9c]
mov dword [ebp - 0xb4], ecx
push eax
mov ecx, ebx
mov dword [ebp - 0xb8], esi
mov dword [ebp - 0xa8], edi
call fcn.00511d06
pop ecx
pop ecx
test eax, eax
je 0x511849
xor eax, eax
jmp 0x511b28
lea eax, [ebx + 0xcc]
lea esi, [ebx + 0x9e]
push eax
mov edx, esi
lea ecx, [ebp - 0x8c]
call fcn.005113c4
pop ecx
test eax, eax
jne 0x511894
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, ebx
mov edx, esi
call fcn.0052af26
push eax
push esi
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push edi
call fcn.005129bc
mov edi, dword [ebp - 0xb0]
add esp, 0x10
jmp 0x511b19
push 0xb
lea eax, [ebx + 0x40]
pop ecx
mov edi, eax
rep movsd dword es:[edi], dword [esi]
push eax
push str.__Trying__s..._n
movsw word es:[edi], word [esi]
mov esi, dword [ebp - 0xa8]
push esi
call fcn.00512948
add esp, 0xc
mov ecx, ebx
call fcn.00511377
mov edi, dword [ebp - 0xb0]
xor eax, eax
cmp dword [esi + 0x314], eax
je 0x5118d5
mov edx, edi
mov ecx, ebx
call fcn.00511725
mov ecx, edi
call fcn.00511781
cmp dword [esi + 0x408], 0
je 0x511919
push 4
lea eax, [ebp - 0xa8]
mov dword [ebp - 0xa8], 1
push eax
push 8
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x511919
push edi
push str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
push esi
call fcn.00512948
add esp, 0xc
mov eax, dword [esi + 0x16c]
test eax, eax
je 0x51194a
push 0
push edi
push dword [esi + 0x170]
call eax
add esp, 0xc
mov dword [ebp - 0xa4], eax
cmp eax, 2
jne 0x511a36
mov dword [ebp - 0xac], 1
push dword [ebp - 0x9c]
mov edx, edi
mov ecx, ebx
call fcn.00510f6e
pop ecx
test eax, eax
jne 0x511b13
lea eax, [ebp - 0xa8]
mov dword [ebp - 0xa8], 1
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [ebp - 0xac], 0
jne 0x511a4d
cmp dword [ebx + 0x74], 1
jne 0x511a4d
push dword [ebp - 0x90]
lea eax, [ebp - 0x8c]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0xa0], eax
cmp eax, 0xffffffff
jne 0x5119c1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0xa4], eax
call fcn.0051b03d
cmp dword [ebx + 0x22c], 1
mov dword [ebx + 0x224], eax
mov dword [ebx + 0x228], edx
jle 0x5119e8
mov edx, dword [ebx + 0x230]
mov ecx, esi
call fcn.0050c199
mov eax, dword [ebp - 0xa0]
cmp eax, 0xffffffff
jne 0x511a6f
mov eax, dword [ebp - 0xa4]
cmp eax, 0xb
je 0x511a57
cmp eax, 0x2732
jle 0x511a0c
cmp eax, 0x2734
jle 0x511a57
mov edx, eax
mov ecx, ebx
call fcn.0052af26
push eax
lea eax, [ebx + 0x40]
push eax
push str.Failed_to_connect_to__s:__s
push esi
call fcn.005129bc
mov edx, dword [ebp - 0xa4]
add esp, 0x10
mov dword [esi + 0x858c], edx
jmp 0x511a90
test eax, eax
je 0x51194a
mov dword [ebp - 0xa0], 0x2a
jmp 0x511b19
xor eax, eax
mov dword [ebp - 0xa0], eax
jmp 0x5119ee
push dword [ebp + 8]
mov edx, edi
mov ecx, ebx
call fcn.00510ef7
mov dword [ebp - 0xa0], eax
pop ecx
cmp eax, 3
je 0x511a3e
cmp eax, 1
jne 0x511a8a
cmp dword [esi + 0x540], 2
jne 0x511a8a
mov eax, dword [ebp - 0xb4]
mov dword [eax], edi
jmp 0x511842
mov edx, dword [ebp - 0xa4]
mov ecx, dword [ebp - 0xac]
test ecx, ecx
jne 0x511aaf
lea edx, [ebp - 0xa4]
mov ecx, edi
call fcn.0051129a
mov edx, dword [ebp - 0xa4]
mov ecx, eax
mov eax, dword [ebp - 0xa0]
test eax, eax
jne 0x511ae1
test ecx, ecx
je 0x511af5
mov eax, dword [ebp - 0xb8]
push str.connected_n
push esi
mov dword [eax], 1
call fcn.00512948
pop ecx
pop ecx
mov edx, edi
mov ecx, ebx
call fcn.00511411
jmp 0x511a7d
cmp eax, 1
jne 0x511af5
push str.Timeout_n
push esi
call fcn.00512948
pop ecx
pop ecx
jmp 0x511b11
mov ecx, ebx
mov dword [esi + 0x858c], edx
call fcn.0052af26
push eax
push 0x59dd0c
push esi
call fcn.00512948
add esp, 0xc
xor eax, eax
mov dword [ebp - 0xa0], eax
mov edx, edi
mov ecx, ebx
call fcn.00511cd2
mov eax, dword [ebp - 0xa0]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055fedc
mov esp, ebp
pop ebp
ret