找回密码
 加入
搜索
查看: 4575|回复: 5

[出售] 100元找人把下面的AU3脚本写成DLL

[复制链接]
发表于 2012-9-27 13:55:37 | 显示全部楼层 |阅读模式
悬赏1金钱未解决
Const $DEATHBYCAPTCHA_VERSION = "DBC/AutoIt v4.0.4"
Const $DEATHBYCAPTCHA_HOST = "api.dbcapi.me"
Const $DEATHBYCAPTCHA_PORTS[2] = [8123, 8130]
Const $DEATHBYCAPTCHA_BASE64_TABLE = StringToASCIIArray("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")


Func _DeathByCaptchaBase64Encode($buf)
    Local $c = 0, $i = 1, $j = 0, $l = BinaryLen($buf), $m = Mod($l, 3)
    Local $dest = ""
    While $i <= $l - $m
        $c = BitOR(BitShift(BinaryMid($buf, $i, 1), -16), BitShift(BinaryMid($buf, $i + 1, 1), -8), BinaryMid($buf, $i + 2, 1))
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND($c, 16515072), 18)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND($c, 258048), 12)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND($c, 4032), 6)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitAND($c, 63)])
        $i += 3
        $j += 4
    WEnd
    If 1 = $m Then
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND(BinaryMid($buf, $i, 1), 252), 2)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND(BinaryMid($buf, $i, 1), 3), -4)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[64])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[64])
    ElseIf 2 = $m Then
        $c = BitOR(BitShift(BinaryMid($buf, $i, 1), -8), BinaryMid($buf, $i + 1, 1))
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND($c, 64512), 10)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND($c, 1008), 4)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[BitShift(BitAND($c, 15), -2)])
        $dest &= Chr($DEATHBYCAPTCHA_BASE64_TABLE[64])
    EndIf
    Return $dest
EndFunc

Func _DeathByCaptchaCall($buf)
    $buf &= Chr(13)
    $buf &= Chr(10)
    Local $response = ""
    TCPStartUp()
    Local $sock = TCPConnect(TCPNameToIp($DEATHBYCAPTCHA_HOST), Random($DEATHBYCAPTCHA_PORTS[0], $DEATHBYCAPTCHA_PORTS[1], 1))
    If 0 < $sock Then
        Local $n = 0
        While 0 < StringLen($buf)
            $n = TCPSend($sock, $buf)
            If 0 < $n Then
                $buf = StringTrimLeft($buf, $n)
            EndIf
        WEnd
        Do
            $response &= TCPRecv($sock, 1024)
        Until @error OR 0 == StringCompare(Chr(10), StringRight($response, 1))
        TCPCloseSocket($sock)
    EndIf
    TCPShutdown()
    Return $response
EndFunc


; Uploads a CAPTCHA.
; Call with your DeathByCaptcha username/password and CAPTCHA file name.
; Returns unique CAPTCHA ID on success, 0 otherwise.
Func DeathByCaptchaUpload($username, $password, $captchaFileName)
    Local $f = FileOpen($captchaFileName, 16)
    If -1 < $f Then
        Local $img = FileRead($f)
        If @error Then
            $img = Binary("")
        EndIf
        FileClose($f)
        If 0 < BinaryLen($img) Then
            Local $a = StringRegExp(_DeathByCaptchaCall('{"version":"' & $DEATHBYCAPTCHA_VERSION & '","cmd":"upload","username":"' & $username & '","password":"' & $password & '","captcha":"' & _DeathByCaptchaBase64Encode($img) & '"}'), '"captcha"\s?:\s?(\d+)', 1)
            If 0 < UBound($a) Then
                Return Int($a[0])
            EndIf
        EndIf
    EndIf
    Return 0
EndFunc

; Fetches a CAPTCHA text.
; Call with unique CAPTCHA ID.
; Returns "" if the CAPTCHA is not solved or does not exist.
Func DeathByCaptchaGetText($captchaId)
    Local $a = StringRegExp(_DeathByCaptchaCall(StringFormat('{"version":"%s","cmd":"captcha","captcha":%d}', $DEATHBYCAPTCHA_VERSION, $captchaId)), '"text"\s?:\s?"([^"]+)"', 1)
    If 0 < UBound($a) Then
        Return $a[0]
    Else
        Return ""
    EndIf
EndFunc

; Remove an unsolved CAPTCHA you won't to be solved anymore.
; Call with your DeathByCaptcha username/password and unique CAPTCHA ID.
; Returns 1 on success, 0 otherwise.
Func DeathByCaptchaRemove($username, $password, $captchaId)
    Return StringRegExp(_DeathByCaptchaCall(StringFormat('{"version":"%s","cmd":"remove","username":"%s","password":"%s","captcha":%d}', $DEATHBYCAPTCHA_VERSION, $username, $password, $captchaId)), '"captcha"\s?:\s?0')
EndFunc

; Reports a CAPTCHA as incorrectly solved.
; Call with your DeathByCaptcha username/password and unique CAPTCHA ID.
; Returns 1 on success, 0 otherwise.
Func DeathByCaptchaReport($username, $password, $captchaId)
    Return StringRegExp(_DeathByCaptchaCall(StringFormat('{"version":"%s","cmd":"report","username":"%s","password":"%s","captcha":%d}', $DEATHBYCAPTCHA_VERSION, $username, $password, $captchaId)), '"is_correct"\s?:\s?false')
EndFunc

; Decodes a CAPTCHA by uploading it and polling for its status repeatedly.
; Call with your DeathByCaptcha username/password, CAPTCHA file name and
; solving timeout (in seconds).  Returns an two-elements array with CAPTCHA
; unique ID (zero if not solved) and text (empty string if not solved).
; Removes unsolved CAPTCHAs automatically.
Func DeathByCaptchaDecode($username, $password, $captchaFileName, $timeout)
    Local $result[2] = [0, ""]
    $result[0] = DeathByCaptchaUpload($username, $password, $captchaFileName)
    If 0 < $result[0] Then
        Local $deadline = $timeout * 1000
        While 0 = StringLen($result[1]) AND 0 < $deadline
            Sleep(10000)
            $deadline -= 10000
            $result[1] = DeathByCaptchaGetText($result[0])
        WEnd
        If 0 = StringLen($result[1]) Then
            $result[0] = 0
        EndIf
    EndIf
    Return $result
EndFunc


; Usage example
; =============
;
; Call DeathByCaptchaDecode() function with your DBC username, password,
; CAPTCHA file name, and desired solving timeout (in seconds) as arguments.
; You'll receive an array of two elements: numeric CAPTCHA ID and its text;
; CAPTCHA ID will be greater than zero if the CAPTCHA was solved.
;
;$result = DeathByCaptchaDecode($CmdLine[1], $CmdLine[2], $CmdLine[3], 60)
;MsgBox(0, "decode()", StringFormat('ID: %s, text: %s', $result[0], $result[1]))



联系QQ:2466186871
可以用其他语言写DLL,要支持多线程运行

附件: 您需要 登录 才可以下载或查看,没有账号?加入
 楼主| 发表于 2012-9-27 13:58:16 | 显示全部楼层
QQ在线等......
发表于 2012-9-27 23:03:25 | 显示全部楼层
春天花会开。。。貌似明年春天才有人来接
发表于 2012-10-4 14:55:29 | 显示全部楼层
100也太少了吧
发表于 2012-12-27 16:40:48 | 显示全部楼层
这个是个网络方面的脚本吧!!!!!!!!!
发表于 2013-1-5 21:33:04 | 显示全部楼层
不错,挺好的。谢谢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-22 11:49 , Processed in 0.072335 second(s), 18 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表