【WP】猿人学4 雪碧图、样式干扰

https://match.yuanrenxue.cn/match/4

探索

image-20240419004952868

首先打开Fiddler,发现每个包的除了page参数一样,然后重放攻击可以实现,尝试py复现

img

Python可以正常拿到数据,这题不考请求,这题的难点原来在于数据的加密,这些数字都是图片展示的

img_1

数据中有ivkey,应该会对图片进行解密操作

后面发现实际上是只使用了 key value iv可能是为了混淆视听

img_2

既然如此,网站肯定会对图片做处理,那肯定是根据图片的类做选择。
我就根据图片的类 .img_number查找,只能找到一处,跟到此处打上断点

img_4

说明俩断点中间实现数据操作了,通过分析发现,中途会给图片们加上一个哈希值作为类,然后通过隐藏某些类对应的图片实现数据展示,那只要找到对应的set类的地方就行了

img_5

研究发现这个类其实是在返回的数据包中,那我们计算出j_key这个哈希对应的图片我们不要,剩下的就是我们需要的数据了

因为其实现是通过设置某些图片不可见来显示剩余的图片,源代码: $(j_key).css('display', 'none');

img_6

然后先把这个计算j_key的逻辑扣下来,加上上面的加密函数

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;elsestr += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F)}}return str
}function sdk(key, value) {return j_key = '.' + hex_md5(btoa(key + value).replace(/=/g, ''));
}

先写死keyvalue能拿到数据

img_7

实现

然后一个数是在一个td中使用img拼起来的,而且并且不一定是四个数字,这里可以直接使用Pythonparsel模块解析HTML然后使用css selector语法提取需要的内容

key = response.json()['key']
value = response.json()['value']
data = response.json()['info']js_code = open("sdk.js", mode="r", encoding="utf8").read()
compile = execjs.compile(js_code)
j_key = compile.call("sdk", key, value)
print(j_key)selector = parsel.Selector(data)
tds = selector.css("td")
for td in tds:imgs = td.css("img")for img in imgs:img_class = img.css("::attr(class)").get()print(img_class)
.59f667144b2647d2ed9822c1607c7dd9
img_number 59f667144b2647d2ed9822c1607c7dd9
img_number 59f667144b2647d2ed9822c1607c7dd9
img_number 59f667144b2647d2ed9822c1607c7dd9
img_number 59f667144b2647d2ed9822c1607c7dd9
img_number 59f667144b2647d2ed9822c1607c7dd9
img_number 9a97329f3eb50018030e46e308bdf03a
img_number 9a97329f3eb50018030e46e308bdf03a
img_number 59f667144b2647d2ed9822c1607c7dd9
img_number 9a97329f3eb50018030e46e308bdf03a
img_number 9a97329f3eb50018030e46e308bdf03a

然后根据类判断是否是显示的图片,然后可以使用机器学习的ocr识别图片的数字内容,这里推荐使用ddddocr,是一个开源的Python模块,写成一个函数,传入二进制图片数据或者base64数据皆可

pip install ddddocr
def get_number_str(img_bytes):ocr = ddddocr.DdddOcr(show_ad=False)return ocr.classification(img_bytes)

然后得到了每一组数字,但是顺序是不对的

selector = parsel.Selector(data)
tds = selector.css("td")
for td in tds:num_str = ""imgs = td.css("img")for img in imgs:img_class = img.css("::attr(class)").get()if not j_key[1:] in img_class:img_base64 = img.css("::attr(src)").get().split("data:image/png;base64,")[-1]num_str += get_number_str(img_base64)print(num_str,end=" ")
0681 4291 7738 7639 0645 9688 703 8434 8307 8988 
6081 2914 ....

这个顺序实际上是根据style设置的left值来确定的,我们提取一下

 for img in imgs:img_class = img.css("::attr(class)").get()img_style = img.css("::attr(style)").get()if not j_key[1:] in img_class:img_base64 = img.css("::attr(src)").get().split("data:image/png;base64,")[-1]# num_str += get_number_str(img_base64)print(get_number_str(img_base64), img_style)# print(num_str, end=" ")print()
6 left:0.0px
8 left:11.5px
0 left:-11.5px
1 left:0px9 left:11.5px
2 left:-11.5px
1 left:0.0px
4 left:0px7 left:0px
8 left:23.0px
7 left:0.0px
3 left:-23.0px6 left:0px
3 left:11.5px
7 left:-11.5px
9 left:0.0px0 left:11.5px
6 left:23.0px
4 left:-23.0px
5 left:-11.5px9 left:0px
8 left:11.5px
6 left:-11.5px
8 left:0.0px0 left:11.5px
3 left:-11.5px
7 left:0.0px4 left:34.5px
8 left:-11.5px
4 left:-11.5px
3 left:-11.5px0 left:23.0px
3 left:-11.5px
7 left:11.5px
8 left:-23.0px9 left:23.0px
8 left:-11.5px
8 left:11.5px
8 left:-23.0px

一个数字图片占11.5px,如果+就是右移,-就是左移, 0就是不做操作,计算出偏移量再据此放入字符容器

for td in tds:imgs = td.css('img:not(' + j_key + ')')nums = [""] * len(imgs)for index, img in enumerate(imgs):img_style_float = img.css("::attr(style)").get()[5:-2]img_base64 = img.css("::attr(src)").get().split("data:image/png;base64,")[-1]num_str = get_number_str(img_base64)move = int(float(img_style_float) / 11.5)nums[index + move] = num_strprint(nums)

需要注意一点,如果这个哈希值恰好以数字开头使用 imgs = td.css('img:not(' + j_key + ')')这种写法就会报错,所以后面我改成了其他写法

['6', '0', '8', '1']
['2', '9', '1', '4']
['7', '3', '7', '8']
['6', '7', '3', '9']
['4', '0', '5', '6']
['9', '6', '8', '8']
['3', '0', '7']
['8', '4', '3', '4']
['3', '8', '0', '7']
['8', '8', '9', '8']

剩下的逻辑就不啰嗦了,我直接写完

img_9

完整代码

import ddddocr
import execjs
import parsel
import requestsdef get_number_str(img_bytes):ocr = ddddocr.DdddOcr(show_ad=False)return ocr.classification(img_bytes)final_ret = 0headers = {"Host": "match.yuanrenxue.cn","Connection": "keep-alive","sec-ch-ua": "\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\"","Accept": "application/json, text/javascript, */*; q=0.01","X-Requested-With": "XMLHttpRequest","sec-ch-ua-mobile": "?0","User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","sec-ch-ua-platform": "\"Windows\"","Sec-Fetch-Site": "same-origin","Sec-Fetch-Mode": "cors","Sec-Fetch-Dest": "empty","Referer": "https://match.yuanrenxue.cn/match/4","Accept-Language": "zh-CN,zh;q=0.9"
}
cookies = {"sessionid": "729kf3d812ke104yb3zif4jt1talnpul","Hm_lvt_9bcbda9cbf86757998a2339a0437208e": "1713458949","Hm_lpvt_9bcbda9cbf86757998a2339a0437208e": "1713458949","Hm_lvt_c99546cf032aaa5a679230de9a95c7db": "1713458949","Hm_lpvt_c99546cf032aaa5a679230de9a95c7db": "1713458949","qpfccr": "true","no-alert3": "true"
}
url = "https://match.yuanrenxue.cn/api/match/4"
for page_index in range(1, 6):params = {"page": str(page_index)}response = requests.get(url, headers=headers, cookies=cookies, params=params, verify=False)# print(response.json())key = response.json()['key']value = response.json()['value']data = response.json()['info']js_code = open("sdk.js", mode="r", encoding="utf8").read()compile = execjs.compile(js_code)j_key = compile.call("sdk", key, value)print(j_key)selector = parsel.Selector(data)tds = selector.css("td")for td in tds:imgs = [img for img in td.css("img") if j_key[1:] not in img.css("::attr(class)").get()]nums = [""] * len(imgs)for index, img in enumerate(imgs):img_style_float = img.css("::attr(style)").get()[5:-2]img_base64 = img.css("::attr(src)").get().split("data:image/png;base64,")[-1]num_str = get_number_str(img_base64)move = int(float(img_style_float) / 11.5)nums[index + move] = num_strnum = ''.join(nums)print(num)final_ret += int(num)
print(final_ret)
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;elsestr += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F)}}return str
}function sdk(key, value) {return j_key = '.' + hex_md5(btoa(key + value).replace(/=/g, ''));
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/364.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

用10个Kimichat提示词5分钟创建一门在线课程

●研究市场并在生成式AI主题内找到一个特定细分市场&#xff0c;这一市场尚未被现有课程充分覆盖。使用在线研究来收集关于当前可用课程类型的信息&#xff0c;以及市场上存在哪些空白。利用这些信息创建一个填补空白并吸引对“生成式AI”感兴趣的特定受众群体的课程。确定课程…

面试经典算法系列之二叉树17 -- 验证二叉树

面试经典算法32 - 验证二叉树 LeetCode.98 公众号&#xff1a;阿Q技术站 问题描述 给你一个二叉树的根节点 root &#xff0c;判断其是否是一个有效的二叉搜索树。 有效 二叉搜索树定义如下&#xff1a; 节点的左子树只包含 小于 当前节点的数。节点的右子树只包含 大于 当…

ActiveMQ 如果数据处理出现异常会怎么样

我们有一个 Spring 的客户端&#xff0c;在处理消息的时候因为程序的原因出现消息处理异常。 对这种情况&#xff0c;ActiveMQ 会把出现异常的消息放在 DLQ 队列中进行持久化。 因此&#xff0c;在 ActiveMQ 消息处理队列中需要持续关注 DLQ 队列&#xff0c; DLQ 的队列都是无…

生成人工智能体:人类行为的交互式模拟论文与源码架构解析(5)——可控评估端到端评估

最后完结篇,文末有测试中发现的有趣现象,并附上了相关资料链接~ 5.可控评估 分两个阶段评估生成代理。我们从一个更加严格控制的评估开始,单独评估代理的响应,以了解它们是否在狭义上定义的上下文中产生可信的行为。然后,在我们对代理社区进行为期两天的端到端分析中,我…

蓝桥杯2024年第十五届省赛真题-数字接龙

思路&#xff1a;DFS&#xff0c;因为输入的i&#xff0c;j的顺序导致&#xff0c;方向向量中x是行编号&#xff0c;y是列编号。方向向量可能和直觉上不同。 错的 //int dx[8]{0,1,1,1,0,-1,-1,-1}; //int dy[8]{1,1,0,-1,-1,-1,0,1}; 对的 int dx[]{-1,-1,0,1,1,1,0,-1}; int…

数据结构(顺序栈

目录 1. 讲解&#xff1a;2. C代码实现&#xff1a;小结&#xff1a; 1. 讲解&#xff1a; 用顺序的物理结构&#xff08;数组&#xff09;存储栈这个数据结构&#xff0c;实现栈的创建、销毁、增删查、判空。 top指针的指向位置有两种实现方法&#xff1a;一个是指向栈顶元素…

页缓存(PageCache)和预读机制(readahead )

页缓存&#xff08;PageCache)和预读机制&#xff08;readahead &#xff09; 页缓存&#xff08;PageCache)是操作系统&#xff08;OS&#xff09;对文件的缓存&#xff0c;用于加速对文件的读写。 page 是内存管理分配的基本单位&#xff0c; Page Cache 由多个 page 构成&…

《Super Simple Skybox》天空盒 -- 创造绝美天空的神奇工具!限时免费!

《Super Simple Skybox》天空盒 -- 创造绝美天空的神奇工具&#xff01;限时免费&#xff01; 前言内容介绍资源特色动态&#xff0c;美丽的天空在几秒钟内即插即用 功能列表领取兑换码 前言 ^^在这个充满创意与想象的世界里&#xff0c;Unity 免费资源犹如一颗璀璨的明珠&…

react合成事件与原生事件区别备忘

朋友问起在做一个下拉框组件&#xff0c;下拉的点击事件是用react的onClick触发&#xff0c;外部区域点击关闭则用dom的原生点击事件绑定&#xff0c;问题是下拉的点击事件无法阻止冒泡到dom的原生事件。 我说&#xff0c;react的合成事件 和 原生事件是不一样的&#xff0c;尽…

三、fpga对完成过滤和校验的有效包数据进行有效像素提取、MATLAB对数据源进行处理与下发(完整实现pc机→显示器通信链路)

前言:上篇文章实现了MATLAB模拟发送UDP以太网协议数据包到fpga,能实现双沿数据→单沿数据转换,并将转换后的数据进行包过滤和crc校验,本篇内容要实现真正的从pc机下发视频数据,经过千兆以太网传输存储到fpga 的ddr3中,然后通过hdmi读出到显示屏上。 文章目录 一、模块设…

鸿蒙入门06-常见装饰器( 简单装饰器 )

装饰器是鸿蒙开发中非常重要的一个环节因为在很多地方我们都需要用到装饰器并且如果我们想高度的复用, 那么装饰器就是必不可少的一环接下来我们就来介绍一些常见的装饰器注意 : 所有装饰器首字母大写 Entry 用来装饰 struct 使用表示页面的入口 Component 装饰 struct, …

基于Springboot的论坛管理系统

基于SpringbootVue的论坛管理系统的设计与实现 开发语言&#xff1a;Java数据库&#xff1a;MySQL技术&#xff1a;SpringbootMybatis工具&#xff1a;IDEA、Maven、Navicat 系统展示 用户登录 首页 公告 热门帖子 论坛新天地 新闻资讯 留言反馈 后台登录 用户管理 公告管理…

java宠物领养系统的设计与实现(springboot+mysql+源码)

风定落花生&#xff0c;歌声逐流水&#xff0c;大家好我是风歌&#xff0c;混迹在java圈的辛苦码农。今天要和大家聊的是一款基于springboot的宠物领养系统的设计与实现。项目源码以及部署相关请联系风歌&#xff0c;文末附上联系信息 。 项目简介&#xff1a; 基于Spring Bo…

JavaWeb--04YApi,Vue-cli脚手架Node.js环境搭建,创建第一个Vue项目

04 1 Yapi2 Vue-cli脚手架Node.js环境搭建配置npm的全局安装路径 3 创建项目&#xff08;这个看下一篇文章吧&#xff09; 1 Yapi 前后端分离中的重要枢纽"接口文档",以下一款为Yapi的接口文档 介绍&#xff1a;YApi 是高效、易用、功能强大的 api 管理平台&#…

Springboot引入外部jar包并打包jar包

前言 spring boot项目开发过程中难免需要引入外部jar包&#xff0c;下面将以idea为例说明操作步骤 将需要的jar包导入到项目中 2.在maven中引入jar包 <dependency><groupId>com</groupId><!--随便填的文件夹名称--><artifactId>xxx</artif…

linux内核初始化成功后是如何过渡到android初始化的

Android用的linux内核&#xff0c;以完成OS该有的功能&#xff0c;例如&#xff0c;文件系统&#xff0c;网络&#xff0c;内存管理&#xff0c;进程调度&#xff0c;驱动等 &#xff0c;向下管理硬件资源向上提供系统调用。另一些Android特有驱动也放在内核之中。 当linux内核…

【Qt】Qt安装包、源码、子模块(submodules)下载

1、Qt 4.0 ~ Qt5.14 Qt 4.0 ~ Qt5.14 离线安装包、源码和子模块(submodules)源码下载路径: https://download.qt.io/new_archive/qt/以Qt5.7.1为例,注意子模块都是源码,需要独立编译 2、Qt5.15 ~ Qt6.7 Qt5.15 ~ Qt6.7源码和子模块(submodules)源码下载路径: htt…

LabVIEW供热管道泄漏监测与定位

LabVIEW供热管道泄漏监测与定位 在现代城市的基础设施建设中&#xff0c;供热管道系统起着极其重要的作用。然而&#xff0c;管道泄漏问题不仅导致巨大的经济损失&#xff0c;还对公共安全构成威胁。因此&#xff0c;开发一种高效、准确的管道泄漏监测与定位技术显得尤为关键。…

GUI02-在窗口上跟踪并输出鼠标位置(Win32版)

(1) 响应 WM_MOUSEMOVE 消息获得鼠标位置&#xff1b; (2) 响应 WM_PAINT 将鼠标位置输出到窗口中&#xff1b; (3) 学习二者之间的关键步骤&#xff1a;调用 InvalidateRect() 以通知窗口重绘。 零. 课堂视频 在窗口上跟踪输出鼠标位置-Win32版 一、关键知识点 1. BeginPaint…

HANA SQL消耗内存和CPU线程的限制参数

HANA再处理大数据表相关的复杂Sql时&#xff0c;如果没有设置Memory和CPU线程上限的话&#xff0c;会将HANA的资源占用殆尽&#xff0c;造成HANA无法响应其他Sql请求&#xff0c;导致表现在应用服务器上就是系统卡顿的情况。解决上述问题的办法就是按照下图设置Memory(图1&…