问题描述
我正在xp上写一个telnet代理.现在,我可以telnet到系统的telnet服务器,并打印其返回值发送回我的程序.
I am writing a telnet proxy on xp. Now I can telnet to system's telnet server and print its return values sending back to my procedure.
我发现一个非常令人困惑的现象.当我第一次远程登录服务器时,它将要求我登录.我键入"tamlok"
,我可以看到它发回给我的"116,97,109,108,111,107,10,13"
是"tamlok"(10 and 13 means '\n' and '\r')
的ascii值.
I find a very puzzling phenomenon. When I first telnet to the server,it will ask me to log in. I type in "tamlok"
, and I can see that it sending back to me that "116,97,109,108,111,107,10,13"
which is the ascii value of "tamlok"(10 and 13 means '\n' and '\r')
.
但是,登录后,我再次输入"tamlok"
.它发回给我"27,91,56,59,51,52,72,116,0,97,0,108,0,111,0,107,0,27,91,57,59,49,72"
.
However after I log in,I type in "tamlok"
again. It sends back to me that "27,91,56,59,51,52,72,116,0,97,0,108,0,111,0,107,0,27,91,57,59,49,72"
.
我建议它返回unicode,以便"116"
变成"116,0"
,依此类推.但是我无法理解序列"27,91,56,59,51,52,72"
和"27,91,57,59,49,72"
.我认为这可能是特殊功能的序列,就像{0x1B, 0x5B, 0x48, 0x1B, 0x5B, 0x4A}
会清除控制台一样.
I suggest that it returns the unicode so that "116"
turns into "116,0"
and so on. But I can't understand the sequence "27,91,56,59,51,52,72"
and "27,91,57,59,49,72"
. I think it maybe a sequence for a special function, just like {0x1B, 0x5B, 0x48, 0x1B, 0x5B, 0x4A}
will clear the console.
那么,如何解释呢?欢迎任何帮助!
So,how to interpret this?Any help is welcome!
推荐答案
感谢Joachim Pileborg.现在很明显,它是终端控制代码. 示例.因此,"27,91,56,59,51,52,72"为"[Esc] [8; 34H"",适合以下格式:光标首页[{ROW}; {COLUMN} H设置光标位置,随后的文本将在该位置开始.如果未提供行/列参数(即[H]),则光标将移至屏幕左上方的原始位置.27,91,57,59,49,72也是如此.
Thanks to Joachim Pileborg.Now it is clear that it is terminal control codes. An example.So "27,91,56,59,51,52,72" is "[Esc][8;34H" which suits the pattern:Cursor Home [{ROW};{COLUMN}HSets the cursor position where subsequent text will begin. If no row/column parameters are provided (ie. [H), the cursor will move to the home position, at the upper left of the screen.So does 27,91,57,59,49,72".
这篇关于关于Windows XP上telnet服务器的返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!