Function at 0x541f00
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, 0x200
mov eax, dword [0x6fb448]
xor eax, ebp
mov dword [ebp - 8], eax
mov word [ebp - 0x200], 0
xor eax, eax
mov dword [ebp - 0x1fe], eax
mov dword [ebp - 0x1fa], eax
mov dword [ebp - 0x1f6], eax
mov word [ebp - 0x1f2], ax
mov word [ebp - 0x198], 0
push 0x18e
push 0
lea ecx, [ebp - 0x196]
push ecx
call fcn.005b02a0
add esp, 0xc
mov dword [ebp - 0x19c], 0
mov byte [ebp - 1], 0
mov byte [ebp - 0x1f0], 0
push 0x4f
push 0
lea edx, [ebp - 0x1ef]
push edx
call fcn.005b02a0
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
call fcn.00401389
add esp, 4
test eax, eax
je 0x541f96
or eax, 0xffffffff
jmp 0x54228f
push 0x10
push 0
lea ecx, [ebp - 0x200]
push ecx
call fcn.005b02a0
add esp, 0xc
lea edx, [ebp - 0x198]
push edx
push 0x101
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x541fd3
push str.:7:TelNetConnect___FAILED:_WSAStartup___FAILED:_Winsock_could_not_be_initialized.
call fcn.00401014
add esp, 4
or eax, 0xffffffff
jmp 0x54228f
cmp dword [ebp + 0xc], 0
jle 0x541fe2
cmp dword [ebp + 0xc], 0x10000
jl 0x542005
cmp dword [ebp + 0xc], 0
je 0x541ffd
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.:7:TelNetConnect___was_given_an_invalid_port:__s___d
call fcn.004018ca
add esp, 0xc
call fcn.005422a0
mov dword [ebp + 0xc], eax
push 0x50
lea edx, [ebp - 0x1f0]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00402734
add esp, 0xc
test eax, eax
jne 0x5420b2
mov ecx, dword [ebp + 8]
push ecx
call sub.WSOCK32.dll_gethostbyname
mov dword [ebp - 0x1a0], eax
cmp dword [ebp - 0x1a0], 0
jne 0x54205a
call sub.WSOCK32.dll_WSACleanup
mov edx, dword [ebp + 8]
push edx
push str.:7:TelNetConnect___FAILED:_ResolveHostNameToIP__s__FAILED:_gethostbyname___also_failed.
call fcn.00401014
add esp, 8
or eax, 0xffffffff
jmp 0x54228f
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.:7:TelNetConnect___encountered_a_problem:__ResolveHostNameToIP__s__FAILED__but_gethostbyname__s__SUCCEEDED_
call fcn.004018ca
add esp, 0xc
mov edx, dword [ebp - 0x1a0]
movsx eax, word [edx + 0xa]
cmp eax, 4
jle 0x54208a
mov ecx, dword [ebp - 0x1a0]
mov word [ecx + 0xa], 4
mov edx, dword [ebp - 0x1a0]
movsx eax, word [edx + 0xa]
push eax
mov ecx, dword [ebp - 0x1a0]
mov edx, dword [ecx + 0xc]
mov eax, dword [edx]
push eax
lea ecx, [ebp - 0x1fc]
push ecx
call fcn.005b62f0
add esp, 0xc
jmp 0x5420c7
lea edx, [ebp - 0x1f0]
push edx
call fcn.00402491
add esp, 4
mov dword [ebp - 0x1fc], eax
push 6
push 1
push 2
call sub.WSOCK32.dll_socket
mov dword [ebp - 0x19c], eax
cmp dword [ebp - 0x19c], 0xffffffff
jne 0x5420fb
call sub.WSOCK32.dll_WSACleanup
push str.:7:TelNetConnect___FAILED:_socket___returned_INVALID_SOCKET
call fcn.00401014
add esp, 4
or eax, 0xffffffff
jmp 0x54228f
mov ax, word [ebp + 0xc]
push eax
call sub.WSOCK32.dll_htons
mov word [ebp - 0x1fe], ax
mov word [ebp - 0x200], 2
push 0x10
lea ecx, [ebp - 0x200]
push ecx
mov edx, dword [ebp - 0x19c]
push edx
call sub.WSOCK32.dll_connect
test eax, eax
je 0x5421ab
mov eax, dword [ebp - 0x19c]
push eax
call sub.WSOCK32.dll_closesocket
call sub.WSOCK32.dll_WSACleanup
push str.127.0.0.1
mov ecx, dword [ebp + 8]
push ecx
call fcn.00401041
add esp, 8
test eax, eax
jne 0x5421a3
push str.10.210.27.10
mov edx, dword [ebp + 8]
push edx
call fcn.00401041
add esp, 8
test eax, eax
je 0x54216d
xor eax, eax
jne 0x5421a3
mov ecx, dword [0x83114c]
add ecx, 1
mov dword [0x83114c], ecx
cmp dword [0x83114c], 3
jg 0x5421a3
mov edx, 1
test edx, edx
je 0x5421a3
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.:7:TelNetConnect___FAILED:_connect___FAILED_to_establish_the_connection:__s:_d
call fcn.00401014
add esp, 0xc
or eax, 0xffffffff
jmp 0x54228f
mov byte [ebp - 1], 1
push 1
lea edx, [ebp - 1]
push edx
push 8
push 0xffff
mov eax, dword [ebp - 0x19c]
push eax
call sub.WSOCK32.dll_setsockopt
cmp dword [ebp + 0x10], 0
je 0x542289
push 0
push 0xfb
push 0xff
mov ecx, dword [ebp - 0x19c]
push ecx
call fcn.00542300
add esp, 0x10
push 1
push 0xfd
push 0xff
mov edx, dword [ebp - 0x19c]
push edx
call fcn.00542300
add esp, 0x10
push 0
push 0xfd
push 0xff
mov eax, dword [ebp - 0x19c]
push eax
call fcn.00542300
add esp, 0x10
push 0x1f
push 0xfb
push 0xff
mov ecx, dword [ebp - 0x19c]
push ecx
call fcn.00542300
add esp, 0x10
push 0x1f
push 0xfa
push 0xff
mov edx, dword [ebp - 0x19c]
push edx
call fcn.00542300
add esp, 0x10
push 0
push 0x50
push 0
mov eax, dword [ebp - 0x19c]
push eax
call fcn.00542300
add esp, 0x10
push pe_nt_image_headers32
push 0xff
push 0x19
mov ecx, dword [ebp - 0x19c]
push ecx
call fcn.00542300
add esp, 0x10
mov eax, dword [ebp - 0x19c]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.005b0290
mov esp, ebp
pop ebp
ret