JavaScript decoding JavaScript code similar to eval (function (p,a,c,k,e,d) {}))

Source: Internet
Author: User

Here is an example of decoding the Baidu Access Statistics code constructor:

The following is to count JavaScript source code: The red Bold section will be the place to modify.

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 (+))};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,{});

In fact, this eval (function (p,a,c,k,e,d) {}) has its own decoding function, E ().
while (c--) {if (K[c]) {p=p.replace (New RegExp (' \\b ' +e (c) + ' \\b ', ' G '), K[c])}}return p
Each p generated by the while loop is the decoded function code, and we delete the return p from the source, instead of returning the result, and outputting it directly in a text area, such as document.getElementById ("Textareaid"). Innertext=p.

Final code:
<! 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 statistical Constructors </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= ""/>
< body>
<textarea id= "Textareaid"Rows=" " cols=" ></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 (+))};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]);d Ocument.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>

Save as HTML file, run.
Format the JavaScript code in the text area with the following code:

functionChart (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) {varA = Math.Round (((B- This. MINPV) * This. Charth/( This. MAXPV- This. MINPV)) + ((document.all)? 2:0); if(A > This. Charth) {A= This. Charth}returnA}; Chart.prototype.Create=function() {    varA = document.createelement ("div"); A.classname= "Chart"; A.style.height= This. Charth + "px";  This. Parent.appendchild (A); varK = document.createelement ("div");    A.appendchild (K); K.classname= "Hit"; varJ = 0;  for(varG = 0; G < This. xl.length; G + = 2) {        varB = This. Getpvheight ( This. Xl[g]); varI = This. xl[g + 1]; varF = 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"        }; varE = document.createelement ("div");        A.appendchild (E); E.style.width= This. Barw + "px"; E.style.top= (document.all)? This. Charth: This. Charth + 3 + "px"; varC = 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(varG = 0; G < This. yl.length; g++) {        varB This. Getpvheight ( This. Yl[g]); if(g! = 0 && G! = This. yl.length-1) {            varH = 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"        }        varE = 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]}};

The fix found a simpler approach. Replace Eval directly with document.write, and output the code, but be careful. Output a <xmp> tag before output, such as:
document.write ("<xmp>");
/*eval*/document.write ("function () {..... Code} ");
document.write ("</xmp>");

Output the decoded JavaScript code, the output code after the format can see the reference changes.
Formatted Web page tool: http://tool.chinaz.com/Tools/JsFormat.aspx

JavaScript decoding JavaScript code similar to eval (function (p,a,c,k,e,d) {}))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.