0

I often see JavaScript snippets "compressed / Nested" which makes editing very difficult.

Is it possible to convert this code to make it easier to read again?

Here's the code:

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
}

('(y(){7 a=\'0.22\';7 b=\'//23.22/1R/21/21.2j\';7 c=\'2d\';7 d=1V;7 e=1;7 f=O;7 g=F;7 h=J;7 i={2g:\'2l\',2f:\'29\',28:\'1\',1B:\'9\',2b:2L(w.Z.P),2E:E.2n};7 j=y(a,b,c){7 d="";x(c){7 e=1L 1Z();e.2J(e.20()+(c*1V*2A));d="; 2z="+e.2s()}I d="";w.1N=a+"="+b+d+"; 1R=/"};7 k=y(a){7 b=a+"=";7 c=w.1N.2r(\';\');T(7 d=0;d<c.C;d++){7 e=c[d];1X(e.B(0)==\' \')e=e.1Y(1,e.C);x(e.Q(b)==0)A e.1Y(b.C,e.C)}A J};7 l=y(a){7 b=y(a,b){1X(a.1s){a=a.1s;x(a.1h!=1I&&a.1h.1m()===b)A a}A J};7 e=(2t!==E)?w.2u:E.Z.P;7 l=n(i);x(a.1k.1h.1m()==\'a\'){e=a.1k.P;a.26()}I{7 p=b(a.1k,\'a\');x(p!=J){e=p.P;a.26()}}7 q=m().1m();x(R.1j.24().Q(\'1H\')==-1&&R.1j.24().Q(\'1r\')==-1){7 r=\'<1o><H><11>E.Z="$V$";</11></H></1o>\'.L(\'$V$\',e);7 s=o().1x(r);e=\'25:1q/1o;1p,$V$\'.L(\'$V$\',s)}7 t=k(c)==J?0:1z(k(c));g=O;x(f)w.H.1U(h);j(c,t+1,d);x(q.Q(\'1E\')!=-1){7 u=w.14(\'a\');u.P=e;7 v=w.2y(\'2K\');v.2v(\'1n\',O,O,E,0,0,0,0,0,F,F,F,F,O?1:0,J);u.2w(v)}I E.2x(e,\'\');E.1P.Z.P=l};7 m=y(){7 a=R.1j,b,c=a.1l(/(2p|1E|2o|2q|1H|1r(?=\\/))\\/?\\s*(\\d+)/i)||[];x(/1r/i.2H(c[1])){b=/\\2I[ :]+(\\d+)/g.2G(a)||[];A\'2F \'+(b[1]||\'\')}x(c[1]===\'2B\'){b=a.1l(/\\b(1D|2C)\\/(\\d+)/);x(b!=J)A b.2D(1).Y(\' \').L(\'1D\',\'2a\')}c=c[2]?[c[1],c[2]]:[R.27,R.2e,\'-?\'];x((b=a.1l(/1B\\/(\\d+)/i))!=J)c.2m(1,1,b[1]);A c.Y(\' \')};7 n=y(b){7 c=2h.2k(b);7 d=o().1x(c);d=r()+d+r();d=d.L(/\\//g,\'-\');7 e=\'2i://\'+a+\'/\'+d;A e};7 o=y(){7 a="=",b="1G+/",c="1.0";y d(a,c){7 d=b.Q(a.B(c));x(d===-1)1d"1A 1y 1p";A d}y e(b){7 c=0,e,f,g=b.C,h=[];b=S(b);x(g===0)A b;x(g%4!==0)1d"1A 1y 1p";x(b.B(g-1)===a){c=1;x(b.B(g-2)===a)c=2;g-=4}T(e=0;e<g;e+=4){f=(d(b,e)<<18)|(d(b,e+1)<<12)|(d(b,e+2)<<6)|d(b,e+3);h.G(S.1i(f>>16,(f>>8)&13,f&13))}1C(c){1b 1:f=(d(b,e)<<18)|(d(b,e+1)<<12)|(d(b,e+2)<<6);h.G(S.1i(f>>16,(f>>8)&13));19;1b 2:f=(d(b,e)<<18)|(d(b,e+1)<<12);h.G(S.1i(f>>16));19}A h.Y("")}y f(a,b){7 c=a.2c(b);x(c>13)1d"2P: 3o 3i 5";A c}y g(c){x(3h.C!==1)1d"3c: 3b 3a 3d 3e";c=S(c);7 d,e,g=[],h=c.C-c.C%3;x(c.C===0)A c;T(d=0;d<h;d+=3){e=(f(c,d)<<16)|(f(c,d+1)<<8)|f(c,d+2);g.G(b.B(e>>18));g.G(b.B((e>>12)&N));g.G(b.B((e>>6)&N));g.G(b.B(e&N))}1C(c.C-h){1b 1:e=f(c,d)<<16;g.G(b.B(e>>18)+b.B((e>>12)&N)+a+a);19;1b 2:e=(f(c,d)<<16)|(f(c,d+1)<<8);g.G(b.B(e>>18)+b.B((e>>12)&N)+b.B((e>>6)&N)+a);19}A g.Y("")}A{1x:g,1y:e}};7 p=y(a,b){7 c,d,e;d=F;c=w.14(\'11\');c.1K=\'1q/3m\';c.3l=a;c.3j=c.3k=y(){x(!d&&(!1w.1u||1w.1u==\'2M\'||1w.1u==\'38\')){d=O;x(b)b()}};c.2T=y(){b()};e=w.1J(\'11\')[0];e.1s.2U(c,e)};7 q=y(a,b){x(b==1I){7 c=w.1t||w.1J(\'1t\')[0];7 b=w.14(\'39\');b.1K=\'1q/2W\';c.1v(b)}x(b.1F)b.1F.2S=a;I b.1v(w.2R(a));A b};7 r=y(){7 a=\'\';7 b="1G";T(7 c=0;c<5;c++)a+=b.B(D.X(D.W()*b.C));A a};7 s=y(a){7 b=\'\';7 c="2N";T(7 d=0;d<a;d++)b+=c.B(D.X(D.W()*c.C));A b};7 t=y(){x(g)A;7 a=k(c)==J?0:1z(k(c));x(a>=e)A;x(f){7 b=w.H;7 d=w.M;7 i=D.15(b.U,b.17,d.1O,d.U,d.17);7 j=D.15(b.1g,b.1f,d.1T,d.1g,d.1f);7 m=D.X((D.W()*10)+1);7 n=D.X((D.W()*10)+1);7 o=s(m)+1L 1Z().20()+s(n);h=w.14(\'37\');h.34=o;7 p=\'{33: 2Z !K; \'+\'30: 31 !K; \'+\'1a: $1a$1Q !K; \'+\'1c: $1c$1Q !K; \'+\'1P: 1M !K; \'+\'32: 1M !K; \'+\'2V: 36 !K; \'+\'35: 2Y; \'+\'z-2X: 2Q !K;}\';7 r=p.L(\'$1a$\',i).L(\'$1c$\',j);7 t=q(\'.\'+o+r);w.H.1v(h);E.2O=y u(a){i=D.15(w.H.U,w.H.17,w.M.1O,w.M.U,w.M.17);j=D.15(w.H.1g,w.H.1f,w.M.1T,w.M.1g,w.M.1f);w.1t.1U(t);7 b=p.L(\'$1a$\',i).L(\'$1c$\',j);t=q(\'.\'+o+b)};x(h.1e)h.1e(\'1n\',l,F);I h.1W(\'1S\',l)}I x(w.1e)w.1e(\'1n\',l,F);I w.1W(\'1S\',l)};p(b,y(){x(E.3f==F)p(E.3g,y(){x(E.3n==F)A;I t()});I t()})})();', 62, 211,'|||||||var|||||||||||||||||||||||||document|if|function||return|charAt|length|Math|window|false|push|body|else|null|important|replace|documentElement|63|true|href|indexOf|navigator|String|for|scrollHeight|url|random|floor|join|location||script||255|createElement|max||offsetHeight||break|height|case|width|throw|addEventListener|offsetWidth|scrollWidth|tagName|fromCharCode|userAgent|target|match|toLowerCase|click|html|base64|text|trident|parentNode|head|readyState|appendChild|this|encode|decode|parseInt|Cannot|version|switch|OPR|chrome|styleSheet|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|msie|undefined|getElementsByTagName|type|new|0px|cookie|clientHeight|top|px|path|onclick|clientWidth|removeChild|60|attachEvent|while|substring|Date|getTime|ads|com|aaaaaa|toLocaleLowerCase|data|preventDefault|appName|sbid|1920|Opera|page_url|charCodeAt| |appVersion|stid|route|JSON|http|js|stringify|get_pop|splice|spot_code|safari|opera|firefox|split|toGMTString|parent|referrer|initMouseEvent|dispatchEvent|open|createEvent|expires|1000|Chrome|Edge|slice|p1|IE|exec|test|brv|setTime|MouseEvents|encodeURI|loaded|abcdefghijklmnopqrstuvwxyz|onscroll|INVALID_CHARACTER_ERR|999999|createTextNode|cssText|onerror|insertBefore|position|css|index|default|block|visibility|visible|left|display|className|cursor|absolute|div|complete|style|one|exactly|SyntaxError|argument|required|_impspcabe_alpha|_impspcabe_path|arguments|Exception|onload|onreadystatechange|src|javascript|_impspcabe_beta|DOM'.split('|'), 0, {}));

FYI, I am a JavaScript beginner so please be nice to me: D

I've Googled around and unfortunately I have not been able to find any solution.

Thank you in advance Best regards

3
  • 1
    It's minified version of js file, and can't be simplified without knowing the arguments Commented Aug 19, 2016 at 6:11
  • also your english is not helping :D as i understand you would like to convert it back to source (not compiled)? or do you only want to format the code to look nice and variales stay p,a,c,k,e,d? maybe show us what would you like as a result. Commented Aug 19, 2016 at 6:18
  • Try to use avoid using eval(); Commented Aug 19, 2016 at 7:29

2 Answers 2

1

Javascript can be minified using custom algorithms and therefore there is no general way to de-minifying it.

I've for example written a 4kb demo where js is composed of a single string custom-algorithm base85-encoded that contains a custom-algorithm compressed version of a manually preprocessed and then clojure-compiler-compressed javascript source.

I highly doubt that a general tool can decode that to more human readable form automatically.

You will have to work on a case-by-case basis, following the steps that the javascript is doing and this includes executing eval of code.

Note that in other cases the javascript code can be the output of a real compiler from another language where all high-level symbolic information has been removed (actually it was never there in Javascript, it was present only in the original language form). In that case what you got is the real "original" javascript, you can only try to indent it but that is not going to get much readability.

What you can find are generic "beautyfier"s that will just reindent the Javascript code and add some whitespace, or may be even tools able to de-minify code generated by specific minifiers (especially general purpose minifiers: the more Javascript they're able to work with the less they'll be able to do... remember that in Javascript one can get the source code of a function, so code that depends on the original source code of a function is valid Javascript that cannot be minfied without changing its behavior).

Sign up to request clarification or add additional context in comments.

Comments

0

If you remove the eval in the beginning and print the return value of the outermost function to the console (console.log), you can see a minified, but still much more readable version of the code being executed.

This was deliberately processes with some tool meant to keep the original JavaScript unreadable to the eyes of script kiddies.

   (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])
        }
    }
    console.log(p);
    return p
}

('(y(){7 a=\'0.22\';7 b=\'//23.22/1R/21/21.2j\';7 c=\'2d\';7 d=1V;7 e=1;7 f=O;7 g=F;7 h=J;7 i={2g:\'2l\',2f:\'29\',28:\'1\',1B:\'9\',2b:2L(w.Z.P),2E:E.2n};7 j=y(a,b,c){7 d="";x(c){7 e=1L 1Z();e.2J(e.20()+(c*1V*2A));d="; 2z="+e.2s()}I d="";w.1N=a+"="+b+d+"; 1R=/"};7 k=y(a){7 b=a+"=";7 c=w.1N.2r(\';\');T(7 d=0;d<c.C;d++){7 e=c[d];1X(e.B(0)==\' \')e=e.1Y(1,e.C);x(e.Q(b)==0)A e.1Y(b.C,e.C)}A J};7 l=y(a){7 b=y(a,b){1X(a.1s){a=a.1s;x(a.1h!=1I&&a.1h.1m()===b)A a}A J};7 e=(2t!==E)?w.2u:E.Z.P;7 l=n(i);x(a.1k.1h.1m()==\'a\'){e=a.1k.P;a.26()}I{7 p=b(a.1k,\'a\');x(p!=J){e=p.P;a.26()}}7 q=m().1m();x(R.1j.24().Q(\'1H\')==-1&&R.1j.24().Q(\'1r\')==-1){7 r=\'<1o><H><11>E.Z="$V$";</11></H></1o>\'.L(\'$V$\',e);7 s=o().1x(r);e=\'25:1q/1o;1p,$V$\'.L(\'$V$\',s)}7 t=k(c)==J?0:1z(k(c));g=O;x(f)w.H.1U(h);j(c,t+1,d);x(q.Q(\'1E\')!=-1){7 u=w.14(\'a\');u.P=e;7 v=w.2y(\'2K\');v.2v(\'1n\',O,O,E,0,0,0,0,0,F,F,F,F,O?1:0,J);u.2w(v)}I E.2x(e,\'\');E.1P.Z.P=l};7 m=y(){7 a=R.1j,b,c=a.1l(/(2p|1E|2o|2q|1H|1r(?=\\/))\\/?\\s*(\\d+)/i)||[];x(/1r/i.2H(c[1])){b=/\\2I[ :]+(\\d+)/g.2G(a)||[];A\'2F \'+(b[1]||\'\')}x(c[1]===\'2B\'){b=a.1l(/\\b(1D|2C)\\/(\\d+)/);x(b!=J)A b.2D(1).Y(\' \').L(\'1D\',\'2a\')}c=c[2]?[c[1],c[2]]:[R.27,R.2e,\'-?\'];x((b=a.1l(/1B\\/(\\d+)/i))!=J)c.2m(1,1,b[1]);A c.Y(\' \')};7 n=y(b){7 c=2h.2k(b);7 d=o().1x(c);d=r()+d+r();d=d.L(/\\//g,\'-\');7 e=\'2i://\'+a+\'/\'+d;A e};7 o=y(){7 a="=",b="1G+/",c="1.0";y d(a,c){7 d=b.Q(a.B(c));x(d===-1)1d"1A 1y 1p";A d}y e(b){7 c=0,e,f,g=b.C,h=[];b=S(b);x(g===0)A b;x(g%4!==0)1d"1A 1y 1p";x(b.B(g-1)===a){c=1;x(b.B(g-2)===a)c=2;g-=4}T(e=0;e<g;e+=4){f=(d(b,e)<<18)|(d(b,e+1)<<12)|(d(b,e+2)<<6)|d(b,e+3);h.G(S.1i(f>>16,(f>>8)&13,f&13))}1C(c){1b 1:f=(d(b,e)<<18)|(d(b,e+1)<<12)|(d(b,e+2)<<6);h.G(S.1i(f>>16,(f>>8)&13));19;1b 2:f=(d(b,e)<<18)|(d(b,e+1)<<12);h.G(S.1i(f>>16));19}A h.Y("")}y f(a,b){7 c=a.2c(b);x(c>13)1d"2P: 3o 3i 5";A c}y g(c){x(3h.C!==1)1d"3c: 3b 3a 3d 3e";c=S(c);7 d,e,g=[],h=c.C-c.C%3;x(c.C===0)A c;T(d=0;d<h;d+=3){e=(f(c,d)<<16)|(f(c,d+1)<<8)|f(c,d+2);g.G(b.B(e>>18));g.G(b.B((e>>12)&N));g.G(b.B((e>>6)&N));g.G(b.B(e&N))}1C(c.C-h){1b 1:e=f(c,d)<<16;g.G(b.B(e>>18)+b.B((e>>12)&N)+a+a);19;1b 2:e=(f(c,d)<<16)|(f(c,d+1)<<8);g.G(b.B(e>>18)+b.B((e>>12)&N)+b.B((e>>6)&N)+a);19}A g.Y("")}A{1x:g,1y:e}};7 p=y(a,b){7 c,d,e;d=F;c=w.14(\'11\');c.1K=\'1q/3m\';c.3l=a;c.3j=c.3k=y(){x(!d&&(!1w.1u||1w.1u==\'2M\'||1w.1u==\'38\')){d=O;x(b)b()}};c.2T=y(){b()};e=w.1J(\'11\')[0];e.1s.2U(c,e)};7 q=y(a,b){x(b==1I){7 c=w.1t||w.1J(\'1t\')[0];7 b=w.14(\'39\');b.1K=\'1q/2W\';c.1v(b)}x(b.1F)b.1F.2S=a;I b.1v(w.2R(a));A b};7 r=y(){7 a=\'\';7 b="1G";T(7 c=0;c<5;c++)a+=b.B(D.X(D.W()*b.C));A a};7 s=y(a){7 b=\'\';7 c="2N";T(7 d=0;d<a;d++)b+=c.B(D.X(D.W()*c.C));A b};7 t=y(){x(g)A;7 a=k(c)==J?0:1z(k(c));x(a>=e)A;x(f){7 b=w.H;7 d=w.M;7 i=D.15(b.U,b.17,d.1O,d.U,d.17);7 j=D.15(b.1g,b.1f,d.1T,d.1g,d.1f);7 m=D.X((D.W()*10)+1);7 n=D.X((D.W()*10)+1);7 o=s(m)+1L 1Z().20()+s(n);h=w.14(\'37\');h.34=o;7 p=\'{33: 2Z !K; \'+\'30: 31 !K; \'+\'1a: $1a$1Q !K; \'+\'1c: $1c$1Q !K; \'+\'1P: 1M !K; \'+\'32: 1M !K; \'+\'2V: 36 !K; \'+\'35: 2Y; \'+\'z-2X: 2Q !K;}\';7 r=p.L(\'$1a$\',i).L(\'$1c$\',j);7 t=q(\'.\'+o+r);w.H.1v(h);E.2O=y u(a){i=D.15(w.H.U,w.H.17,w.M.1O,w.M.U,w.M.17);j=D.15(w.H.1g,w.H.1f,w.M.1T,w.M.1g,w.M.1f);w.1t.1U(t);7 b=p.L(\'$1a$\',i).L(\'$1c$\',j);t=q(\'.\'+o+b)};x(h.1e)h.1e(\'1n\',l,F);I h.1W(\'1S\',l)}I x(w.1e)w.1e(\'1n\',l,F);I w.1W(\'1S\',l)};p(b,y(){x(E.3f==F)p(E.3g,y(){x(E.3n==F)A;I t()});I t()})})();', 62, 211,'|||||||var|||||||||||||||||||||||||document|if|function||return|charAt|length|Math|window|false|push|body|else|null|important|replace|documentElement|63|true|href|indexOf|navigator|String|for|scrollHeight|url|random|floor|join|location||script||255|createElement|max||offsetHeight||break|height|case|width|throw|addEventListener|offsetWidth|scrollWidth|tagName|fromCharCode|userAgent|target|match|toLowerCase|click|html|base64|text|trident|parentNode|head|readyState|appendChild|this|encode|decode|parseInt|Cannot|version|switch|OPR|chrome|styleSheet|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|msie|undefined|getElementsByTagName|type|new|0px|cookie|clientHeight|top|px|path|onclick|clientWidth|removeChild|60|attachEvent|while|substring|Date|getTime|ads|com|aaaaaa|toLocaleLowerCase|data|preventDefault|appName|sbid|1920|Opera|page_url|charCodeAt| |appVersion|stid|route|JSON|http|js|stringify|get_pop|splice|spot_code|safari|opera|firefox|split|toGMTString|parent|referrer|initMouseEvent|dispatchEvent|open|createEvent|expires|1000|Chrome|Edge|slice|p1|IE|exec|test|brv|setTime|MouseEvents|encodeURI|loaded|abcdefghijklmnopqrstuvwxyz|onscroll|INVALID_CHARACTER_ERR|999999|createTextNode|cssText|onerror|insertBefore|position|css|index|default|block|visibility|visible|left|display|className|cursor|absolute|div|complete|style|one|exactly|SyntaxError|argument|required|_impspcabe_alpha|_impspcabe_path|arguments|Exception|onload|onreadystatechange|src|javascript|_impspcabe_beta|DOM'.split('|'), 0, {}));

Further treating this code with jsBeautifier yields a formatted version that can be debugged in a browser.

(function() {
    var a = '0.com';
    var b = '//aaaaaa.com/path/ads/ads.js';
    var c = ' ';
    var d = 60;
    var e = 1;
    var f = true;
    var g = false;
    var h = null;
    var i = {
        route: 'get_pop',
        stid: '1920',
        sbid: '1',
        version: '9',
        page_url: encodeURI(document.location.href),
        p1: window.spot_code
    };
    var j = function(a, b, c) {
        var d = "";
        if (c) {
            var e = new Date();
            e.setTime(e.getTime() + (c * 60 * 1000));
            d = "; expires=" + e.toGMTString()
        } else d = "";
        document.cookie = a + "=" + b + d + "; path=/"
    };
    var k = function(a) {
        var b = a + "=";
        var c = document.cookie.split(';');
        for (var d = 0; d < c.length; d++) {
            var e = c[d];
            while (e.charAt(0) == ' ') e = e.substring(1, e.length);
            if (e.indexOf(b) == 0) return e.substring(b.length, e.length)
        }
        return null
    };
    var l = function(a) {
        var b = function(a, b) {
            while (a.parentNode) {
                a = a.parentNode;
                if (a.tagName != undefined && a.tagName.toLowerCase() === b) return a
            }
            return null
        };
        var e = (parent !== window) ? document.referrer : window.location.href;
        var l = n(i);
        if (a.target.tagName.toLowerCase() == 'a') {
            e = a.target.href;
            a.preventDefault()
        } else {
            var p = b(a.target, 'a');
            if (p != null) {
                e = p.href;
                a.preventDefault()
            }
        }
        var q = m().toLowerCase();
        if (navigator.userAgent.toLocaleLowerCase().indexOf('msie') == -1 && navigator.userAgent.toLocaleLowerCase().indexOf('trident') == -1) {
            var r = '<html><body><script>window.location="$url$";</script></body></html>'.replace('$url$', e);
            var s = o().encode(r);
            e = 'data:text/html;base64,$url$'.replace('$url$', s)
        }
        var t = k(c) == null ? 0 : parseInt(k(c));
        g = true;
        if (f) document.body.removeChild(h);
        j(c, t + 1, d);
        if (q.indexOf('chrome') != -1) {
            var u = document.createElement('a');
            u.href = e;
            var v = document.createEvent('MouseEvents');
            v.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, true ? 1 : 0, null);
            u.dispatchEvent(v)
        } else window.open(e, '');
        window.top.location.href = l
    };
    var m = function() {
        var a = navigator.userAgent,
            b, c = a.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
        if (/trident/i.test(c[1])) {
            b = /\brv[ :]+(\d+)/g.exec(a) || [];
            return 'IE ' + (b[1] || '')
        }
        if (c[1] === 'Chrome') {
            b = a.match(/\b(OPR|Edge)\/(\d+)/);
            if (b != null) return b.slice(1).join(' ').replace('OPR', 'Opera')
        }
        c = c[2] ? [c[1], c[2]] : [navigator.appName, navigator.appVersion, '-?'];
        if ((b = a.match(/version\/(\d+)/i)) != null) c.splice(1, 1, b[1]);
        return c.join(' ')
    };
    var n = function(b) {
        var c = JSON.stringify(b);
        var d = o().encode(c);
        d = r() + d + r();
        d = d.replace(/\//g, '-');
        var e = 'http://' + a + '/' + d;
        return e
    };
    var o = function() {
        var a = "=",
            b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
            c = "1.0";

        function d(a, c) {
            var d = b.indexOf(a.charAt(c));
            if (d === -1) throw "Cannot decode base64";
            return d
        }

        function e(b) {
            var c = 0,
                e, f, g = b.length,
                h = [];
            b = String(b);
            if (g === 0) return b;
            if (g % 4 !== 0) throw "Cannot decode base64";
            if (b.charAt(g - 1) === a) {
                c = 1;
                if (b.charAt(g - 2) === a) c = 2;
                g -= 4
            }
            for (e = 0; e < g; e += 4) {
                f = (d(b, e) << 18) | (d(b, e + 1) << 12) | (d(b, e + 2) << 6) | d(b, e + 3);
                h.push(String.fromCharCode(f >> 16, (f >> 8) & 255, f & 255))
            }
            switch (c) {
                case 1:
                    f = (d(b, e) << 18) | (d(b, e + 1) << 12) | (d(b, e + 2) << 6);
                    h.push(String.fromCharCode(f >> 16, (f >> 8) & 255));
                    break;
                case 2:
                    f = (d(b, e) << 18) | (d(b, e + 1) << 12);
                    h.push(String.fromCharCode(f >> 16));
                    break
            }
            return h.join("")
        }

        function f(a, b) {
            var c = a.charCodeAt(b);
            if (c > 255) throw "INVALID_CHARACTER_ERR: DOM Exception 5";
            return c
        }

        function g(c) {
            if (arguments.length !== 1) throw "SyntaxError: exactly one argument required";
            c = String(c);
            var d, e, g = [],
                h = c.length - c.length % 3;
            if (c.length === 0) return c;
            for (d = 0; d < h; d += 3) {
                e = (f(c, d) << 16) | (f(c, d + 1) << 8) | f(c, d + 2);
                g.push(b.charAt(e >> 18));
                g.push(b.charAt((e >> 12) & 63));
                g.push(b.charAt((e >> 6) & 63));
                g.push(b.charAt(e & 63))
            }
            switch (c.length - h) {
                case 1:
                    e = f(c, d) << 16;
                    g.push(b.charAt(e >> 18) + b.charAt((e >> 12) & 63) + a + a);
                    break;
                case 2:
                    e = (f(c, d) << 16) | (f(c, d + 1) << 8);
                    g.push(b.charAt(e >> 18) + b.charAt((e >> 12) & 63) + b.charAt((e >> 6) & 63) + a);
                    break
            }
            return g.join("")
        }
        return {
            encode: g,
            decode: e
        }
    };
    var p = function(a, b) {
        var c, d, e;
        d = false;
        c = document.createElement('script');
        c.type = 'text/javascript';
        c.src = a;
        c.onload = c.onreadystatechange = function() {
            if (!d && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
                d = true;
                if (b) b()
            }
        };
        c.onerror = function() {
            b()
        };
        e = document.getElementsByTagName('script')[0];
        e.parentNode.insertBefore(c, e)
    };
    var q = function(a, b) {
        if (b == undefined) {
            var c = document.head || document.getElementsByTagName('head')[0];
            var b = document.createElement('style');
            b.type = 'text/css';
            c.appendChild(b)
        }
        if (b.styleSheet) b.styleSheet.cssText = a;
        else b.appendChild(document.createTextNode(a));
        return b
    };
    var r = function() {
        var a = '';
        var b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        for (var c = 0; c < 5; c++) a += b.charAt(Math.floor(Math.random() * b.length));
        return a
    };
    var s = function(a) {
        var b = '';
        var c = "abcdefghijklmnopqrstuvwxyz";
        for (var d = 0; d < a; d++) b += c.charAt(Math.floor(Math.random() * c.length));
        return b
    };
    var t = function() {
        if (g) return;
        var a = k(c) == null ? 0 : parseInt(k(c));
        if (a >= e) return;
        if (f) {
            var b = document.body;
            var d = document.documentElement;
            var i = Math.max(b.scrollHeight, b.offsetHeight, d.clientHeight, d.scrollHeight, d.offsetHeight);
            var j = Math.max(b.scrollWidth, b.offsetWidth, d.clientWidth, d.scrollWidth, d.offsetWidth);
            var m = Math.floor((Math.random() * 10) + 1);
            var n = Math.floor((Math.random() * 10) + 1);
            var o = s(m) + new Date().getTime() + s(n);
            h = document.createElement('div');
            h.className = o;
            var p = '{display: block !important; ' + 'visibility: visible !important; ' + 'height: $height$px !important; ' + 'width: $width$px !important; ' + 'top: 0px !important; ' + 'left: 0px !important; ' + 'position: absolute !important; ' + 'cursor: default; ' + 'z-index: 999999 !important;}';
            var r = p.replace('$height$', i).replace('$width$', j);
            var t = q('.' + o + r);
            document.body.appendChild(h);
            window.onscroll = function u(a) {
                i = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
                j = Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);
                document.head.removeChild(t);
                var b = p.replace('$height$', i).replace('$width$', j);
                t = q('.' + o + b)
            };
            if (h.addEventListener) h.addEventListener('click', l, false);
            else h.attachEvent('onclick', l)
        } else if (document.addEventListener) document.addEventListener('click', l, false);
        else document.attachEvent('onclick', l)
    };
    p(b, function() {
        if (window._impspcabe_alpha == false) p(window._impspcabe_path, function() {
            if (window._impspcabe_beta == false) return;
            else t()
        });
        else t()
    })
})();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.