| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 550 人关注过本帖
标题:哪位指教一下
只看楼主 加入收藏
chengiant
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2006-3-13
收藏
 问题点数:0 回复次数:0 
哪位指教一下
利用管道往telnet里写命令:open 192.168.0.2
不能成功,请指教


.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\gdi32.inc
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\comdlg32.lib
;=================================================数据定义
.data
commandline db "C:\WINDOWS\system32\telnet.exe",0
sat SECURITY_ATTRIBUTES <?>
pinfo PROCESS_INFORMATION <?>
startupinfo STARTUPINFO <0>
hwrite DWORD 0
hread DWORD 0
prochandle DWORD 0
dupwrite DWORD 0
buf2 db "open 168.192.0.2",10,13
read DWORD 0
.data?
hInstance DWORD ?
cmdline DWORD ?
;=======主程序段
.code
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke GetCommandLine
mov cmdline,eax
mov sat.nLength,sizeof SECURITY_ATTRIBUTES
mov sat.lpSecurityDescriptor,NULL
mov sat.bInheritHandle,TRUE
;============建管道
invoke CreatePipe,addr hread,addr hwrite,addr sat,NULL
invoke GetCurrentProcess
mov prochandle,eax
;invoke DuplicateHandle,prochandle,hwrite,prochandle,addr dupwrite,0,FALSE,DUPLICATE_SAME_ACCESS
;重定向子程序输入端
push hread
pop startupinfo.hStdInput
;invoke CloseHandle,hwrite
invoke CreateProcess,NULL,addr commandline,NULL,NULL,TRUE,NULL,NULL,NULL,addr startupinfo,addr pinfo
invoke CloseHandle,hread
invoke WriteFile,hwrite,addr buf2,20,addr read,NULL
invoke ExitProcess,-1
end start
搜索更多相关主题的帖子: 指教 
2006-03-17 13:56
快速回复:哪位指教一下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037074 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved