如何恢复混淆的属性名称?

问题描述 投票:1回答:1

因此,我正在解密javascript代码,并且在互联网上寻找了很长时间之后,我不知道如何快速解密这种方法。

代码从一个大数组开始,其中包含整个脚本的所有字符串。

 var _$_21e2 = ["jQuery", "userAgent", "test", "onmouseup", "onmousemove", "pink", "greenyellow", "gold"]

[数组中有更多字符串,但这仅是示例。

然后在其余的代码中,它只是通过ID调用数组中的字符串。

_$_21e2[29]

我知道我可以手动完成此操作,但是大约有120个字符串,因此这样做会花费太多时间。有办法快速解密吗?预先感谢。

javascript obfuscation deobfuscation
1个回答
2
投票
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]); }); 作为字符串,这将产生带有人类可读属性名称和文字的代码字符串。

© www.soinside.com 2019 - 2024. All rights reserved.