Function at 0x40ed50
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb8
mov eax, dword [0x4a5c78]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebx + eax*4 + 0x12c]
mov dword [ebx + eax*4 + 0x12c], 0xffffffff
mov dword [ebp - 0xb4], ecx
mov dword [ebp - 0xac], edx
mov dword [ecx], 0
test eax, eax
je 0x40eda8
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 7
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468861
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x38]
push esi
mov esi, dword [eax + 0x1c]
push edi
mov dword [ebp - 0xa4], esi
test esi, esi
je 0x40f222
mov edi, edi
mov eax, dword [esi + 0xc]
mov edi, dword [ebx]
mov ecx, dword [esi + 4]
mov edx, dword [ebx + 0x70]
mov dword [ebp - 0x8c], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x98], edi
mov dword [ebp - 0x94], ecx
mov dword [ebp - 0x90], edx
mov dword [ebp - 0x88], eax
cmp eax, 0x80
jbe 0x40edfe
mov eax, 0x80
mov dword [ebp - 0x88], eax
mov ecx, dword [esi + 0x18]
push eax
push ecx
lea edx, [ebp - 0x84]
push edx
call fcn.00467c80
mov eax, dword [ebp - 0xb4]
mov dword [eax], 0
mov eax, dword [edi + 0x174]
add esp, 0xc
test eax, eax
je 0x40ee3f
mov edx, dword [edi + 0x178]
lea ecx, [ebp - 0x94]
push ecx
push 0
push edx
call eax
add esp, 0xc
jmp 0x40ee5a
mov eax, dword [ebp - 0x8c]
mov ecx, dword [ebp - 0x90]
mov edx, dword [ebp - 0x94]
push eax
push ecx
push edx
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x9c], eax
cmp eax, 0xffffffff
je 0x40f155
movzx eax, word [ebp - 0x84]
sub eax, 2
lea esi, [ebx + 0x9a]
jne 0x40efd1
push 0x2e
push esi
lea eax, [ebp - 0x80]
push eax
push 2
call fcn.00420f20
add esp, 0x10
test eax, eax
je 0x40efd1
mov ecx, dword [ebp - 0x82]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, ax
lea eax, [ebx + 0x3c]
mov dword [ebx + 0xc8], edx
mov edi, eax
mov ecx, 0xb
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x98]
push eax
push str.__Trying__s...
push ecx
movsw word es:[edi], word [esi]
call fcn.0042a430
mov edi, dword [ebx]
add edi, 0x86a4
mov ecx, 0xb
lea esi, [ebx + 0x9a]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, dword [ebx]
add edi, 0x86d8
lea esi, [ebx + 0xcc]
mov ecx, 0xb
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edx, dword [ebx]
mov eax, dword [ebx + 0xc8]
mov edi, dword [ebp - 0x98]
mov esi, dword [ebp - 0x9c]
mov dword [edx + 0x86d4], eax
mov ecx, dword [ebx]
mov edx, dword [ebx + 0xfc]
add esp, 0xc
mov dword [ecx + 0x8708], edx
cmp dword [edi + 0x308], 0
je 0x40ef3f
mov edx, esi
mov edi, ebx
call fcn.0040e710
mov edi, dword [ebp - 0x98]
lea eax, [ebp - 0xb8]
push eax
lea ecx, [ebp - 0xa0]
push ecx
push 0x1001
push 0xffff
push esi
mov dword [ebp - 0xb0], 0x4020
mov dword [ebp - 0xa0], 0
mov dword [ebp - 0xb8], 4
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x40ef8e
mov edx, dword [ebp - 0xa0]
cmp edx, dword [ebp - 0xb0]
jg 0x40efa8
push 4
lea eax, [ebp - 0xb0]
push eax
push 0x1001
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov eax, dword [edi + 0x16c]
test eax, eax
je 0x40f00f
mov ecx, dword [edi + 0x170]
push 0
push esi
push ecx
call eax
add esp, 0xc
mov dword [ebp - 0xa8], eax
test eax, eax
je 0x40f00f
push esi
jmp 0x40f149
mov byte [esi], 0
mov dword [ebx + 0xc8], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push ebx
mov dword [ebp - 0xa8], esi
call fcn.0042e3c0
push eax
push esi
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push edi
call fcn.0042a4b0
mov eax, dword [ebp - 0x9c]
add esp, 0x18
push eax
jmp 0x40f149
mov ecx, dword [ebp - 0x94]
push esi
push ebx
call fcn.0040e090
mov edi, eax
add esp, 8
test edi, edi
jne 0x40f186
push 1
push esi
call fcn.004264e0
add esp, 8
cmp dword [ebx + 0x70], 1
jne 0x40f0b7
mov edx, dword [ebp - 0x88]
push edx
lea eax, [ebp - 0x84]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
mov edi, eax
mov dword [ebp - 0xa0], edi
cmp edi, 0xffffffff
jne 0x40f0e7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
mov dword [ebp - 0xa8], edi
cmp edi, 0xb
je 0x40f0c9
cmp edi, 0x2732
jle 0x40f083
cmp edi, 0x2734
jle 0x40f0c9
push edi
push ebx
call fcn.0042e3c0
mov ecx, dword [ebp - 0x98]
push eax
lea eax, [ebx + 0x3c]
push eax
push str.Failed_to_connect_to__s:__s
push ecx
call fcn.0042a4b0
mov edx, dword [ebp - 0x98]
mov dword [edx + 0x855c], edi
mov edi, dword [ebp - 0xa0]
add esp, 0x18
jmp 0x40f0ff
mov dword [ebp - 0xa0], 0
mov edi, dword [ebp - 0xa0]
jmp 0x40f0ff
push ebx
xor eax, eax
mov edi, esi
call fcn.0040e020
add esp, 4
mov dword [ebp - 0xa0], eax
cmp eax, 3
je 0x40f19f
mov edi, eax
cmp edi, 1
jne 0x40f0ff
mov eax, dword [ebp - 0x98]
cmp dword [eax + 0x510], 2
je 0x40f1ee
push esi
lea esi, [ebp - 0xa8]
call fcn.0040e400
add esp, 4
test edi, edi
jne 0x40f16b
test eax, eax
jne 0x40f1bb
mov eax, dword [ebp - 0xa8]
mov esi, dword [ebp - 0x98]
push eax
push ebx
mov dword [esi + 0x855c], eax
call fcn.0042e3c0
push eax
push 0x48e2bc
push esi
call fcn.0042a430
add esp, 0x14
mov edx, dword [ebp - 0x9c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, dword [ebp - 0xa4]
mov esi, dword [esi + 0x1c]
mov dword [ebp - 0xa4], esi
test esi, esi
je 0x40f21c
jmp 0x40edc0
cmp edi, 1
jne 0x40f11a
mov ecx, dword [ebp - 0x98]
push str.Timeout_n
push ecx
call fcn.0042a430
add esp, 8
jmp 0x40f142
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468861
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
mov eax, 0x2a
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468861
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x98]
mov eax, dword [ebp - 0xb4]
push str.connected_n
push ecx
mov dword [eax], 1
call fcn.0042a430
mov edx, dword [ebp - 0x9c]
push edx
push ebx
call fcn.0040e510
mov esi, dword [ebp - 0x9c]
add esp, 0x10
mov ecx, dword [ebp - 0xac]
mov eax, dword [ebp - 0xa4]
mov dword [ebx + 0x12c], esi
push ecx
mov dword [ebx + 0x38], eax
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00468861
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0xac]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
mov eax, 7
pop esi
call fcn.00468861
mov esp, ebp
pop ebp
ret