今天拿到手的JS加密源代码如下
function enterKeyDown(_0x28623b) {
const _0x32979d = _0x58fe;
const _0xde64a8 = _0x1d66;
try {
let _0x1f57e5 = msgInput['previousSibling'];
let _0x595e47 = _0x1f57e5['value'];
sendLock = ![];
if ((msgInput['childNodes'][0x2cf1a ^ 0x2cf1a]['nodeName'] === _0xde64a8(0x98, '(Vjy') || msgInput['innerHTML']['indexOf'](_0x32979d(0x1f)) === (0x3995f ^ 0x3995f)) && msgInput['childNodes']['length'] !== 0x1) {
InputTipsMsg(_0xde64a8(0xa9, 'K^s['), _0xde64a8(0x7f, 'xtHf'));
return;
}
if (!__DisableSendTT) {
if (!IsEmpty(_0x595e47)) {
InputTipsMsg(_0x32979d(0xa1), _0x32979d(0xa8));
TranslateMessagesDirectly(_0x595e47, function (_0x37519a) {
const _0x4c0c26 = _0x58fe;
const _0x504cb8 = _0x1d66;
let _0x1b155d = GetRetStr(_0x37519a);
if (_0x1b155d['indexOf'](_0x504cb8(0x6d, 'epCC')) === 0x0) {
sendLock = ![];
InputTipsMsg(_0x37519a['msg'] === undefined ? _0x4c0c26(0x90) : _0x37519a['msg'], _0x4c0c26(0x1c));
} else {
_0x1f57e5['value'] = _0x1b155d;
msgInput['innerHTML'] = _0x1b155d;
FireMessageInputEvent(_0x1f57e5);
sendLock = !![];
setTimeout(() => {
const _0x1313e1 = _0x58fe;
sendLock = ![];
if (hasChinese(msgInput['innerText']) && zh_translation_switch === ![]) {
} else {
sendButton['click']();
InputTipsMsg(_0x1313e1(0x9b), _0x1313e1(0xa8));
}
}, 0x1);
}
}, send_from, send_to);
}
} else {
setTimeout(() => {
const _0x133bc1 = _0x1d66;
const _0xe44700 = _0x58fe;
sendLock = ![];
InputTipsMsg(_0xe44700(0x6a), _0x133bc1(0x73, 't)Zd'));
sendButton['click']();
}, 0x808b2 ^ 0x808b8);
}
} catch (_0x21b8b7) {
sendLock = ![];
console['error'](_0x21b8b7);
}
}
我手工解密后如下
function enterKeyDown() {
try {
let previousSibling = msgInput.previousSibling;
let psValue = previousSibling.value;
sendLock = false;
if ((msgInput.childNodes[0].nodeName === "IMG" || msgInput.innerHTML.indexOf("<img") === 0) && msgInput.childNodes.length !== 1) {
InputTipsMsg("表情不能在最前面翻译", "error");
return;
}
if (!__DisableSendTT) {
if (!IsEmpty(psValue)) {
InputTipsMsg("正在翻译中", "info");
TranslateMessagesDirectly(psValue, function (res) {
let retStr = GetRetStr(res);
if (retStr.indexOf("error:") === 0) {
sendLock = false;
InputTipsMsg(res.msg === undefined ? "服务错误" : res.msg, "error");
} else {
previousSibling.value = retStr;
msgInput.innerHTML = retStr;
FireMessageInputEvent(previousSibling);
sendLock = true;
setTimeout(() => {
sendLock = false;
if (!(hasChinese(msgInput.innerText) && zh_translation_switch === false)) {
sendButton.click();
InputTipsMsg("翻译成功", "info");
}
}, 1);
}
}, send_from, send_to);
}
} else {
setTimeout(() => {
sendLock = false;
InputTipsMsg("未开启翻译,发送原文", "info");
sendButton.click();
}, 10);
}
} catch (e) {
sendLock = false;
console.error(e);
}
}
解密思路
1.咱们解密啥都不用想,首先将加密的JS代码丢到在线JS加密解密工具站一键解一遍。
2.在工具站解完了后,人工分析代码加密逻辑手工挨个改回来
3.解密完毕
结论
这个我看了下,这个js应该是翻译某游戏客户端的说明注释的,将英文版的客户端数据通过调用翻译接口翻译成汉语,应该是某些人想把国外的开源代码搬运进来,初步做一个汉译。
标签:const,msgInput,JS,解密,InputTipsMsg,let,日志,sendLock,previousSibling From: https://blog.51cto.com/u_15781271/5937852