|
楼主 |
发表于 2022-1-19 10:45
|
显示全部楼层
接上面,JS部分
这个sign的计算函数在提取的时候注意2点:
1. 要把上面2个附带的小函数一同取出(其实就是主函数的子函数)
2. 其中,参数是查询的值,但其内部还有取一个window全局变量中的一个值,具体如下:
在VBA中运行时,并没有浏览器环境,但可以取到window.gtk,所以,可以稍微改写下整个函数,然后测试一下:
整个改写后的Js代码如下:可调用函数e,例如:var sign = e(查询的词 , 获取的gtk值)
- function a(r) {
- if (Array.isArray(r)) {
- for (var o = 0, t = Array(r.length); o < r.length; o++)
- t[o] = r[o];
- return t;
- }
- return Array.from(r);
- }
- function n(r, o) {
- for (var t = 0; t < o.length - 2; t += 3) {
- var a = o.charAt(t + 2);
- a = a >= "a" ? a.charCodeAt(0) - 87 : Number(a),
- a = "+" === o.charAt(t + 1) ? r >>> a : r << a,
- r = "+" === o.charAt(t) ? r + a & 4294967295 : r ^ a
- }
- return r;
- }
- function e(r, gtk) {
- var o = r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g);
- var i = null;
- if (null === o) {
- var t = r.length;
- t > 30 && (r = "" + r.substr(0, 10) + r.substr(Math.floor(t / 2) - 5, 10) + r.substr(-10, 10))
- } else {
- for (var e = r.split(/[\uD800-\uDBFF][\uDC00-\uDFFF]/), C = 0, h = e.length, f = []; h > C; C++)
- "" !== e[C] && f.push.apply(f, a(e[C].split(""))),
- C !== h - 1 && f.push(o[C]);
- var g = f.length;
- g > 30 && (r = f.slice(0, 10).join("") + f.slice(Math.floor(g / 2) - 5, Math.floor(g / 2) + 5).join("") + f.slice(-10).join(""))
- }
- var u = void 0,
- u = null !== i ? i : (i = gtk || "") || "";
- for (var d = u.split("."), m = Number(d[0]) || 0, s = Number(d[1]) || 0, S = [], c = 0, v = 0; v < r.length; v++) {
- var A = r.charCodeAt(v);
- 128 > A ? S[c++] = A : (2048 > A ? S[c++] = A >> 6 | 192 : (55296 === (64512 & A) && v + 1 < r.length && 56320 === (64512 & r.charCodeAt(v + 1)) ? (A = 65536 + ((1023 & A) << 10) + (1023 & r.charCodeAt(++v)),
- S[c++] = A >> 18 | 240,
- S[c++] = A >> 12 & 63 | 128) : S[c++] = A >> 12 | 224,
- S[c++] = A >> 6 & 63 | 128),
- S[c++] = 63 & A | 128);
- }
- for (var p = m, F = "" + String.fromCharCode(43) + String.fromCharCode(45) + String.fromCharCode(97) + ("" + String.fromCharCode(94) + String.fromCharCode(43) + String.fromCharCode(54)), D = "" + String.fromCharCode(43) + String.fromCharCode(45) + String.fromCharCode(51) + ("" + String.fromCharCode(94) + String.fromCharCode(43) + String.fromCharCode(98)) + ("" + String.fromCharCode(43) + String.fromCharCode(45) + String.fromCharCode(102)), b = 0; b < S.length; b++)
- p += S[b],
- p = n(p, F);
- return p = n(p, D),
- p ^= s,
- 0 > p && (p = (2147483647 & p) + 2147483648),
- p %= 1e6,
- p.toString() + "." + (p ^ m);
- }
复制代码 至此,所有的Post数据就全部找到了,就可以进行下一步利用VBA发送请求了,待续。。。。。。
|
评分
-
1
查看全部评分
-
|