tbwshc

tbw

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  95 Posts :: 8 Stories :: 3 Comments :: 0 Trackbacks

常用链接

留言簿(4)

我参与的团队

搜索

  •  

最新评论

阅读排行榜

评论排行榜

1 <script>  
2 a=62;  
3 function encode() {  
4 var code = document.getElementById('code').value;  
5 code = code.replace(/[ ]+/g, '');  
6 code = code.replace(/'/g, "\'");  
7 var tmp = code.match(/ (w+) /g);  
8 tmp.sort();  
9 var dict = [];  
10 var i, t = '';  
11 for(var i=0; i<tmp.length; i++) {  
12 if(tmp[i] != tb) dict.push(t = tmp[i]);  
13 }  
14 var len = dict.length;  
15 var ch;  
16 for(i=0; i<len; i++) {  
17 ch = num(i);  
18 code = code.replace(new RegExp('\b'+dict[i]+'\b','g'), ch);  
19 if(ch == dict[i]) dict[i] = '';  
20 }  
21 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}("  
22 + "'"+code+"',"+a+","+len+",'"+ dict.join('|')+"'.split('|'),0,{}))";  
23 }  
24  
25 function num(c) {  
26 return(c<a?'':num(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));  
27 }  
28  
29 function run() {  
30 eval(document.getElementById('code').value);  
31 }  
32  
33 function decode() {  
34 var code = document.getElementById('code').value;  
35 code2 = code.replace(/^eval/, '');  
36 //alert(code);  
37 document.getElementById('code').value = eval(code2);  
38 }  
39 </script>  
40  
41 <textarea id=code cols=80 rows=20>  
42 </textarea>  
43  
44  
45 <input type=button onclick=encode() value=编码>  
46 <input type=button onclick=run() value=执行>  
47 <input type=button onclick=decode() value=解码>


各位朋友,在网上下载源代码时,很可能发现代码里的JS脚本看不懂,这是由于JS加密造成的,我对这种事情很不理解,既然是开源,JS还加密,算什么开源。如果你发现JS是以eval(function(p,a,c,k,e,r){e=function(c)开头的,看到这个页面你就可以解决他。

步骤:1.新建html页面,把以上代码考进去,运行。

         2.把加密的代码粘进文本域,点击解密,OK!

posted on 2012-06-22 13:00 tbwshc 阅读(1625) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理