先貼一個混淆後的測試代碼:
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;}('1("0-6");2 4(){1("0-5")}8 3=2(){1("0-7")};4();3()',9,9,'憂郁的匹格|alert|function|b|a|反混淆測試2|反混淆測試1|反混淆測試3|var'.split('|'),0,{}))
反混淆方法
- 建立一個網頁xxx.html
- 加入一個div容器id="divTest"
- 指派執行:(在上面混淆的代碼中,将eval()中的内容提取出來指派(或直接列印)給document.getElementById('divTest').innerText )
document.getElementById('divTest').innerText=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;}('1("0-6");2 4(){1("0-5")}8 3=2(){1("0-7")};4();3()',9,9,'憂郁的匹格|alert|function|b|a|反混淆測試2|反混淆測試1|反混淆測試3|var'.split('|'),0,{})
- 打開xxx.html 顯示結果:(反混淆後的代碼已經被壓縮了,去掉了換行等字元)
alert("憂郁的匹格-反混淆測試1");function a(){alert("憂郁的匹格-反混淆測試2")}var b=function(){alert("憂郁的匹格-反混淆測試3")};a();b()
作者:Bonker 出處:http://www.cnblogs.com/Bonker QQ:519841366 |
本頁版權歸作者和部落格園所有,歡迎轉載,但未經作者同意必須保留此段聲明,
且在文章頁面明顯位置給出原文連結,否則保留追究法律責任的權利