![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
function d(t) { var e = new a_default(t); e.init(t.substr(0, 4)); var r = e.decode(t); return Buffer.from(r, "base64").toString("utf8") } f_list = [{ key: "getChar", value: function() { return this._char } }, { key: "getChildren", value: function() { return this._children } }, { key: "setChar", value: function(t) { this._char = t } }, { key: "setChildren", value: function(t, e) { this._children[t] = e } }] function f(key) { i.call(this, key), this._char = ".", this._children = {} f_list.forEach(function(funDec) { this[funDec.key] = funDec.value }, this) } s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" c = [1, 2, 2, 2, 2, 2] var a_list = [{ key: "init", value: function(t) { var e = this; this._random.seed(t), this._sign = t, loop(64, function(t) { e._addSymbol("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [t], c[parseInt((t + 1) / 11)]) }), this._inter["="] = "=" } }, { key: "_addSymbol", value: function(t, e) { var r = this, n = this._head, o = ""; return loop(e, function(t) { for (var e = s[r._random.generate(32)]; e in n.getChildren() && "." !== n.getChildren()[e].getChar();) e = s[r._random.generate(32)]; o += e, e in n.getChildren() || n.setChildren(e, new f(t_code)), n = n.getChildren()[e] }), n.setChar(t), this._inter[t] = o } }, { key: "decode", value: function(t) { for (var e = "", r = 4; r < t.length;) if ("=" !== t[r]) { for (var n = this._head; t[r] in n.getChildren();) n = n.getChildren()[t[r]], r++; e += n.getChar() } else e += "=", r++; return e } }] u_list = [{ key: "get", value: function(t) { return t >>> 0 } }, { key: "xor", value: function(t, e) { return this.get(this.get(t) ^ this.get(e)) } }, { key: "and", value: function(t, e) { return this.get(this.get(t) & this.get(e)) } }, { key: "mul", value: function(t, e) { var r = ((4294901760 & t) >>> 0) * e, n = (65535 & t) * e; return this.get((r >>> 0) + (n >>> 0)) } }, { key: "or", value: function(t, e) { return this.get(this.get(t) | this.get(e)) } }, { key: "not", value: function(t) { return this.get(~this.get(t)) } }, { key: "shiftLeft", value: function(t, e) { return this.get(this.get(t) << e) } }, { key: "shiftRight", value: function(t, e) { return this.get(t) >>> e } }, { key: "mod", value: function(t, e) { return this.get(this.get(t) % e) } }] var u = { default: {} } u_list.forEach(function(funDec) { u.default[funDec.key] = funDec.value.bind(u.default) }) var _random_list = [{ key: "seed", value: function(e) { var r = this; loop(4, function(t) { e.length > t ? r._status[t] = u.default.get(e.charAt(t).charCodeAt()) : r._status[t] = u.default.get(110) }), this._mat1 = this._status[1], this._mat2 = this._status[2], this._tmat = this._status[3], this._init() } }, { key: "_init", value: function() { var e = this; loop(7, function(t) { e._status[t + 1 & 3] = u.default.xor(e._status[t + 1 & 3], t + 1 + u.default.mul(1812433253, u.default.xor(e._status[3 & t], u.default.shiftRight(e._status[3 & t], 30)))) }), 0 == (2147483647 & this._status[0]) && 0 === this._status[1] && 0 === this._status[2] && 0 === this._status[3] && (this._status[0] = 66, this._status[1] = 65, this._status[2] = 89, this._status[3] = 83), loop(8, function() { return e._next_state() }) } }, { key: "_next_state", value: function() { var t = void 0, e = void 0; e = this._status[3], t = u.default.xor(u.default.and(this._status[0], 2147483647), u.default.xor(this._status[1], this._status[2])), t = u.default.xor(t, u.default.shiftLeft(t, 1)), e = u.default.xor(e, u.default.xor(u.default.shiftRight(e, 1), t)), this._status[0] = this._status[1], this._status[1] = this._status[2], this._status[2] = u.default.xor(t, u.default.shiftLeft(e, 10)), this._status[3] = e, this._status[1] = u.default.xor(this._status[1], u.default.and(-u.default.and(e, 1), this._mat1)), this._status[2] = u.default.xor(this._status[2], u.default.and(-u.default.and(e, 1), this._mat2)) } }, { key: "generate", value: function(t) { this._next_state(); var e, r = void 0; return r = this._status[3], e = u.default.xor(this._status[0], u.default.shiftRight(this._status[2], 8)), r = u.default.xor(r, e), (r = u.default.xor(u.default.and(-u.default.and(e, 1), this._tmat), r)) % t } }] function a_default(t) { i.call(this, t), this._random = new o_default, this._sign = "", this._inter = {}, this._head = new f(t) a_list.forEach(function(funDec) { this[funDec.key] = funDec.value; }, this) _random_list.forEach(function(funDec) { this._random[funDec.key] = funDec.value; }, this) } i = function(t) { var e = t.charCodeAt(); return 65 <= e ? e - 65 : e - 65 + 41 } function o_default() { this._status = [], this._mat1 = 0, this._mat2 = 0, this._tmat = 0 } function loop(t, r) { "v".repeat(t).split("").map(function(t, e) { return r(e) }) } t_code = "" // 自行添加加密数据console.log(d(t_code))
原文始发于微信公众号(逆向有你):JS逆向 -- 某单词js逆向补环境
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论