9月82020
AU3联众打码平台接入_UDF源码
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#------------------------------------------
#=====保留此信息=====联众打码接入=v1.0=====
#by:绿色风 QQ:79664738
#blog: www.Jianyiit.com 简易工作室
# -2020-06-06-
#------------------------------------------
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;-------------------------------------------------用户配置
;-------------------------------------------------用户配置
Global $LZ_ID = "qq79664738" ;联众账号
Global $LZ_PW = "" ;联众密码
;-------------------------------------------------------开发者配置
;-------------------------------------------------------开发者配置
Global $softwareId = 19831;软件id
Global $softwareSecret = "vgMLsXxfVvdI8e5smZHh8FiiCRxY4cSW1jrd0eDz";联众V2接口 Secret
Global $captchaType = 1013 ;识别类型(整形),由联众平台分配,请查阅联众网站价格
;---------------------------------------------------------------------
;~ ;---示例
;~ msgbox(0,"返回验证码",_JY_LZYZM(@ScriptDir&"\61s.jpg"))
;~ msgbox(0,"返回用户点数",_JY_LZCP() )
;检查点数
Func _JY_LZCP()
Local $sc = _WinHttp("https://v2-api.jsdama.com/check-points", _ ;
'{"softwareId":' & $softwareId & ',' & _ ;软件ID
'"softwareSecret":"' & $softwareSecret & '",' & _ ;联众V2接口 Secret
'"username":"' & $LZ_ID & '",' & _ ;联众 用户名
'"password":"' & $LZ_PW &'"}') ;联众 密码
Local $arr = StringRegExp(StringStripWS($sc,8), '"data":{(.*?)}', 3)
If @error Then
;~ MsgBox(0, _JsonRead($sc,"code"),"返回: "& _JsonRead($sc,"message"),3) ;test
Return $sc;
Else
Local $str = StringReplace($arr[0],'"',"")
$str = StringReplace($str,'lockPoints',"锁点")
$str = StringReplace($str,'userPoints',"余点")
$str = StringReplace($str,'availablePoints',"可用")
;~ MsgBox(0, 0, $str)
Return $str
EndIf
EndFunc ;==>_JY_LZYZM
;
Func _JY_LZYZM($pic)
Local $file = FileOpen($pic, 16) ;以二进制方式打开
Local $sdat = _JY_Base64Encode(FileRead($file)) ;读取数据并转码base64
FileClose($file)
Local $sc = _WinHttp("https://v2-api.jsdama.com/upload", _ ;
'{"softwareId":' & $softwareId & ',' & _ ;软件ID
'"softwareSecret":"' & $softwareSecret & '",' & _ ;联众V2接口 Secret
'"username":"' & $LZ_ID & '",' & _ ;联众 用户名
'"password":"' & $LZ_PW & '",' & _ ;联众 密码
'"captchaData":"' & $sdat & '",' & _ ;验证码内容的base64结果
'"captchaType":' & $captchaType & ',' & _ ;识别类型(整形),由联众平台分配,请查阅联众网站价格
'"captchaMinLength":0,' & _ ;可选参数,识别时需输入的最小最度。注,1个中文汉字 或 1个英字都记为长度 1。例如:联众识别 记 4,abcd 记 4
'"captchaMaxLength":0,' & _ ;可选参数,识别时最多输入的内容长度。计数规则同上
'"workerTipsId":0}') ; 可选参数,人工提示模板ID。
Local $arr = StringRegExp(StringStripWS($sc,8), '"recognition":"(.*?)"', 3)
If @error Then ;返回出错信息
;~ MsgBox(0, _JsonRead($sc,"code"),"返回: "& _JsonRead($sc,"message"),3) ;test
Return ; 返回空值 用来识别 验证码 识别失败
Else
;~ MsgBox(0, "验证码", $arr[0])
Return $arr[0]
EndIf
EndFunc ;==>_JY_LZYZM
; 失败 返回:0 主机不通
;成功返回页面源码
Func _WinHttp($url, $dat = "") ;页面下载
Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("POST", $url, True)
$oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36")
$oHTTP.SetRequestHeader("Accept-Language", "zh-CN,zh;q=0.8")
$oHTTP.SetRequestHeader("Accept", "application/json, text/javascript, */*; q=0.01")
$oHTTP.SetRequestHeader("Connection", "Keep-Alive");数据传递完并不立即关闭连接
$oHTTP.SetRequestHeader("Content-Type", "text/json");表示客户端提交给服务器文本内容的编码方式
$oHTTP.SetRequestHeader("Host", "v2-api.jsdama.com");
$oHTTP.SetRequestHeader("Content-Length", StringLen($dat));
$oHTTP.Send($dat)
$oHTTP.WaitForResponse()
$oReturnWebS = BinaryToString($oHTTP.ResponseBody, 4)
ConsoleWrite($oReturnWebS)
Return $oReturnWebS
EndFunc ;==>_WinHttp
; 详细信息: Base64编码
Func _JY_Base64Encode($Data, $LineBreak = 76)
Local $Opcode = "0x5589E5FF7514535657E8410000004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F005A8B5D088B7D108B4D0CE98F0000000FB633C1EE0201D68A06880731C083F901760C0FB6430125F0000000C1E8040FB63383E603C1E60409C601D68A0688470183F90176210FB6430225C0000000C1E8060FB6730183E60FC1E60209C601D68A06884702EB04C647023D83F90276100FB6730283E63F01D68A06884703EB04C647033D8D5B038D7F0483E903836DFC04750C8B45148945FC66B80D0A66AB85C90F8F69FFFFFFC607005F5E5BC9C21000"
Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]")
DllStructSetData($CodeBuffer, 1, $Opcode)
$Data = Binary($Data)
Local $Input = DllStructCreate("byte[" & BinaryLen($Data) & "]")
DllStructSetData($Input, 1, $Data)
$LineBreak = Floor($LineBreak / 4) * 4
Local $OputputSize = Ceiling(BinaryLen($Data) * 4 / 3)
$OputputSize = $OputputSize + Ceiling($OputputSize / $LineBreak) * 2 + 4
Local $Ouput = DllStructCreate("char[" & $OputputSize & "]")
DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
"ptr", DllStructGetPtr($Input), _
"int", BinaryLen($Data), _
"ptr", DllStructGetPtr($Ouput), _
"uint", $LineBreak)
Return StringReplace(DllStructGetData($Ouput, 1), @CRLF, "")
EndFunc ;==>JY_Base64Encode
Func _JsonRead($sJson = "", $sMember = '', $len = 0)
Local $sResult, $sCode = ""
$sJson = StringRegExpReplace($sJson, '[\r\n]+', '');去除换行
$sCode &= 'function json2str()' & @CRLF
$sCode &= '{' & @CRLF
$sCode &= "var jsontext = '" & $sJson & "';" & @CRLF
$sCode &= 'var obj = eval("("+jsontext+")");' & @CRLF ; json2object
If $len = 0 Then
$sCode &= 'var member = obj.' & $sMember & @CRLF ;取出信息
Else
$sCode &= 'var member = obj.' & $sMember & '.length' & @CRLF ;取出对象长度
EndIf
$sCode &= 'return member' & @CRLF
$sCode &= '}' & @CRLF
;ConsoleWrite($sCode)
Local $oScript = ObjCreate("MSScriptControl.ScriptControl.1")
$oScript.language = 'JavaScript'
$oScript.AddCode($sCode)
$sResult = $oScript.Run('json2str')
$oScript = 0
Return $sResult
EndFunc ;==>_JsonRead
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!