Function at 0x485f43
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1fc
mov eax, dword [0x5385d0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
xor esi, esi
mov word [ebp - 0x68], si
lea edi, [ebp - 0x66]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x18e
stosw word es:[edi], ax
lea eax, [ebp - 0x1f6]
push esi
push eax
mov ebx, ecx
mov word [ebp - 0x1f8], si
call fcn.004b7880
push 0x4f
lea eax, [ebp - 0x57]
push esi
push eax
mov byte [ebp - 0x1f9], 0
mov byte [ebp - 0x58], 0
call fcn.004b7880
add esp, 0x18
mov edx, ebx
call fcn.0047ebaf
test eax, eax
je 0x485fb1
or eax, 0xffffffff
jmp 0x486193
push 0x10
lea eax, [ebp - 0x68]
push esi
push eax
call fcn.004b7880
add esp, 0xc
lea eax, [ebp - 0x1f8]
push eax
push 0x101
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x485fe2
push str.:7:TelNetConnect___FAILED:_WSAStartup___FAILED:_Winsock_could_not_be_initialized.
call fcn.00418e96
pop ecx
jmp 0x485fa9
mov eax, dword [ebp + 8]
cmp eax, esi
jle 0x485ff2
cmp eax, 0x10000
jl 0x48600b
cmp eax, esi
je 0x486003
push eax
push ebx
push str.:7:TelNetConnect___was_given_an_invalid_port:__s___d
call fcn.0041936e
add esp, 0xc
call fcn.00483ea0
mov dword [ebp + 8], eax
push 0x50
lea eax, [ebp - 0x58]
push eax
push ebx
call fcn.00444279
add esp, 0xc
test eax, eax
jne 0x486073
push ebx
call sub.WSOCK32.dll_gethostbyname
mov esi, eax
test esi, esi
jne 0x48603d
call sub.WSOCK32.dll_WSACleanup
push ebx
push str.:7:TelNetConnect___FAILED:_ResolveHostNameToIP__s__FAILED:_gethostbyname___also_failed.
call fcn.00418e96
pop ecx
jmp 0x485fdf
push ebx
push ebx
push str.:7:TelNetConnect___encountered_a_problem:__ResolveHostNameToIP__s__FAILED__but_gethostbyname__s__SUCCEEDED_
call fcn.0041936e
add esp, 0xc
cmp word [esi + 0xa], 4
jle 0x486059
mov word [esi + 0xa], 4
movsx eax, word [esi + 0xa]
push eax
mov eax, dword [esi + 0xc]
push dword [eax]
lea eax, [ebp - 0x64]
push eax
call fcn.004b7150
add esp, 0xc
xor esi, esi
jmp 0x48607e
lea ecx, [ebp - 0x58]
call fcn.004441a1
mov dword [ebp - 0x64], eax
push 6
push 1
push 2
call sub.WSOCK32.dll_socket
mov edi, eax
cmp edi, 0xffffffff
jne 0x48609f
call sub.WSOCK32.dll_WSACleanup
push str.:7:TelNetConnect___FAILED:_socket___returned_INVALID_SOCKET
jmp 0x485fda
push dword [ebp + 8]
call sub.WSOCK32.dll_htons
mov word [ebp - 0x66], ax
push 0x10
lea eax, [ebp - 0x68]
push eax
push edi
mov word [ebp - 0x68], 2
call sub.WSOCK32.dll_connect
test eax, eax
je 0x48610a
push edi
call sub.WSOCK32.dll_closesocket
call sub.WSOCK32.dll_WSACleanup
push str.127.0.0.1
push ebx
call fcn.0047f83d
test eax, eax
pop ecx
pop ecx
jne 0x485fa9
inc dword [0x647144]
cmp dword [0x647144], 3
jg 0x485fa9
push dword [ebp + 8]
push ebx
push str.:7:TelNetConnect___FAILED:_connect___FAILED_to_establish_the_connection:__s:_d
call fcn.00418e96
add esp, 0xc
jmp 0x485fa9
push 1
lea eax, [ebp - 0x1f9]
push eax
push 8
push 0xffff
push edi
mov byte [ebp - 0x1f9], 1
call sub.WSOCK32.dll_setsockopt
cmp dword [ebp + 0xc], esi
je 0x486191
push esi
push 0xfb
mov esi, 0xff
push esi
push edi
call fcn.004861d6
push 1
lea ebx, [esi - 2]
push ebx
push esi
push edi
call fcn.004861d6
push 0
push ebx
push esi
push edi
call fcn.004861d6
push 0x1f
push 0xfb
push esi
push edi
call fcn.004861d6
add esp, 0x40
push 0x1f
push 0xfa
push esi
push edi
call fcn.004861d6
push 0
push 0x50
push 0
push edi
call fcn.004861d6
push 0xf0
push esi
push 0x19
push edi
call fcn.004861d6
add esp, 0x30
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004b7140
leave
ret