本帖最后由 Qokelate 于 2013-2-9 14:58 编辑
吃完饭再搞果然大脑灵活不少,完全搞掂 喜欢蛋疼的自个蛋疼去
去兜红包鸟~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#NoTrayIcon
#include <Base.au3>
Local Const $sServerXML = 'http://www.hostzzz.com/ssh/servers.xml'
Local Const $sURL = 'https://www.usassh.net/free.php'
Local Const $sPLink_Exe = 'pLinkSSH.exe'
Local Const $sPLink_Path = @ScriptDir & '\' & $sPLink_Exe
Local $sParam = ' !!!@*** -P 443 -D 7070 -N -v -Z usassh -pw ###'
TCPStartup()
Local $sHexHTML = InetRead($sURL, 11)
Local $sHexXML = InetRead($sServerXML, 11)
TCPShutdown()
Local $sTextHTML = BinaryToString($sHexHTML, 4)
Local $sXML_Text = BinaryToString($sHexXML, 4)
$sHexHTML = 0
$sHexXML = 0
Local $sFreeIP = StringRegExpPlus($sXML_Text, '(?mi)免费.+ipaddr=\"([0-9|\.]+)\"')
Local $sUser = StringRegExpPlus($sTextHTML, '免费SSH帐号.+\>(\w+)\<')
Local $sPWD = StringRegExpPlus($sTextHTML, '免费SSH密码.+\>(\w+)\<')
Local $sUpTime = StringRegExpPlus($sTextHTML, '更新时间.+\>([^\<]+)\s+')
$sParam = StringReplace($sParam, '!!!', $sUser)
$sParam = StringReplace($sParam, '***', $sFreeIP)
$sParam = StringReplace($sParam, '###', $sPWD)
Switch @Compiled
Case 0
ConsoleWrite('IP=' & $sFreeIP & @CRLF)
ConsoleWrite('User=' & $sUser & @CRLF)
ConsoleWrite('Password=' & $sPWD & @CRLF)
Run(StringAddDQM($sPLink_Exe) & $sParam, @ScriptDir)
Case 1
Local $nPID = Run('cmd.exe /d /c "' & $sPLink_Exe & $sParam & '"', @ScriptDir, @SW_HIDE, 15)
Local $sStd
For $a = 1 To 60
Sleep(1000)
$sStd = StdoutRead($nPID, True, False)
If StringInStr($sStd, 'Store key in cache? (y/n)') Then
StdinWrite($nPID, 'y' & @CRLF & @CRLF)
ExitLoop
EndIf
Next
StdioClose($nPID)
EndSwitch
Exit
|