When downloading source code from the Internet, you may find that the JS script in the code does not understand it. this is caused by JS encryption. If you find that JS starts with eval (function (p, a, c, k, e, r) {efunction (c), you can solve this problem by seeing this page: 1. create an html page, test the following code, and run it.
2. paste the encrypted code into the text field and click decrypt. OK!
Core code:
The code is as follows:
Script
A = 62;
Function encode (){
Var code = document. getElementById ('code'). value;
Code = code. replace (/[\ r \ n] +/g ,'');
Code = code. replace (/'/g ,"\\'");
Var tmp = code. match (/\ B (\ w +) \ B/g );
Tmp. sort ();
Var dict = [];
Var I, t = '';
For (var I = 0; I If (tmp [I]! = T) dict. push (t = tmp [I]);
}
Var len = dict. length;
Var ch;
For (I = 0; I Ch = num (I );
Code = code. replace (new RegExp ('\ B' + dict [I] + '\ B', 'g'), ch );
If (ch = dict [I]) dict [I] = '';
}
Document. getElementById ('code'). value = "eval (function (p, a, c, k, e, d) {e = function (c) {return (c35? 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 }("
+ "'" + Code + "'," + a + "," + len + ", '" + dict. join ('|') + "'. split ('|'), 0 ,{}))";
}
Function num (c ){
Return (c35? String. fromCharCode (c + 29): c. toString (36 ));
}
Function run (){
Eval (document. getElementById ('code'). value );
}
Function decode (){
Var code = document. getElementById ('code'). value;
Code = code. replace (/^ eval /,'');
Document. getElementById ('code'). value = eval (code );
}
Script
<Br>
Script a = 62; function encode () {var code = document. getElementById ('code '). value; code = code. replace (/[\ r \ n] +/g, ''); code = code. replace (/'/g, "\'"); var tmp = code. match (/\ B (\ w +) \ B/g); tmp. sort (); var dict = []; var I, t = ''; for (var I = 0; I <tmp. length; I ++) {if (tmp [I]! = T) dict. push (t = tmp [I]);} var len = dict. length; var ch; for (I = 0; I <len; I ++) {ch = num (I); code = code. replace (new RegExp ('\ B' + dict [I] + '\ B', 'g'), ch); if (ch = dict [I]) dict [I] = '';} document. getElementById ('code '). value = "eval (function (p, a, c, k, e, d) {e = function (c) {return (c35? 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} ("+" '"+ code +"', "+ a +", "+ len +", '"+ dict. join ('|') + "'. split ('|'), 0, {}) ";} function num (c) {return (c35? String. fromCharCode (c + 29): c. toString (36);} function run () {eval (document. getElementById ('code '). value);} function decode () {var code = document. getElementById ('code '). value; code = code. replace (/^ eval/, ''); document. getElementById ('code '). value = eval (code);} script <textarea id = code cols = 80 rows = 20> </textarea> <input type = button onclick = encode () value = encoding> <input type = button onclick = run () value = execution> <input type = button onclick = decode () value = decoding>
[Ctrl + A Select All Note: If you need to introduce external Js, you need to refresh it to execute]