import math
import time
import requests
import urllib3,random
import execjs
import hashlib,json
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

def csnb_creat_sign(cssb):
    jsen = '''function csnb(parm){
    var S = [];
    let MD5_SIGN = "JIKOCISDOCKSJS";
    parm = JSON.parse(parm);

    for (let I in parm) {
        let P = parm[I],
        T = [];
        T[0] = I;
        T[1] = P;
        
        if(typeof(P) == 'object'){
            T[1] = JSON.stringify(P)   
        }
        S.push(T);
    }
    S.sort((function (e, t) {
            return e[0] < t[0] ? -1 : e[0] > t[0] ? 1 : 0
        }));
    for (var b = "", C = 0; C < S.length; C++) {
        var w = S[C];
        b += w[0] + "=" + w[1],
        C != S.length - 1 && (b += "&")
    }
   
    return MD5_SIGN+b+MD5_SIGN;
    }
    '''
    contentx = execjs.compile(jsen)

    pwd = contentx.call("csnb",json.dumps(cssb))
    # return pwd
    return hashlib.md5(str(pwd).encode()).hexdigest()

def structureAsk(TOKEN,PID,user_id,version):
    reqid = random.randint(1,15)
    reqid = 16
    # url = "http://game.hnxmd.cn/mini/xcx/buffDetail?ver=1.2.1"
    # headers = {
    #     'Host': 'game.hnxmd.cn',
    #     'Connection': 'keep-alive',
    #     'referer': 'http://servicewechat.com/wx38b95ee46c3dd0ee/16/index.html',
    #     'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/6609',
    #     'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    #     'Accept': '*/*',
    # }
    # timex = math.floor(time.time())
    # data = {"pid":PID,"platform":"H5WeChat","user_id":user_id,"version":version,"device":"android","SC-API-TOKEN":TOKEN,"timestamp":str(timex),"randstr":f"{user_id}_{timex}_{reqid}"}
    # data["sign"] = csnb_creat_sign(data)
    # payload = "req={}".format(json.dumps(data))
    # response = requests.request("POST", url, headers=headers, data=payload,verify=False)
    # print(response.text)
    # #   --------------
    # time.sleep(1)
    # reqid += 1
    # url = "http://game.hnxmd.cn/mini/xcx/challengeGame?ver=1.2.1"
    # headers = {
    #     'Host': 'game.hnxmd.cn',
    #     'Connection': 'keep-alive',
    #     'referer': 'http://servicewechat.com/wx38b95ee46c3dd0ee/16/index.html',
    #     'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/6609',
    #     'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    #     'Cache-Control': 'no-cache, private'
    # }
    # timex = math.floor(time.time())
    # data = {"pid": PID, "platform": "H5WeChat", "user_id": user_id, "version": version, "device": "android",
    #         "SC-API-TOKEN": TOKEN, "timestamp": str(timex), "randstr": f"{user_id}_{timex}_{reqid}"}
    # data["sign"] = csnb_creat_sign(data)
    # payload = "req={}".format(json.dumps(data))
    # response = requests.request("POST", url, headers=headers, data=payload, verify=False)
    # print(response.text)
    # # ---------------
    # time.sleep(1)
    reqid += 1
    url = "http://game.hnxmd.cn/mini/xcx/challengeOrOnHookGift?ver=1.2.1"
    headers = {
        'Host': 'game.hnxmd.cn',
        'Connection': 'keep-alive',
        'referer': 'http://servicewechat.com/wx38b95ee46c3dd0ee/16/index.html',
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/6609',
        'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    }
    timex = math.floor(time.time())

    data = {"pid":PID,"platform":"H5WeChat","user_id":user_id,"version":"1.2.1","device":"android","SC-API-TOKEN":TOKEN,"timestamp":timex,"randstr":f"{PID}_{timex}_{reqid}","gameParam":{
        "game_type":0,
        "chapter":6,
        "mission":50,
        "reward":{
            "coin":9999999,
            "jewel":9999999,
            "equipList":[
                {"id":5070,
                 "quality":8,
                 "attribute":1,
                 "entryNum":1
                 },
                {"id":70,
                 "quality":8,
                 "attribute":8,
                 "entryNum":0
                 },
                {"id":1070,
                 "quality":8,
                 "attribute":8,
                 "entryNum":0
                 },
                {"id":2070,
                 "quality":8,
                 "attribute":8,
                 "entryNum":0
                 },
                {"id":3070,
                 "quality":8,
                 "attribute":8,
                 "entryNum":0
                 },
                {"id":4070,
                 "quality":8,
                 "attribute":8,
                 "entryNum":0
                 },

            ],"test":0},"result":1,"adDouble":0}}
    data["sign"] = csnb_creat_sign(data)
    payload = "req={}".format(json.dumps(data))
    response = requests.request("POST", url, headers=headers, data=payload, verify=False)
    print(response.text)

TOKEN = ""
PID = ""
user_id = 341891
version = "1.2.1"
structureAsk(TOKEN, PID, user_id, version)

chapter 是关卡
mission 是小关卡 冲就完事了

里面 equipList 里面是装备 可以刷装备 coin,jewel分别是 铜币和金币 可以撸 不耗体力
attribute,entryNum 这俩参数应该是装备品质问题,弄太高了得到的装备属性会溢出点装备上面导致游戏卡死按我参数就是最nb品质最高的的装备了

TOKEN = “”
PID = “”
user_id =
这三个参数 抓一下就出来了

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理(doubaiwang@126.com)。