百度访问统计代码JavaScript源码:
红色加粗部分将是要修改的地方.
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}('p w(E,D,A,C,B){5.R=8.14(E);5.o=D;5.d=A;5.r=(8.e)?C:(C-2);5.q=0;5.b=B+((8.e)?0:-2);5.x=5.d[0];5.O=5.d[5.d.c-1]}w.P.y=p(B){9 A=15.16(((B-5.x)*5.b/(5.O-5.x)))+((8.e)?2:0);s(A>5.b){A=5.b}17 A};w.P.18=p(){9 A=8.i("k");A.a="1a";A.6.z=5.b+"7";5.R.j(A);9 K=8.i("k");A.j(K);K.a="1b";9 J=0;Q(9 G=0;G<5.o.c;G+=2){9 B=5.y(5.o[G]);9 I=5.o[G+1];9 F=8.i("k");A.j(F);F.a="u";F.6.n=5.r+"7";F.6.z=B+"7";F.6.m=5.b-B-1+"7";F.6.g=(J-1)+"7";F.h="&v;";F.f=K;F.T=p(){5.a="V";5.f.6.L="";5.f.h=5.t.l(3,5.t.c);5.f.6.g=5.6.g;5.f.6.m=S(5.6.m)-S(5.f.19)+"7"};F.W=p(){5.a="u";5.f.6.L="Z"};9 E=8.i("k");A.j(E);E.6.n=5.r+"7";E.6.m=(8.e)?5.b:5.b+3+"7";9 C=I.10(".");F.t="u"+I.l(0,C)+"\\11"+I.l(C+1,I.c)+"\\12&v;&v;"+5.o[G];s(G%4==0){s((I.l(C+1,I.c)=="1"||I.l(C+1,I.c)=="2")){E.a="13";E.6.g=(J-4)+"7";E.h=I}N{E.a="M";E.6.g=(J-1)+"7";E.h=I.l(C+1,I.c)}}N{E.a="M";E.6.g=(J-1)+"7";E.h=""}J+=5.r+((8.e)?-1:1)}5.q=J+((8.e)?1:-1);A.6.n=5.q+"7";Q(9 G=0;G<5.d.c;G++){9 D=5.y(5.d[G]);s(G!=0&&G!=5.d.c-1){9 H=8.i("k");A.j(H);H.a="X";H.6.n=(5.q-((8.e)?1:-1))+"7";H.6.m=(5.b-D-1)+"7"}9 E=8.i("k");A.j(E);E.a="1c";E.6.n="Y";E.6.m=(5.b-D-2)+"7";E.6.g=-U+"7";E.h=5.d[G]}};',62,75,'|||||this|style|px|document|var|className|charth|length|yl|all|ohit|left|innerHTML|createElement|appendChild|div|substring|top|width|xl|function|chartw|barw|if|id|bar|nbsp|Chart|minpv|GetPVHeight|height||||||||||||display|titx|else|maxpv|prototype|for|parent|parseInt|onmouseover|42|barhl|onmouseout|liney|35px|none|indexOf|u6708|u65e5|titxhl|getElementById|Math|round|return|Create|offsetHeight|chart|hit|tity'.split('|'),0,{}));

其实这个eval(function(p,a,c,k,e,d){}))中自带解码函数e().
while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p
while循环产生的每个p就是解码后的函数代码,我们删掉源码中的return p,不用将结果返回,
而是直接输出在一个文本区域中,如document.getElementById(”textareaID”).innerText=p.

最终代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Crack Baidu统计构造函数</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="Author" content=www.gemingcao.com />
<meta name="Keywords" content="" />
<meta name="Description" content="" />  
</head>
<body>
<textarea id="textareaID" rows="25" cols="50"></textarea>
<script type="text/javascript">
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]);document.getElementById('textareaID').innerText=p;}}}('p w(E,D,A,C,B){5.R=8.14(E);5.o=D;5.d=A;5.r=(8.e)?C:(C-2);5.q=0;5.b=B+((8.e)?0:-2);5.x=5.d[0];5.O=5.d[5.d.c-1]}w.P.y=p(B){9 A=15.16(((B-5.x)*5.b/(5.O-5.x)))+((8.e)?2:0);s(A>5.b){A=5.b}17 A};w.P.18=p(){9 A=8.i("k");A.a="1a";A.6.z=5.b+"7";5.R.j(A);9 K=8.i("k");A.j(K);K.a="1b";9 J=0;Q(9 G=0;G<5.o.c;G+=2){9 B=5.y(5.o[G]);9 I=5.o[G+1];9 F=8.i("k");A.j(F);F.a="u";F.6.n=5.r+"7";F.6.z=B+"7";F.6.m=5.b-B-1+"7";F.6.g=(J-1)+"7";F.h="&v;";F.f=K;F.T=p(){5.a="V";5.f.6.L="";5.f.h=5.t.l(3,5.t.c);5.f.6.g=5.6.g;5.f.6.m=S(5.6.m)-S(5.f.19)+"7"};F.W=p(){5.a="u";5.f.6.L="Z"};9 E=8.i("k");A.j(E);E.6.n=5.r+"7";E.6.m=(8.e)?5.b:5.b+3+"7";9 C=I.10(".");F.t="u"+I.l(0,C)+"\\11"+I.l(C+1,I.c)+"\\12&v;&v;"+5.o[G];s(G%4==0){s((I.l(C+1,I.c)=="1"||I.l(C+1,I.c)=="2")){E.a="13";E.6.g=(J-4)+"7";E.h=I}N{E.a="M";E.6.g=(J-1)+"7";E.h=I.l(C+1,I.c)}}N{E.a="M";E.6.g=(J-1)+"7";E.h=""}J+=5.r+((8.e)?-1:1)}5.q=J+((8.e)?1:-1);A.6.n=5.q+"7";Q(9 G=0;G<5.d.c;G++){9 D=5.y(5.d[G]);s(G!=0&&G!=5.d.c-1){9 H=8.i("k");A.j(H);H.a="X";H.6.n=(5.q-((8.e)?1:-1))+"7";H.6.m=(5.b-D-1)+"7"}9 E=8.i("k");A.j(E);E.a="1c";E.6.n="Y";E.6.m=(5.b-D-2)+"7";E.6.g=-U+"7";E.h=5.d[G]}};',62,75,'|||||this|style|px|document|var|className|charth|length|yl|all|ohit|left|innerHTML|createElement|appendChild|div|substring|top|width|xl|function|chartw|barw|if|id|bar|nbsp|Chart|minpv|GetPVHeight|height||||||||||||display|titx|else|maxpv|prototype|for|parent|parseInt|onmouseover|42|barhl|onmouseout|liney|35px|none|indexOf|u6708|u65e5|titxhl|getElementById|Math|round|return|Create|offsetHeight|chart|hit|tity'.split('|'),0,{}));
</script>
</body>
</html>

保存为html文件,运行.
格式化文本区域中的JavaScript代码,代码如下:
function Chart(E, D, A, C, B) {
    this.parent = document.getElementById(E);
    this.xl = D;
    this.yl = A;
    this.barw = (document.all) ? C: (C - 2);
    this.chartw = 0;
    this.charth = B + ((document.all) ? 0 : -2);
    this.minpv = this.yl[0];
    this.maxpv = this.yl[this.yl.length - 1]
}
Chart.prototype.GetPVHeight = function(B) {
    var A = Math.round(((B - this.minpv) * this.charth / (this.maxpv - this.minpv))) + ((document.all) ? 2 : 0);
    if (A > this.charth) {
        A = this.charth
    }
    return A
};
Chart.prototype.Create = function() {
    var A = document.createElement("div");
    A.className = "chart";
    A.style.height = this.charth + "px";
    this.parent.appendChild(A);
    var K = document.createElement("div");
    A.appendChild(K);
    K.className = "hit";
    var J = 0;
    for (var G = 0; G < this.xl.length; G += 2) {
        var B = this.GetPVHeight(this.xl[G]);
        var I = this.xl[G + 1];
        var F = document.createElement("div");
        A.appendChild(F);
        F.className = "bar";
        F.style.width = this.barw + "px";
        F.style.height = B + "px";
        F.style.top = this.charth - B - 1 + "px";
        F.style.left = (J - 1) + "px";
        F.innerHTML = "&nbsp;";
        F.ohit = K;
        F.onmouseover = function() {
            this.className = "barhl";
            this.ohit.style.display = "";
            this.ohit.innerHTML = this.id.substring(3, this.id.length);
            this.ohit.style.left = this.style.left;
            this.ohit.style.top = parseInt(this.style.top) - parseInt(this.ohit.offsetHeight) + "px"
        };
        F.onmouseout = function() {
            this.className = "bar";
            this.ohit.style.display = "none"
        };
        var E = document.createElement("div");
        A.appendChild(E);
        E.style.width = this.barw + "px";
        E.style.top = (document.all) ? this.charth: this.charth + 3 + "px";
        var C = I.indexOf(".");
        F.id = "bar" + I.substring(0, C) + "\u6708" + I.substring(C + 1, I.length) + "\u65e5&nbsp;&nbsp;" + this.xl[G];
        if (G % 4 == 0) {
            if ((I.substring(C + 1, I.length) == "1" || I.substring(C + 1, I.length) == "2")) {
                E.className = "titxhl";
                E.style.left = (J - 4) + "px";
                E.innerHTML = I
            } else {
                E.className = "titx";
                E.style.left = (J - 1) + "px";
                E.innerHTML = I.substring(C + 1, I.length)
            }
        } else {
            E.className = "titx";
            E.style.left = (J - 1) + "px";
            E.innerHTML = ""
        }
        J += this.barw + ((document.all) ? -1 : 1)
    }
    this.chartw = J + ((document.all) ? 1 : -1);
    A.style.width = this.chartw + "px";
    for (var G = 0; G < this.yl.length; G++) {
        var D = this.GetPVHeight(this.yl[G]);
        if (G != 0 && G != this.yl.length - 1) {
            var H = document.createElement("div");
            A.appendChild(H);
            H.className = "liney";
            H.style.width = (this.chartw - ((document.all) ? 1 : -1)) + "px";
            H.style.top = (this.charth - D - 1) + "px"
        }
        var E = document.createElement("div");
        A.appendChild(E);
        E.className = "tity";
        E.style.width = "35px";
        E.style.top = (this.charth - D - 2) + "px";
        E.style.left = -42 + "px";
        E.innerHTML = this.yl[G]
    }
};

修正以后发现一个更简单的方法..将eval直接替换成document.write,将代码输出,但是要注意一点.在输出前,先输出一个<xmp>标记
如:
document.write("<xmp>");
/*eval*/document.write("function(){.....代码}");
document.write("</xmp>");

输出后是一堆代码.
把Javascript格式化一下
格式化的网页工具
http://tool.chinaz.com/Tools/JsFormat.aspx

JN_0004:轻松解码类似eval(function(p,a,c,k,e,d){}))的JavaScript代码的更多相关文章

  1. JavaScript 之 解码类似eval(function(p,a,c,k,e,d){}))的JavaScript代码

    这里以解码百度访问统计代码构造函数为示例: 以下为要统计JavaScript源码:红色加粗部分将是要修改的地方. eval(function(p,a,c,k,e,d){e=function(c){re ...

  2. eval(function(p,a,c,k,e,r)解密程序

    以eval(function(p,a,c,k,e,r){e=function(c)开头的js文件是经过加密的 使用下面方法可以对js文件进行加密.解密 步骤:1.新建html页面,内容如下列代码 2. ...

  3. eval(function(p,a,c,k,e,d){e=function(c)加解密

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. 密码学笔记——eval(function(p,a,c,k,e,d) 加密破解

    密码学笔记——eval(function(p,a,c,k,e,d) 的加密破解 例题: 小明某天在看js的时候,突然看到了这么一段代码,发现怎么也理不出代码逻辑,你能帮帮他吗? 格式:SimCTF{} ...

  5. JS中注入eval, Function等系统函数截获动态代码

    正文 现在很多网站都上了各种前端反爬手段,无论手段如何,最重要的是要把包含反爬手段的前端javascript代码加密隐藏起来,然后在运行时实时解密动态执行. 动态执行js代码无非两种方法,即eval和 ...

  6. Java实现类似eval()函数或exec()函数的功能

    一篇参考博客:http://www.cnblogs.com/fangwenyu/archive/2011/10/12/2209051.html 在Python中有一个exec()函数,同样在JavaS ...

  7. js 的eval()方法 计算某个字符串,并执行其中的的 JavaScript 代码;

    定义和用法 eval() 函数可计算某个字符串,并执行其中的的 JavaScript 代码. 语法 eval(string) 参数 描述 string 必需.要计算的字符串,其中含有要计算的 Java ...

  8. JavaScript eval() 函数,计算某个字符串,并执行其中的的 JavaScript 代码。

    JavaScript eval() 函数,计算某个字符串,并执行其中的的 JavaScript 代码. 适合用于计算器的计算,等. 例子: eval("x=10;y=20;document. ...

  9. JavaScript eval() Function

    Evaluate/Execute JavaScript code/expressions: Example var x = 10;var y = 20;var a = eval("x * y ...

随机推荐

  1. SQL Server 数据库状态选项-用户使用

    选项 1. single_user(单用户),multi_user(多用户),restricted_user(受限用户); 描述数据库的用户访问属性,它们互斥,设置其中任何一个选项就会取消对其它选项的 ...

  2. 系统重装助手教你如何在Microsoft Edge中恢复“关闭所有选项卡”警告

    在Microsoft Edge中,当您打开多个选项卡时,浏览器将显示“您要关闭所有选项卡吗?” 警告,以防止您意外关闭重要标签. 通常,在没有第二个想法的情况下,您会立即禁用此功能,检查提示中的“始终 ...

  3. 我认知的javascript之作用域和闭包

    说到javascript,就不得不说javascript的作用域和闭包:当然,还是那句老话,javascript在网上都说得很透彻了,我也就不过多的强调了: 作用域:javascript并没有像其他的 ...

  4. 关于opencv模板匹配功能的项目测试记录

    模板匹配功能介绍的很好的一篇博客:https://www.cnblogs.com/XJT2018/p/9934139.html 就如上述博客所言:“若原图像中的匹配目标发生旋转或大小变化,该算法无效. ...

  5. 超哥笔记--linux准备知识(1)

    一 岗位 前端小姐姐 python后端大神 测试工程师 测试+python 测试开发 运维工程师(背锅侠) -安全运维 -linux系统管理员 -桌面运维(helpdesk) -IDC机房运维(服务器 ...

  6. WiFi其他方法和WiFi事件响

    https://blog.csdn.net/Naisu_kun/article/details/86079455 目的WiFi在使用过程中并非会一直如希望般稳定运行的,为了应对这些情况就需要能够了解W ...

  7. 多数据库有序GUID

    背景 常见的一种数据库设计是使用连续的整数为做主键,当新的数据插入到数据库时,由数据库自动生成.但这种设计不一定适合所有场景. 随着越来越多的使用Nhibernate.EntityFramework等 ...

  8. 使用Flame Graph进行系统性能分析

    关键词:Flame Graph.perf.perl. FlameGraph是由BrendanGregg开发的一款开源可视化性能分析工具,形象的成为火焰图. 从底向上像火苗一样逐渐变小,也反映了相互之间 ...

  9. vs2015第二次装安装不能选择路径问题解决方法

    vs2015卸载后注册表还会存在vs2015的信息,下次安装的时候会读注册表里面记录的路径,不能自己选择路径. 解决方法: 1.在vs安装文件的路径打开命令,shift+鼠标右键 2.输入命令:cn_ ...

  10. 【原创】分布式之大话CAP

    引言 本文翻译自博客 http://ksat.me/a-plain-english-introduction-to-cap-theorem/ 博主觉得这个故事讲的生动活泼,因此翻译来给大家分享,顺便加 ...