eval(function(p,a,c,k,e,d)系列解密javascript程序
作者:mdxy-dxy 时间:2024-04-19 10:01:20
js的eval代码快速解密
有一段js代码内容如下:
eval(function(E,I,A,D,J,K,L,H){function C(A)后面内容省略。。。
解密可以采用如下方法:
方法一:
打开谷歌浏览器,按F12,在Console窗口中把eval代码复制粘贴进去,回车运行,即可就到源码。
方法二:
新建一个html文件,把上面eval替换成document.write输出即可。
备注,前后加xmp标签的作用是完整的输出html标签,并且不做任何转义。
<html>
<head>
<title>eval解密</title>
</head>
<body>
<script type="text/javascript">
document.write("<xmp>");
document.write(function(E,I,A,D,J,K,L,H){function C(A)后面内容省略。。。)
document.write("</xmp>");
</script>
</body>
</html>
方法三:
步骤:
1.新建html页面,把以下代码考进去,运行。
2.把加密的代码粘进文本域,点击解密,OK!
核心代码:
<script>
a=62;
function encode() {
var code = document.getElementById('code').value;
code = code.replace(/[\r\n]+/g, '');
code = code.replace(/'/g, "\\'");
var tmp = code.match(/\b(\w+)\b/g);
tmp.sort();
var dict = [];
var i, t = '';
for(var i=0; i<tmp.length; i++) {
if(tmp[i] != t) dict.push(t = tmp[i]);
}
var len = dict.length;
var ch;
for(i=0; i<len; i++) {
ch = num(i);
code = code.replace(new RegExp('\\b'+dict[i]+'\\b','g'), ch);
if(ch == dict[i]) dict[i] = '';
}
document.getElementById('code').value = "eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}("
+ "'"+code+"',"+a+","+len+",'"+ dict.join('|')+"'.split('|'),0,{}))";
}
function num(c) {
return(c<a?'':num(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));
}
function run() {
eval(document.getElementById('code').value);
}
function decode() {
var code = document.getElementById('code').value;
code = code.replace(/^eval/, '');
document.getElementById('code').value = eval(code);
}
</script>
<textarea id=code cols=80 rows=20>
</textarea><br>
<input type=button onclick=encode() value=编码>
<input type=button onclick=run() value=执行>
<input type=button onclick=decode() value=解码>
下面是可以运行查看效果的代码
<script> a=62; function encode() { var code = document.getElementById('code').value; code = code.replace(/[\r\n]+/g, ''); code = code.replace(/'/g, "\\'"); var tmp = code.match(/\b(\w+)\b/g); tmp.sort(); var dict = []; var i, t = ''; for(var i=0; i<tmp.length; i++) { if(tmp[i] != t) dict.push(t = tmp[i]); } var len = dict.length; var ch; for(i=0; i<len; i++) { ch = num(i); code = code.replace(new RegExp('\\b'+dict[i]+'\\b','g'), ch); if(ch == dict[i]) dict[i] = ''; } document.getElementById('code').value = "eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}(" + "'"+code+"',"+a+","+len+",'"+ dict.join('|')+"'.split('|'),0,{}))"; } function num(c) { return(c35?String.fromCharCode(c+29):c.toString(36)); } function run() { eval(document.getElementById('code').value); } function decode() { var code = document.getElementById('code').value; code = code.replace(/^eval/, ''); document.getElementById('code').value = eval(code); } </script> <textarea id=code cols=80 rows=20> </textarea> <input type=button onclick=encode() value=编码> <input type=button onclick=run() value=执行> <input type=button onclick=decode() value=解码>
标签:eval,function,解密
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
对Python3 goto 语句的使用方法详解
2023-10-14 11:32:49
![](https://img.aspxhome.com/file/2023/7/63247_0s.jpg)
Go WaitGroup及Cond底层实现原理
2024-02-18 23:05:03
![](https://img.aspxhome.com/file/2023/4/109734_0s.jpg)
浅谈pycharm使用及设置方法
2023-12-18 21:17:47
![](https://img.aspxhome.com/file/2023/9/118769_0s.png)
Mysql5.7.14安装配置方法操作图文教程(密码问题解决办法)
2024-01-28 03:04:36
![](https://img.aspxhome.com/file/2023/6/74796_0s.png)
Python实现的列表排序、反转操作示例
2023-06-19 11:14:27
使用python判断你是青少年还是老年人
2021-03-18 14:42:23
Flask框架通过Flask_login实现用户登录功能示例
2021-07-19 07:15:38
![](https://img.aspxhome.com/file/2023/3/77723_0s.png)
asp实现通过session来统计在线人数的方法
2007-08-13 12:56:00
关于TypeScript开发的6六个实用小技巧分享
2024-04-16 08:59:26
![](https://img.aspxhome.com/file/2023/0/136730_0s.png)
利用Python半自动化生成Nessus报告的方法
2021-03-10 23:04:01
![](https://img.aspxhome.com/file/2023/1/133521_0s.png)
python3+PyQt5实现支持多线程的页面索引器应用程序
2022-02-17 02:02:11
![](https://img.aspxhome.com/file/2023/2/89422_0s.png)
教你快速掌握一些方便易用的SQL语句
2008-11-28 15:21:00
Python3实时操作处理日志文件的实现
2022-09-01 21:21:16
python实现监控windows服务并自动启动服务示例
2021-01-19 01:30:13
python分析apache访问日志脚本分享
2021-08-12 04:20:09
tensorflow 输出权重到csv或txt的实例
2021-07-19 11:54:52
python GUI库图形界面开发之PyQt5结合Qt Designer创建信号与槽的详细方法与实例
2021-09-24 03:11:51
![](https://img.aspxhome.com/file/2023/7/72087_0s.png)
PHP实现定时生成HTML网站首页实例代码
2023-06-12 05:39:40
深入了解Python装饰器的高级用法
2023-12-19 13:34:45
MySQL的一些常用的SQL语句整理
2024-01-19 06:38:40