源码过长,只贴部分加密的源代码如下
0x1fc9: function (_0x2715a2, _0x5a118b, _0x344094) {
const _0x23ae3e = _0x344094(`611c`);
class _0x2e9b72 {
static [`getInstance`]() {
if ('\x6f\x64\x74\x56\x66' === `odtVf`) return new _0x23ae3e(); else {
function _0x2198cd() {
_0x12eae5[`log`](`ws\u8FDE\u63A5\u5931\u8D25`);
const _0x28aee6 = this;
_0x28aee6[`startWsCount`] < 0x5 ? (this[`$message`]('\u6b63\u5728\u542f\u52a8\x77\x73\u670d\u52a1\x2e\x2e\x2e'), _0x4bc899(function () {
_0x28aee6[`startWsCount`] += 0x1, _0x28aee6[`startWsCount`] >= 0x3 ? (_0x28aee6[`startWs`](), _0x28aee6[`startWsCount`] = 0x0) : _0x28aee6[`initWs`]();
}, 0x7d0)) : (_0x28aee6[`ws_tips`] = `ws\u5DF2\u5C1D\u8BD5\u542F\u52A8\u5931\u8D255\u6B21\uFF0C\u8BF7\u68C0\u67E5ws\u6587\u4EF6\u8DEF\u5F84\u662F\u5426\u6B63\u5E38\uFF0C\u6216\u624B\u52A8\u542F\u52A8`, _0x3feb67(function () {
_0x28aee6[`not_start_ws`] = !0x0;
}, 0x7d0));
}
}
}
}
const _0x189052 = _0x2e9b72[`getInstance`]();
_0x2715a2[`exports`] = _0x189052;
}
我手动解密后如下
8137: function(ref, model, expt) {
const encipher = expt(`611c`);
class Encipher {
static[`getInstance`]() {
return new encipher();
}
}
const exa = Encipher.getInstance();
ref.exports = exa;
}
说一下解密思路
1.加密的源代码整体结构,只要是做过前端的,基本上一眼就可以看出来,这是经过webpack打包过的,然后经过了混淆加密变成了最终这个结构。PS:在把最外层的加密解开后,我发现里边除了webpack,可能还有用其他的加密代码先加密过一遍再用webpack打包的。
2.好了,现在先了解了这个源码的基本加密流程,我们开始着手解密。
3.先把源代码丢在线一键加密解密JS代码用一键解密功能先解一遍,得到如下代码。
0x1fc9: function(_0x2715a2, _0x5a118b, _0x344094) {
const _0x23ae3e = _0x344094(`611c`);
class _0x2e9b72 {
static[`getInstance`]() {
if ('odtVf' === `odtVf`) return new _0x23ae3e();
else {
function _0x2198cd() {
_0x12eae5[`log`](`ws连接失败`);
const _0x28aee6 = this;
_0x28aee6[`startWsCount`] < 0x5 ? (this[`$message`]('正在启动ws服务...'), _0x4bc899(function() {
_0x28aee6[`startWsCount`] += 0x1, _0x28aee6[`startWsCount`] >= 0x3 ? (_0x28aee6[`startWs`](), _0x28aee6[`startWsCount`] = 0x0) : _0x28aee6[`initWs`]();
}, 0x7d0)) : (_0x28aee6[`ws_tips`] = `ws已尝试启动失败5次,请检查ws文件路径是否正常,或手动启动`, _0x3feb67(function() {
_0x28aee6[`not_start_ws`] = !0x0;
}, 0x7d0));
}
}
}
}
const _0x189052 = _0x2e9b72[`getInstance`]();
_0x2715a2[`exports`] = _0x189052;
}
4.由此可见,这段代码有用到websocket功能,这一小段是启动websocket服务的。
5.接下来就是我手工解密啦,没什么说的,按部就班就行。
6.最后得到的结果就是上边的了,在文章开头已经贴出来过了。
结语
对文章内容有疑问或者有建议的朋友欢迎在评论区说出来,或者使用私信功能给我留言。