Function at 0x10017049
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb8
mov eax, dword [0x1013a420]
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.10017572
pop ecx
pop ecx
test eax, eax
je 0x100170b6
xor eax, eax
jmp 0x10017395
lea eax, [ebx + 0xcc]
lea esi, [ebx + 0x9e]
push eax
mov edx, esi
lea ecx, [ebp - 0x8c]
call fcn.10016c46
pop ecx
test eax, eax
jne 0x10017101
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, ebx
mov edx, esi
call fcn.10030e33
push eax
push esi
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push edi
call fcn.10018208
mov edi, dword [ebp - 0xb0]
add esp, 0x10
jmp 0x10017386
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.10018194
add esp, 0xc
mov ecx, ebx
call fcn.10016bf9
mov edi, dword [ebp - 0xb0]
xor eax, eax
cmp dword [esi + 0x314], eax
je 0x10017142
mov edx, edi
mov ecx, ebx
call fcn.10016f92
mov ecx, edi
call fcn.10016fee
cmp dword [esi + 0x40c], 0
je 0x10017186
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 0x10017186
push edi
push str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
push esi
call fcn.10018194
add esp, 0xc
mov eax, dword [esi + 0x16c]
test eax, eax
je 0x100171b7
push 0
push edi
push dword [esi + 0x170]
call eax
add esp, 0xc
mov dword [ebp - 0xa4], eax
cmp eax, 2
jne 0x100172a3
mov dword [ebp - 0xac], 1
push dword [ebp - 0x9c]
mov edx, edi
mov ecx, ebx
call fcn.1001686a
pop ecx
test eax, eax
jne 0x10017380
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 0x100172ba
cmp dword [ebx + 0x74], 1
jne 0x100172ba
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 0x1001722e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0xa4], eax
call fcn.1002f4e0
cmp dword [ebx + 0x230], 1
mov dword [ebx + 0x228], eax
mov dword [ebx + 0x22c], edx
jle 0x10017255
mov edx, dword [ebx + 0x234]
mov ecx, esi
call fcn.1001cfaf
mov eax, dword [ebp - 0xa0]
cmp eax, 0xffffffff
jne 0x100172dc
mov eax, dword [ebp - 0xa4]
cmp eax, 0xb
je 0x100172c4
cmp eax, 0x2732
jle 0x10017279
cmp eax, 0x2734
jle 0x100172c4
mov edx, eax
mov ecx, ebx
call fcn.10030e33
push eax
lea eax, [ebx + 0x40]
push eax
push str.Failed_to_connect_to__s:__s
push esi
call fcn.10018208
mov edx, dword [ebp - 0xa4]
add esp, 0x10
mov dword [esi + 0x858c], edx
jmp 0x100172fd
test eax, eax
je 0x100171b7
mov dword [ebp - 0xa0], 0x2a
jmp 0x10017386
xor eax, eax
mov dword [ebp - 0xa0], eax
jmp 0x1001725b
push dword [ebp + 8]
mov edx, edi
mov ecx, ebx
call fcn.100167f3
mov dword [ebp - 0xa0], eax
pop ecx
cmp eax, 3
je 0x100172ab
cmp eax, 1
jne 0x100172f7
cmp dword [esi + 0x540], 2
jne 0x100172f7
mov eax, dword [ebp - 0xb4]
mov dword [eax], edi
jmp 0x100170af
mov edx, dword [ebp - 0xa4]
mov ecx, dword [ebp - 0xac]
test ecx, ecx
jne 0x1001731c
lea edx, [ebp - 0xa4]
mov ecx, edi
call fcn.10016b94
mov edx, dword [ebp - 0xa4]
mov ecx, eax
mov eax, dword [ebp - 0xa0]
test eax, eax
jne 0x1001734e
test ecx, ecx
je 0x10017362
mov eax, dword [ebp - 0xb8]
push str.connected_n
push esi
mov dword [eax], 1
call fcn.10018194
pop ecx
pop ecx
mov edx, edi
mov ecx, ebx
call fcn.10016c93
jmp 0x100172ea
cmp eax, 1
jne 0x10017362
push str.Timeout_n
push esi
call fcn.10018194
pop ecx
pop ecx
jmp 0x1001737e
mov ecx, ebx
mov dword [esi + 0x858c], edx
call fcn.10030e33
push eax
push 0x1012fbd0
push esi
call fcn.10018194
add esp, 0xc
xor eax, eax
mov dword [ebp - 0xa0], eax
mov edx, edi
mov ecx, ebx
call fcn.1001753e
mov eax, dword [ebp - 0xa0]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1003890f
mov esp, ebp
pop ebp
ret