因此,我正在解密一个javascript代码,并且在互联网上寻找了很长时间之后,我不知道如何快速解密这种方法。
该代码以包含整个脚本所有字符串的大数组开始。
var _$_21e2 = ["jQuery", "userAgent", "test", "onmouseup", "onmousemove", "pink", "greenyellow", "gold"]
数组中还有更多的字符串,但这只是一个例子。
然后在其余的代码中,它仅通过id调用数组中的字符串。
_$_21e2[29]
我知道我可以手动执行此操作,但是大约有120个字符串,因此执行此操作将花费太多时间。有办法快速解密吗?提前致谢。
一个简单的正则表达式replace
可以做到:
var _$_21e2 = ["jQuery", "userAgent", "test", "onmouseup", "onmousemove", "pink", "greenyellow", "gold"];
return code.replace(/\[_\$_21e2\[(\d+)\]\]/g, function(_, i) {
return "."+_$_21e2[i];
}).replace(/_\$_21e2\[(\d+)\]/g, function(_, i) {
return JSON.stringify(_$_21e2[i]);
});
给定code
为字符串,这将产生带有人类可读属性名称和文字的代码字符串。
非常感谢,但是我将如何使用呢?
如我所说,将您的脚本作为
code
变量中的字符串。不起作用,数组中的每个字符串都返回为“ undefined”示例:for(bz =(3 * bz + u)/ 4,bH =(3 * bH + bq)/ 4,W.undefined(),W .undefined =未定义,W.undefined = 10,W.undefined =未定义,W.undefined =未定义,W.undefined = 0.5,W.undefined(),bn = 0; bn <X.undefined; bn ++){W. undefined(X [bn] .undefined,X [bn] .undefined),W.undefined(bz,bH)
对不起,我的回复很晚,完全可以按照我的意愿来做!