不会css嗯写猿人学第四题

不会css嗯写猿人学第四题

首先是经典的五个页面求数字和
点击一个页面看它的请求
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/a70694605af74ca993aaa64d7841cde8.png在这里插入图片描述
看到有几个参数,看到返回的info就是题中所给数字的图片URL组合,而图片的链接就是左侧请求得到的(Base64编码的URL)。但是此时呢按照这个info所给的URL顺序输出数字,发现会多出来很多数字,这是怎么会是呢?
在这里插入图片描述
点击启动器看看调用堆栈
在这里插入图片描述
看到request请求信息都是一行,按左下角这个花括号可以格式化一下代码
在这里插入图片描述
看到这个j_key是由返回的key和value参数生成的,下面有另一个参数img_number,查看一下这两个参数的生成过程,j_key就是简单的调用两个函数传参key,value生成的,img_number由于楼主水平有限看得生成过程云里雾里便没有坚强的观察下去。但是可以从这个display none的参数可以看出一二,有些数字图片被隐藏了。

在这里插入图片描述
随即点开页面图片的元素查看一番,果然有些被雪藏。而在img_number的生成过程中可以发现有这个class的元素,猜测是否隐藏与这个class的元素的内容有关,果然这些class元素都包含j_key.就可以排除掉这些数字图片了。
最终输出代码发现这些数字虽然是对的,但是顺序不太对。
所以开始了楼主嗯写这些数字排序的过程。
观察了一下排序规则,0px是固定的,34px会连带着几个11px(此时只用排序34px的位置),像这种[{‘23’: ‘8’}, {‘-11’: ‘8’}, {‘11’: ‘4’}, {‘-23’: ‘6’}],需要把23px和-23px的数字替换位置,再把绝对值为11px的数字和绝对值为23px的数字相邻数字替换位置,最终得到结果。
下面献出楼主丑陋的代码一份:

import json
import re

import execjs
import requests
def getPage(page):
    sum = 0
    url = f"https://match.yuanrenxue.cn/api/match/4?page={page}"

    nums = {
        "iVBORw0KGgoAAAANSUhEUgAAABQAAAAdCAYAAACqhkzFAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAANtSURBVEhLrZXfS1NhGMe/rumZbR4nOcO2IA1CvQi8UW8y8EJqZCR1IQiKwvRCuiqTfomtkkrqIpN+EF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ygMjXtzj5kgLCtaOeg3+fQNnR/u1pMaatRUVkYwHxyYfo9pwQTdpncnjol24o0PMpg74Rv6HCZbqC41/y6OG1QeKdpSGZO1HcRGz+FRKpyzgzlaUnXoB/3J2gmVZucHAAAAAASUVORK5CYII=": 5
    }

    payload = {}
    headers = {
        'priority': 'u=0, i',
        'x-requested-with': 'XMLHttpRequest',
        'Cookie': 'Hm_lvt_c99546cf032aaa5a679230de9a95c7db=1717469283,1718181415,1718268251,1718933983; Hm_lvt_9bcbda9cbf86757998a2339a0437208e=1718074870,1718181420,1718603416,1718933984; no-alert3=true; tk=-8813438152112410843; sessionid=9xjdnd0r7d90qy18slk3ogwomjh5206j; m=e6b71e2f7f77268517b82ccbb6931a16|1718959350000; Hm_lvt_434c501fe98c1a8ec74b813751d4e3e3=1718603362,1719214314; Hm_lpvt_434c501fe98c1a8ec74b813751d4e3e3=1719214327; Hm_lpvt_9bcbda9cbf86757998a2339a0437208e=1719214410; Hm_lpvt_c99546cf032aaa5a679230de9a95c7db=1719214962',
        'User-Agent': 'Apifox/1.0.0 (https://apifox.com)'
    }
    with open('y4.js', 'r', encoding='utf-8') as f:
        y4 = f.read()
    response = requests.request("GET", url, headers=headers, data=payload)

    res_json = json.loads(response.text)
    encrypted = execjs.compile(y4).call('get_j_key', res_json['key'], res_json['value'])
    encrypted = str.replace(encrypted, '.', '')
    # print(encrypted)

    res_list = res_json['info'].split("<td>")
    res_list = [i for i in res_list if i]
    res_num = []
    for i in res_list:
        nums_list = []
        num = [j for j in i.split("src=") if j]
        num1 = ''
        for j in num:
            # print(j)
            if encrypted in j:
                continue
            match = re.findall(r'style="left:(-?\d+)', j)
            if not match:
                continue
            for k, v in nums.items():
                if k in j:
                    num1 = str(v)
                    break
                    # print(v)
            nums_list.append({match[0]: num1})
        # print(nums_list)
        flag = 1
        for d in nums_list:
            for k, v in d.items():
                if k == '0':
                    flag = 0
                    break
                if k == '34' or k == '-34':
                    flag = 2
                    break
        new_list = []

        if flag == 0:
            new_list = []

            swap_num = -1
            for d in nums_list:
                for k, v in d.items():
                    if k == '0':
                        new_list.append(v)
                    else:
                        if swap_num == -1:
                            swap_num = v
                            new_list.append("-99")
                        else:
                            new_list.append(swap_num)
                            for ch in range(0, len(new_list)):
                                if new_list[ch] == '-99':
                                    new_list[ch] = v
                                    break
            # print(new_list)
        if flag == 1:
            # print(j)
            new_list = []
            ff = {}
            for d in nums_list:
                ff.update(d)
            first = -1
            second = -1
            for k, v in ff.items():
                if first == -1:
                    first = k
                elif second == -1:
                    second = k
            if abs(int(first)) == 23:
                xxxx = ff.get(str(int(first)))
                ff.update({first:ff.get(str(int(first) * (-1))) })
                ff.update({str(int(first) * -1):xxxx})
            if abs(int(second)) == 23:
                xxxx = ff.get(str(int(second)))
                ff.update({second:ff.get(str(int(second) * (-1))) })
                ff.update({str(int(second) * -1):xxxx})

            new_list.append(ff.get(second))
            new_list.append(ff.get(first))
            if len(ff) > 2:
                new_list.append(ff.get(str(int (first) * (-1))))
                new_list.append(ff.get(str(int (second) * (-1))))
            # new_list.append(ff.get("-23"))
            # new_list.append(ff.get("11"))
            # new_list.append(ff.get("-11"))
            # new_list.append(ff.get("23"))
        if flag == 2:
            new_list = []
            x = -1
            y = -1
            for d in nums_list:
                for k , v in d.items():
                    if k == "-11" or k == "11":
                        new_list.append(v)
                    else :
                        if k == "34":
                            x = v
                        if k == "-34":
                            y = v

            if x != -1:
                new_list.append(x)
            if y != -1:
                sss = []
                sss.append(v)
                for sd in new_list:
                    sss.append(sd)

                new_list = sss
                print(new_list , ' ssssssssssssssssssss')
        # print(new_list)
        num = ''
        for number in new_list:
            if number:
                num += number
        print(nums_list)
        print(num)
        sum += int(num)

    print(page , ' : ' , int(sum))
    return int(sum)
sum = 0
# 246986
for times in range(1,6):
    sum += getPage(times)
print(sum)

js代码: 命名 y4.js

var hexcase = 0;
var b64pad = "";
var chrsz = 8;

function hex_md5(s) {
    return binl2hex(core_md5(str2binl(s), s.length * chrsz))
}

function b64_md5(s) {
    return binl2b64(core_md5(str2binl(s), s.length * chrsz))
}

function str_md5(s) {
    return binl2str(core_md5(str2binl(s), s.length * chrsz))
}

function hex_hmac_md5(key, data) {
    return binl2hex(core_hmac_md5(key, data))
}

function b64_hmac_md5(key, data) {
    return binl2b64(core_hmac_md5(key, data))
}

function str_hmac_md5(key, data) {
    return binl2str(core_hmac_md5(key, data))
}

function md5_vm_test() {
    return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"
}

function core_md5(x, len) {
    x[len >> 5] |= 0x80 << ((len) % 32);
    x[(((len + 64) >>> 9) << 4) + 14] = len;
    var a = 1732584193;
    var b = -271733879;
    var c = -1732584194;
    var d = 271733878;
    for (var i = 0; i < x.length; i += 16) {
        var olda = a;
        var oldb = b;
        var oldc = c;
        var oldd = d;
        a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
        d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
        c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
        b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
        a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
        d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
        c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
        b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
        a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
        d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
        c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
        b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
        a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
        d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
        c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
        b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
        a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
        d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
        c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
        b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
        a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
        d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
        c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
        b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
        a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
        d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
        c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
        b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
        a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
        d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
        c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
        b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
        a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
        d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
        c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
        b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
        a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
        d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
        c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
        b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
        a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
        d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
        c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
        b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
        a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
        d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
        c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
        b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
        a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
        d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
        c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
        b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
        a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
        d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
        c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
        b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
        a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
        d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
        c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
        b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
        a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
        d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
        c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
        b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
        a = safe_add(a, olda);
        b = safe_add(b, oldb);
        c = safe_add(c, oldc);
        d = safe_add(d, oldd)
    }
    return Array(a, b, c, d)
}

function md5_cmn(q, a, b, x, s, t) {
    return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
}

function md5_ff(a, b, c, d, x, s, t) {
    return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
}

function md5_gg(a, b, c, d, x, s, t) {
    return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
}

function md5_hh(a, b, c, d, x, s, t) {
    return md5_cmn(b ^ c ^ d, a, b, x, s, t)
}

function md5_ii(a, b, c, d, x, s, t) {
    return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
}

function core_hmac_md5(key, data) {
    var bkey = str2binl(key);
    if (bkey.length > 16)
        bkey = core_md5(bkey, key.length * chrsz);
    var ipad = Array(16)
        , opad = Array(16);
    for (var i = 0; i < 16; i++) {
        ipad[i] = bkey[i] ^ 0x36363636;
        opad[i] = bkey[i] ^ 0x5C5C5C5C
    }
    var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
    return core_md5(opad.concat(hash), 512 + 128)
}

function safe_add(x, y) {
    var lsw = (x & 0xFFFF) + (y & 0xFFFF);
    var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
    return (msw << 16) | (lsw & 0xFFFF)
}

function bit_rol(num, cnt) {
    return (num << cnt) | (num >>> (32 - cnt))
}

function str2binl(str) {
    var bin = Array();
    var mask = (1 << chrsz) - 1;
    for (var i = 0; i < str.length * chrsz; i += chrsz)
        bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32);
    return bin
}

function binl2str(bin) {
    var str = "";
    var mask = (1 << chrsz) - 1;
    for (var i = 0; i < bin.length * 32; i += chrsz)
        str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask);
    return str
}

function binl2hex(binarray) {
    var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
    var str = "";
    for (var i = 0; i < binarray.length * 4; i++) {
        str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)
    }
    return str
}

function binl2b64(binarray) {
    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var str = "";
    for (var i = 0; i < binarray.length * 4; i += 3) {
        var triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16) | (((binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8) | ((binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF);
        for (var j = 0; j < 4; j++) {
            if (i * 8 + j * 6 > binarray.length * 32)
                str += b64pad;
            else
                str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F)
        }
    }
    return str
}

function get_j_key(k, v) {
    return '.' + hex_md5(btoa(k + v).replace(/=/g, ''))
}

var j_key = get_j_key("9x12mdv38o", "at1InN5x2f");
// css('display', 'none')
console.log(j_key)

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值