python解决android版数美滑块验证码,30分钟快速解决

话不多说点我【+qq】

先看滑块 右滑拼图 我们用opencv就可以了,要想提高识别率,就取对接图片打码平台

opencv代码,注释借鉴于网络

import cv2
import numpy as np
from io import BytesIO

def get_distance3(fg_resp, bg_resp):
    """计算滑动距离"""
    # 1. 将背景图、滑块图的二进制响应体转为BytesIO对象
    bg = BytesIO(bg_resp)
    fg = BytesIO(fg_resp)
    # 2. 使用imdecode进行图像解码,转成OpenCV中的Mat对象
    target = cv2.imdecode(np.asarray(bytearray(fg.read()), dtype=np.uint8), 0)
    template = cv2.imdecode(np.asarray(bytearray(bg.read()), dtype=np.uint8), 0)
    # 3. 使用matchTemplate方法进行模板匹配,返回背景图中与滑块的位置匹配值数组
    result = cv2.matchTemplate(target, template, cv2.TM_CCORR_NORMED)
    # 4. 使用numpy中的unravel_index函数获取result中位置匹配值最大的索引位置,既是滑动的距离
    _, distance = np.unravel_index(result.argmax(), result.shape)
    return distance

默认图片是600*300

所以计算出来的距离需要做操作(距离/600*391)

为什么是391  因为我的手机设备把原图600*300的图缩放成391*195

你需要根据你的手机设备进行修改

网上去找一个生成鼠标轨迹的代码,直接用

def get_random_tracks(distance):
    """生成轨迹"""
    tracks = []

    y = 0
    v = 0
    t = 1
    current = 0
    mid = distance * 3 / 4
    exceed = 80
    z = t

    tracks.append([0, 0, 1])

    while current < (distance + exceed):
        if current < mid / 2:
            a = 15
        elif current < mid:
            a = 20
        else:
            a = -30
        a /= 2
        v0 = v
        s = v0 * t + 0.5 * a * (t * t)
        current += int(s)
        v = v0 + a * t

        y += random.randint(-5, 5)
        z += 100 + random.randint(0, 10)

        tracks.append([min(current, (distance + exceed)), y, z])

    while exceed > 0:
        exceed -= random.randint(0, 5)
        y += random.randint(-5, 5)
        z += 100 + random.randint(0, 10)
        tracks.append([min(current, (distance + exceed)), y, z])

    return tracks

解密的是des的 ,随便找个des加密代码就行

提交参数

(end_time-start_time,对应密钥)

(x/391,对应密钥)

(鼠标轨迹数组,对应密钥)
加密提交就行

结果,opencv成功概率还行 10个7次都过了

因为写多了不让发布

点我【+qq】

  • 11
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值