Rumah  >  Artikel  >  hujung hadapan web  >  eval(function(p,a,c,k,e,d)系列解密javascript程序_javascript技巧

eval(function(p,a,c,k,e,d)系列解密javascript程序_javascript技巧

WBOY
WBOYasal
2016-05-16 19:14:281899semak imbas

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

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

核心代码:

复制代码 代码如下:

<script> <BR>a=62; <BR>function encode() { <BR>var code = document.getElementById('code').value; <BR>code = code.replace(/[\r\n]+/g, ''); <BR>code = code.replace(/'/g, "\\'"); <BR>var tmp = code.match(/\b(\w+)\b/g); <BR>tmp.sort(); <BR>var dict = []; <BR>var i, t = ''; <BR>for(var i=0; i<tmp.length; i++) { <BR>if(tmp[i] != t) dict.push(t = tmp[i]); <BR>} <BR>var len = dict.length; <BR>var ch; <BR>for(i=0; i<len; i++) { <BR>ch = num(i); <BR>code = code.replace(new RegExp('\\b'+dict[i]+'\\b','g'), ch); <BR>if(ch == dict[i]) dict[i] = ''; <BR>} <BR>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}(" <BR>+ "'"+code+"',"+a+","+len+",'"+ dict.join('|')+"'.split('|'),0,{}))"; <BR>} <br><br>function num(c) { <BR>return(c<a?'':num(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36)); <BR>} <br><br>function run() { <BR>eval(document.getElementById('code').value); <BR>} <br><br>function decode() { <BR>var code = document.getElementById('code').value; <BR>code = code.replace(/^eval/, ''); <BR>document.getElementById('code').value = eval(code); <BR>} <BR></script>










[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn