[原创]百度访问统计柱状图表再次解密(4)-eval破解

2013-03-21Javascript3340

[原创]百度访问统计柱状图表再次解密(4)

3篇讲解了while(c -- ) {d[e(c)] = k[c] || e(c)}

得到了d[]

k = [function(e){return d[e]}];//重新定义k数组

e = function(){return'\\w+'};//重新定义了e函数

c = 1


while(c -- )

{

    if(k[c]){p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])}

}

上面的while只循环一次

c--后c=0;后面e(0)=“\\w+”;k[0]的值有点迷茫;应该是json的写法。

if(k[0]){p = p.replace(new RegExp('\\b' + e(0) + '\\b', 'g'), k[0])}

然后对那一大片参数p的字符进行替换就是我要的东西了。

解密后的代码:

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 = "-42px";

     E.innerHTML = this.yl[G];

  }

};

5篇是全部完整代码。

关闭

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开微信扫一扫,即可进行扫码打赏哦

支付宝

微信