Jump to content

ExtraPuTTY using dll for Telnet,SSH,Rlogin


ahmed9100
 Share

Recommended Posts

ahmed9100

I think there are some small things that you have to control,

I see that you have saved the script on the desktop, but this way you should also have the directory telnet on desctop as well. Is it there?.

As BrewManNH highlighted, you should remove the semicolon in front of the parameter Telnet_Redir=1.

So in summary:
1) create a new directory, and save the script there
2) inside this new directory you must also create the directory telnet.
3) The directory telnet, should contain the files of "Telnet Console". These files are contained in telnet-2.0_static.zip. download this file and extract all files in the folder telnet.
the files are these:

00README.AVS
BETA6.TXT
BUGS.TXT
changes.txt
KEYS.CFG
LICENSE.TXT
options.txt
README.TXT
TELNET.EXE
TELNET.ICO
TELNET.INI

Here you found the file TELNET.INI that you need to edit and set the parameter Telnet_Redir=1 without the semicolon.

in this way telnet must function properly.

please do these checks and try again the script
. At least it should display a msgbox with the output of the telnet local command 'help'.

I use it without problems, so it must be also for you :)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

What's the terminal emulation mode for the telnet console? What terminal emulation mode do you need for the linux server? It looks like you're talking to the server, but the server's setting and your telnet session aren't using the same emulation mode. If you don't know what mode you're using, or the server needs, you'll need to find that out. Normally you'd use ANSI mode, but the linux server may use another emulation mode and it's possible Telnet doesn't support it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

the telnet you sent work find and the help command return the value

i think its a linux problem

i have tried to connect to my router i got this

and when i tried to connect to the linux  server got this

 

have a look at this FAQ of MicroTik

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

hey guys i searched for a dll to use telnet on my script but i cant understand how to use it

i think it will be with dllcall but have no idea how to do it so i sending the webpage Using extrapuTTY

 

Download Link for  ExtraPUTTY Here

 

and in the attachment the dll

 

Please tell me if i understand this right or wrong

Did you read and followed this?:

"7.3 How to used ExtraPuTTY without ExtraPuTTY installer

The ExtraPuTTY DLL need the path of PuTTY.

In order to do that you must create the environment variable "ExtraPuTTY" with the path of ExtraPuTTY."

http://www.extraputty.com/snapshots/htmldoc/Chapter7.html#INSTALL

You won't manage with just the DLL.

Also, you did not put in the correct references and correct order in the DLL call, which doesn't make it work.

Parameters where you notice an astrix sign, need to be send by reference, which means you need to add the astrix behind the type identifier.

Using connexxion alone doesn't cut it either, you also need to call the send/receive function.

I got a little further with this adjustment, but the dll call seems to end without any return message or callback...

$Dll = @ScriptDir&"\EP\ExtraPuTTY.dll"
EnvSet ( "ExtraPuTTY", @ScriptDir&"\EP\")
Local $handle = DllCallbackRegister("CallBackRcvData", "int", "ConnectionID;Buffer;Size;Status")
$a = DllCall($Dll, "Int*", "Connexion", "Str*", "192.168.0.1", "ULong*", "1","Str*","username","Str*", "password", "BOOL", "TRUE" , "Long" ,"1", "Ulong", "22", "long", "0", "ptr", DllCallbackGetPtr($handle), "Ulong", "2^1")
;msgbox("","",@error & "   A:" & $a)

;int Connexion(char *TargetName,unsigned long *ConnectionId,char *Login,char *Password,bool ShowPuTTY,long Protocol,unsigned long PortNumber,long GenerateReport,int*CallBackRcvData,;unsigned long SpecSettings);

Func CallBackRcvData ($ConnectionID, $Buffer, $Size, $Status);
    ConsoleWrite("Callback called"&@CRLF)
        Local $Info = "ConnectionID=" & $ConnectionID & @CRLF & "Buffer=" & $Buffer & @CRLF & "Size="&$Size&@CRLF&"Status="&$Status&@CRLF & VarGetType($Buffer)
        ConsoleWrite($Info&@CRLF)
    Return 1 ; Return 1 to continue enumeration
EndFunc
;int CallBackRcvData(unsigned long ConnectionId,char *buf, DWORD size,DWORD ConnectionStatus)
Edited by lbsl
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...