#include "winhttp_getrespond.au3"
_sms_main()
func _sms_main()
local $hOpen=_winhttpopen()
$phonenum=inputbox("手机号码","请输入接收验证码的手机号:")
if not stringregexp($phonenum,"^\d{11}$") then return msgbox(48,"提示","您输入的手机号码不正确!")
_sms_getcheckcode($hOpen,$phonenum)
$checkcode=inputbox("验证码","请输入手机接收到的验证码:")
if not stringregexp($checkcode,"^\d+$") then return msgbox(48,"提示","您输入的验证码不正确!")
$loginRes=_winhttp_getrespond($hOpen,"http://115.239.133.251:6090/imweb/codeLoginForSouGou.s?clientId=51&channel=51&account="&$phonenum&"&checkCode="&$checkcode,2)
if @error then
msgbox(48,"抱歉","连接服务器失败,请稍后再试!")
return false
else
$res=binarytostring($loginRes[0])
if stringinstr($res,"100") then
msgbox(64,"OK","登陆成功!")
else;判断错误码
if stringinstr($res,"101") then
msgbox(48,"提示","您已连续5次输错验证码,请半小时后再试")
elseif stringinstr($res,"102") then
msgbox(48,"提示","验证码错误")
elseif stringinstr($res,"103") then
msgbox(48,"提示","验证码失效,请重新获取")
elseif stringinstr($res,"802") then
msgbox(48,"提示","验证码错误")
else
msgbox(48,"提示","登录失败,请稍后再试")
endif
;return false
endif
endif
const $title="短信免费发"
if winexists("[REGEXPTITLE:^"&$title&"$]") then return winactivate("[REGEXPTITLE:^"&$title&"$]")
$hForm=guicreate($title,200,180)
guisetbkcolor(0x000000)
guictrlcreatelabel("对方手机:",10,10,60,20)
guictrlsetcolor(-1,0xffffff)
$hPhonenum=guictrlcreateinput("",70,10,100,20)
guictrlcreatelabel("发送内容:",0,0,0,0)
$hSendmsg=guictrlcreateedit("",0,40,200,100)
$hSendbut=guictrlcreatebutton("免费发送(Ctrl+回车)",30,150,140,20)
guisetstate()
while 1
switch guigetmsg()
case -3
_winhttpclosehandle($hOpen)
exit
case $hSendbut
$num=guictrlread($hPhonenum)
$text=guictrlread($hSendmsg)
_sms_sendmsg($hOpen,$num,$text,$checkcode)
endswitch
wend
endfunc;main
func _sms_getcheckcode($hOpen,$pNum)
$res=_winhttp_getrespond($hOpen,"http://115.239.133.251:6090/imweb/phoneCheckCode.s?sendPhone="&$pNum&"&methodType=getPhoneCode",2)
if @error then return false
$res=binarytostring($res[0])
if stringinstr($res,100) then
msgbox(64,"OK","验证码已经发送至您手机")
elseif stringinstr($res,103) then
msgbox(48,"提示","今天已经获取过10次已达上限")
elseif stringinstr($res,"104") then
msgbox(48,"提示","您获取验证码次数太频繁,请歇会再试")
elseif stringinstr($res,"105") then
msgbox(48,"提示","您已连续5次输错验证码,请半小时后再试")
else
msgbox(16,"错误","验证码获取失败")
endif
endfunc;getcheckcode
func _sms_sendmsg($hOpen,$num,$text,$chk)
$send="http://115.239.133.251:6090/imweb/smsPush.s?checkCode="&$chk&"&receivePhone="&$num&"&smsContent="&$text
$headers="x-requested-with: XMLHttpRequest"&@CRLF& _
"Accept-Language: zh-cn"&@CRLF& _
"Referer: http://115.239.133.251:6090/imweb/toSouGou/index.html"&@CRLF& _
"Accept: */*"&@CRLF& _
"Content-Type: application/x-www-form-urlencoded; charset=UTF-8"&@CRLF& _
"Accept-Encoding: gzip, deflate"&@CRLF& _
"Connection: Keep-Alive"&@CRLF& _
"Cache-Control: no-cache"&@CRLF&@CRLF
$sendres=_winhttp_getrespond($hOpen,$send,2,-1,$headers)
$res=binarytostring($sendres[0])
if stringinstr($res,100) then
msgbox(64,"OK","短信已成功发送!")
else
msgbox(16,"错误","短信发送失败,可能验证码已失效,请重新获取!")
endif
clipput($res)
endfunc;sendmsg