原本帖子已经发到编程语言求助区了,发了半天没人回复。
感觉还是编程语言区对这个东西更感兴趣,同时也希望大佬去分析一下这。
原来的帖子
分析调试某qiyi直播源【未完成】
其中的那个js文件的结构,是一个嵌套的自执行函数
!function(a){
console.log(a)
}(function(b){
console.log(b)
return b.aaa
}({"aaa": "123"}))
输出结果
>>> {aaa: "123"}
>>> 123
>>> true
加密
e = [1635266923,
1919119467,
1784836965,
858941800,
930705530,
2037344368,
859321649,
875640883,
959525171,
32821,
296],t = 296, i = 1631100069
function encode(e, t, i) {
"use strict";
var n;
(n = function(e, t, i) {
function s(e, t, i, n, o, r) {
return g(function a(e, t) {
return e << t | e >>> 32 - t
}(g(g(t, e), g(n, r)), o), i)
}
function d(e, t, i, n, o, r, a) {
return s(t & i | ~t & n, e, t, o, r, a)
}
function p(e, t, i, n, o, r, a) {
return s(t & n | i & ~n, e, t, o, r, a)
}
function h(e, t, i, n, o, r, a) {
return s(t ^ i ^ n, e, t, o, r, a)
}
function _(e, t, i, n, o, r, a) {
return s(i ^ (t | ~n), e, t, o, r, a)
}
function g(e, t) {
var i = (65535 & e) + (65535 & t);
return (e >> 16) + (t >> 16) + (i >> 16) << 16 | 65535 & i
}
i.exports = function(e) {
return function o(e) {
for (var t = "0123456789abcdef", i = "", n = 0; n < 4 * e.length; n++)
i += t.charAt(e[n >> 2] >> n % 4 * 8 + 4 & 15) + t.charAt(e[n >> 2] >> n % 4 * 8 & 15);
return i
}(function f(e, t) {
e[t >> 5] |= 128 << t % 32,
e[14 + (t + 64 >>> 9 << 4)] = t;
for (var i = 1732584193, n = -271733879, o = -1732584194, r = 271733878, a = 0; a < e.length; a += 16) {
var s = i
, l = n
, c = o
, u = r;
n = _(n = _(n = _(n = _(n = h(n = h(n = h(n = h(n = p(n = p(n = p(n = p(n = d(n = d(n = d(n = d(n, o = d(o, r = d(r, i = d(i, n, o, r, e[a + 0], 7, -680876936), n, o, e[a + 1], 12, -389564586), i, n, e[a + 2], 17, 606105819), r, i, e[a + 3], 22, -1044525330), o = d(o, r = d(r, i = d(i, n, o, r, e[a + 4], 7, -176418897), n, o, e[a + 5], 12, 1200080426), i, n, e[a + 6], 17, -1473231341), r, i, e[a + 7], 22, -45705983), o = d(o, r = d(r, i = d(i, n, o, r, e[a + 8], 7, 1770035416), n, o, e[a + 9], 12, -1958414417), i, n, e[a + 10], 17, -42063), r, i, e[a + 11], 22, -1990404162), o = d(o, r = d(r, i = d(i, n, o, r, e[a + 12], 7, 1804603682), n, o, e[a + 13], 12, -40341101), i, n, e[a + 14], 17, -1502002290), r, i, e[a + 15], 22, 1236535329), o = p(o, r = p(r, i = p(i, n, o, r, e[a + 1], 5, -165796510), n, o, e[a + 6], 9, -1069501632), i, n, e[a + 11], 14, 643717713), r, i, e[a + 0], 20, -373897302), o = p(o, r = p(r, i = p(i, n, o, r, e[a + 5], 5, -701558691), n, o, e[a + 10], 9, 38016083), i, n, e[a + 15], 14, -660478335), r, i, e[a + 4], 20, -405537848), o = p(o, r = p(r, i = p(i, n, o, r, e[a + 9], 5, 568446438), n, o, e[a + 14], 9, -1019803690), i, n, e[a + 3], 14, -187363961), r, i, e[a + 8], 20, 1163531501), o = p(o, r = p(r, i = p(i, n, o, r, e[a + 13], 5, -1444681467), n, o, e[a + 2], 9, -51403784), i, n, e[a + 7], 14, 1735328473), r, i, e[a + 12], 20, -1926607734), o = h(o, r = h(r, i = h(i, n, o, r, e[a + 5], 4, -378558), n, o, e[a + 8], 11, -2022574463), i, n, e[a + 11], 16, 1839030562), r, i, e[a + 14], 23, -35309556), o = h(o, r = h(r, i = h(i, n, o, r, e[a + 1], 4, -1530992060), n, o, e[a + 4], 11, 1272893353), i, n, e[a + 7], 16, -155497632), r, i, e[a + 10], 23, -1094730640), o = h(o, r = h(r, i = h(i, n, o, r, e[a + 13], 4, 681279174), n, o, e[a + 0], 11, -358537222), i, n, e[a + 3], 16, -722521979), r, i, e[a + 6], 23, 76029189), o = h(o, r = h(r, i = h(i, n, o, r, e[a + 9], 4, -640364487), n, o, e[a + 12], 11, -421815835), i, n, e[a + 15], 16, 530742520), r, i, e[a + 2], 23, -995338651), o = _(o, r = _(r, i = _(i, n, o, r, e[a + 0], 6, -198630844), n, o, e[a + 7], 10, 1126891415), i, n, e[a + 14], 15, -1416354905), r, i, e[a + 5], 21, -57434055), o = _(o, r = _(r, i = _(i, n, o, r, e[a + 12], 6, 1700485571), n, o, e[a + 3], 10, -1894986606), i, n, e[a + 10], 15, -1051523), r, i, e[a + 1], 21, -2054922799), o = _(o, r = _(r, i = _(i, n, o, r, e[a + 8], 6, 1873313359), n, o, e[a + 15], 10, -30611744), i, n, e[a + 6], 15, -1560198380), r, i, e[a + 13], 21, 1309151649), o = _(o, r = _(r, i = _(i, n, o, r, e[a + 4], 6, -145523070), n, o, e[a + 11], 10, -1120210379), i, n, e[a + 2], 15, 718787259), r, i, e[a + 9], 21, -343485551),
i = g(i, s),
n = g(n, l),
o = g(o, c),
r = g(r, u)
}
return Array(i, n, o, r)
}(function n(e) {
for (var t = Array(), i = 0; i < 8 * e.length; i += 8)
t[i >> 5] |= (255 & e.charCodeAt(i / 8)) << i % 32;
console.log(t)
return t
}(e), 8 * e.length))
}
}
.call(t, i, t, e)) === undefined || (e.exports = n)
}
">>"右移运算符, "<<"左移运算符
例如:
8的二进制为 1000, 8 << 2 的值为 二进制100000, 得出十进制为32
8 >> 2 的值为 二进制 10, 得出十进制为 2
不知道这样算不算违规。。。单纯就是想找人一起分析分析这个东西