|
水煮丫迷你QQ怎样解决获取验证码的问题?在论坛里看到了有多新手也说这个问题,但是在更改了最新获取验证码的网址后,运行脚本时还是无法正常显示验证码?附上他老人家的源码,那是发了30块下载来的!
;**** 参数创建于 ACNWrapper_GUI ****
#Region
#AutoIt3Wrapper_Icon=MiniQQ48.ico
#AutoIt3Wrapper_Outfile=MiniQQ.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=水煮丫迷你QQv1.0
#AutoIt3Wrapper_Res_Description=水煮丫软件设计室
#AutoIt3Wrapper_Res_Fileversion=1.0.0.2
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=独孤の伊狼
#AutoIt3Wrapper_Au3Check_Stop_OnWarning=y
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#EndRegion
;**** 参数创建于 ACNWrapper_GUI ****
;#NoTrayIcon
HotKeySet("{F3}", "SetShow") ;显示
HotKeySet("{ESC}", "ExitExe");退出
;全局变量
$Hide = "0"
$mouseON = False
$Showflag = True
$Url = "http://w.qq.com/main.shtml"
$urlIE = ObjCreate("shell.explorer.2")
$isLogon = False
;图标操作 ;
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("CaretCoordMode", 1)
;引入函数udf
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ACN_NET.au3>
#include <Constants.au3>
#include <IE.au3>
#include <QQ_gatpostkey.au3>
#include <ButtonConstants.au3>
#include <QQ_md5.au3>
;界面
#Region ### START Koda GUI section ### Form=
;主界面
$FormQQ = GUICreate("水煮丫迷你QQ", 235, 550, -1, -1, -1, -1)
GUISetIcon("MiniQQ48.ico")
GUISetFont(11, 400, 0, "MS Sans Serif")
$tabMiniQQ = GUICtrlCreateTab(5, 8, 226, 495)
GUICtrlSetFont(-1, 10, 400, 0, "黑体")
$TabMain = GUICtrlCreateTabItem("登录QQ")
GUICtrlSetFont(-1, 10, 400, 0, "黑体")
$Label1 = GUICtrlCreateLabel("QQ号码:", 32, 58, 47, 17)
$Label2 = GUICtrlCreateLabel("QQ密码:", 32, 78, 47, 17)
$Label3 = GUICtrlCreateLabel("验证码:", 32, 102, 51, 17)
$Input1 = GUICtrlCreateInput("", 84, 52, 121, 21)
GUICtrlSetLimit($Input1, 12, 5);限制输入QQ号码为5-12位
$Input2 = GUICtrlCreateInput("", 84, 76, 121, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
$Input3 = GUICtrlCreateInput("", 84, 100, 45, 21)
GUICtrlSetLimit($Input3, 4)
$Label4 = GUICtrlCreateLabel("点击图片可更换验证码", 34, 129, 168, 17)
$Pic1 = GUICtrlCreatePic("", 32, 150, 130, 53, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS));验证码图片
$btnLogin = GUICtrlCreateButton("登 陆", 32, 216, 75, 25)
GUICtrlSetFont(-1, 10, 400, 0, "黑体")
$btnExit = GUICtrlCreateButton("退 出", 129, 215, 75, 25)
GUICtrlSetFont(-1, 10, 400, 0, "黑体")
$tabNotebook = GUICtrlCreateTabItem("迷你QQ")
$objPanelM = GUICtrlCreateObj($urlIE, 8, 32, 219, 465)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
GUICtrlSetCursor(-1, 5)
$tabTools = GUICtrlCreateTabItem("常用功能")
$myeidt = GUICtrlCreateEdit("" & @CRLF, 8, 32, 219, 465, $ES_AUTOVSCROLL + $WS_VSCROLL)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
;自动隐藏窗体
$XY = ControlGetPos($FormQQ, "", $tabMiniQQ)
$X0 = $XY[2]
$Y0 = $XY[3]
;改变窗体大小事件,已取消此功能
TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "SetShow")
AdlibRegister("_Resize_and_Other", 50)
;右击快捷菜单
$setitem = TrayCreateMenu("设置")
$linkitem = TrayCreateItem("开机启动", $setitem, -1, 1)
TrayItemSetOnEvent($linkitem, "OpenPcStart")
$hideQQitem = TrayCreateItem("隐藏QQ", $setitem, -1, 1)
TrayItemSetOnEvent($hideQQitem, "SetShow")
$showQQitem = TrayCreateItem("显示QQ", $setitem, -1, 1)
TrayItemSetOnEvent($showQQitem, "SetShow")
TrayCreateItem("")
$aboutitem = TrayCreateItem("关于")
TrayItemSetOnEvent($aboutitem, "AuoutShuizhuya")
TrayCreateItem("")
$exititem = TrayCreateItem("退出")
TrayItemSetOnEvent($exititem, "ExitExe")
#EndRegion ### END Koda GUI section ###
_get_key()
TraySetState()
TrayTip("快捷键", "F3隐藏,ESC退出", 1, 1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_MINIMIZE)
Case $btnLogin
_Check()
Case $Pic1
_get_key()
Case $btnExit
ExitExe()
EndSwitch
_EmptyScriptMem()
WEnd
_EmptyScriptMem()
Func _Check();检查输入内容
GUICtrlSetState($btnLogin, $GUI_DISABLE)
GUICtrlSetData($btnLogin, "登陆中...")
$qq = GUICtrlRead($Input1)
$yzm = StringUpper(GUICtrlRead($Input3))
If $yzm = "" Then
MsgBox(0, "提示", " " & @CRLF & " 请输入验证码")
GUICtrlSetState($btnLogin, $GUI_ENABLE)
GUICtrlSetData($btnLogin, "登 陆")
ElseIf $qq = "" Then
MsgBox(0, "提示", " " & @CRLF & " 请输入QQ号码")
GUICtrlSetState($btnLogin, $GUI_ENABLE)
GUICtrlSetData($btnLogin, "登 陆")
ElseIf Not GUICtrlRead($Input2) Then
MsgBox(0, "提示", " " & @CRLF & " 请输入QQ密码")
GUICtrlSetState($btnLogin, $GUI_ENABLE)
GUICtrlSetData($btnLogin, "登 陆")
Else
$jm = qq_md5("md5_3", GUICtrlRead($Input2))
$pass = qq_md5("md5", $jm & $yzm)
TestNetLink($qq, $pass, $yzm)
EndIf
EndFunc ;==>_Check
Func _get_key();获取验证码
$img = InetGet("http://ptlogin2.qq.com/getimage", "key.gif", 1)
GUICtrlSetImage($Pic1,"key.gif")
EndFunc ;==>_get_key
;设置显示或隐藏MINIQQ
Func SetShow()
If $Showflag = False Then
GUISetState(@SW_SHOW, $FormQQ)
$Showflag = True
Else
GUISetState(@SW_HIDE, $FormQQ)
$Showflag = False
EndIf
EndFunc ;==>SetShow
;测试网络连接成功
Func TestNetLink($qq, $pass, $yzm)
$Netflag = _NetworkGetInternetIP()
If $Netflag <> "0.0.0.0" Then
$isLogon = True
LogonMiniQQ($qq, $pass, $yzm)
GUICtrlSetState($tabNotebook, $GUI_SHOW);切换到标签
;获取外网IP地址
TrayTip("系统提示", "本次登录IP:" & _NetworkGetInternetIP(), 1, 1)
Else
TrayTip("水煮丫提示您:", "您的网络存在故障,请检查网络设置!", 1, 2)
EndIf
EndFunc ;==>TestNetLink
;退出
Func ExitExe()
Exit 0
EndFunc ;==>ExitExe
;登录迷你QQ
Func LogonMiniQQ($qq, $pass, $yzm)
If $isLogon = True Then
_post($qq, $pass, $yzm)
$urlIE.Navigate($Url)
Else
$urlIE.Navigate("about:blank")
EndIf
EndFunc ;==>LogonMiniQQ
Func _post($qq, $pass, $yzm);提交POST登陆QQ
$oHTTP = ObjCreate("microsoft.xmlhttp")
$oHTTP.Open("post", "http://ptlogin2.qq.com/login", False)
$oHTTP.setRequestHeader("Cache-Control", "no-cache")
$oHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.setRequestHeader("Content-Length", "213")
;miniQQ
$oHTTP.Send("u=" & $qq & "&p=" & $pass & "&verifycode=" & $yzm & "&aid=15000101&u1=http%3A%2F%2Fw.qq.com%2Fmain.shtml&fp=loginerroralert&h=1&ptredirect=1&ptlang=0&from_ui=1&pttype=1&dumy=")
;QQ空间
;$oHTTP.Send("u="&$qq&"&p="&$pass&"&verifycode="&$yzm&"&aid=15000101&u1=http%3A%2F%2Fimgcache.qq.com%2Fqzone%2Fv5%2Floginsucc.html%3Fpara%3Dizone&fp=loginerroralert&h=1&ptredirect=1&ptlang=0&from_ui=1&dumy=")
$a = $oHTTP.responseText
Sleep(100)
If StringInStr($a, "QQ社区登录") Then
;GUISetState(@SW_SHOW,$Form2)
;GUISetState(@SW_HIDE,$Form1)
Else
$230 = StringLen($a)
$231 = StringInStr($a, '");') - 1
$232 = StringTrimRight($a, $230 - $231)
MsgBox(0, "", StringMid($232, StringInStr($a, 'alert("') + 7))
GUICtrlSetState($btnLogin, $GUI_ENABLE)
GUICtrlSetData($btnLogin, "登 陆")
EndIf
EndFunc ;==>_post
;开机启动
Func OpenPcStart()
$isOpenStart = RegRead("HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\Run", "水煮丫迷你QQ")
If $isOpenStart = "" Then
RegWrite("HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", "水煮丫迷你QQ", "REG_SZ", @AutoItExe)
EndIf
EndFunc ;==>OpenPcStart
;关于水煮丫
Func AuoutShuizhuya()
TrayTip("水煮丫感谢您:", "如果您发现本软件存在问题或者您对本软件有什么好的意见或者建议请联系作者!", 1, 1)
_IECreate("http://hi.baidu.com/10801009/blog")
EndFunc ;==>AuoutShuizhuya
;对脚本内存进行释放
Func _EmptyScriptMem()
;~ 无论您是使用或者转载,请保留原作者(kn007)信息,谢谢!
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, _
'int', False, 'int', @AutoItPID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall("kernel32.dll", 'int', 'CloseHandle', 'int', $ai_Handle[0])
EndFunc ;==>_EmptyScriptMem
;改变窗体大小以及隐藏
Func _Resize_and_Other()
_MouseOutGui_and_WriteFile()
Local $Xmax = @DesktopWidth
Local $XY = ControlGetPos($FormQQ, "", $tabMiniQQ)
Local $Wxy = WinGetPos($FormQQ)
Local $K = $Wxy[3] / 500
Local $Iy = 500
Local $Ix = Int($Wxy[2] / $K)
Local $Xn
If $XY[2] <> $X0 Or $XY[3] <> $Y0 Then
$X0 = $XY[2]
$Y0 = $XY[3]
ControlMove($FormQQ, "", $tabMiniQQ, 0, 0, $X0, $Y0)
EndIf
If $Wxy[0] <= 20 And $Hide = "0" And $mouseON = False Then
For $i = 1 To $Ix
If $Wxy[0] < 0 Then
$Xn = $Wxy[0] - Int($Wxy[2] / $Ix * $i)
Else
$Xn = 0 - Int($Wxy[2] / $Ix * $i)
EndIf
WinMove($FormQQ, "", $Xn, $Wxy[1])
If $Xn <= -$Wxy[2] Then ExitLoop
Next
$Hide = "LEFT"
WinSetOnTop($FormQQ, "", 1)
EndIf
If $Xmax - ($Wxy[0] + $Wxy[2]) <= 20 And $Hide = "0" And $mouseON = False Then
For $i = 1 To $Ix
If $Xmax - ($Wxy[0] + $Wxy[2]) <= 0 Then
$Xn = $Wxy[0] + Int($Wxy[2] / $Ix * $i)
Else
$Xn = $Xmax - $Wxy[2] + Int($Wxy[2] / $Ix * $i)
EndIf
WinMove($FormQQ, "", $Xn, $Wxy[1])
If $Xn >= $Xmax + 1 Then ExitLoop
Next
$Hide = "RIGHT"
WinSetOnTop($FormQQ, "", 1)
EndIf
If $Wxy[1] <= 20 And $Hide = "0" And $mouseON = False Then
For $i = 1 To $Iy
If $Wxy[1] > 0 Then
$Xn = 0 - Int($Wxy[3] / $Iy * $i)
Else
$Xn = $Wxy[1] - Int($Wxy[3] / $Iy * $i)
EndIf
WinMove($FormQQ, "", $Wxy[0], $Xn)
If $Xn + $Wxy[3] <= 0 Then ExitLoop
Next
$Hide = "UP"
WinSetOnTop($FormQQ, "", 1)
EndIf
Local $MouseXY = MouseGetPos()
If $MouseXY[1] < $Wxy[1] + $Wxy[3] And $MouseXY[1] > $Wxy[1] And $MouseXY[0] = 0 And $Hide = "LEFT" Then
For $i = 1 To $Ix
Local $Xn = Int($Wxy[2] / $Ix * $i) - $Wxy[2]
WinMove($FormQQ, "", $Xn, $Wxy[1])
Next
$Hide = "0"
WinSetOnTop($FormQQ, "", 0)
EndIf
If $MouseXY[1] < $Wxy[1] + $Wxy[3] And $MouseXY[1] > $Wxy[1] And $MouseXY[0] = $Xmax - 1 And $Hide = "RIGHT" Then
For $i = 1 To $Ix
Local $Xn = $Xmax - Int($Wxy[2] / $Ix * $i)
WinMove($FormQQ, "", $Xn, $Wxy[1])
Next
$Hide = "0"
WinSetOnTop($FormQQ, "", 0)
EndIf
If $MouseXY[0] < $Wxy[0] + $Wxy[2] And $MouseXY[0] > $Wxy[0] And $MouseXY[1] = 0 And $Hide = "UP" Then
For $i = 1 To $Iy
Local $Xn = -$Wxy[3] + Int($Wxy[3] / $Iy * $i)
WinMove($FormQQ, "", $Wxy[0], $Xn)
Next
$Hide = "0"
WinSetOnTop($FormQQ, "", 0)
EndIf
EndFunc ;==>_Resize_and_Other
;窗体移动
Func _MouseOutGui_and_WriteFile()
Local $Wxy = WinGetPos($FormQQ)
Local $MouseXY = MouseGetPos()
If $MouseXY[0] <= $Wxy[0] + $Wxy[2] And $MouseXY[0] >= $Wxy[0] And $MouseXY[1] <= $Wxy[1] + $Wxy[3] And $MouseXY[1] >= $Wxy[1] Then
$mouseON = True
Else
$mouseON = False
EndIf
EndFunc ;==>_MouseOutGui_and_WriteFile
如果这里更改了最新地址,为什么还是一样不可以正常获取验证码?
Func _get_key();获取验证码
$img = InetGet("http://ptlogin2.qq.com/getimage", "./key.gif", 1)
GUICtrlSetImage($Pic1,"./key.gif")
EndFunc ;==>_get_key |
|