Second second break eval encryption

Preface

  to be exact, the code processed by eval should be called compressed code, but the effect is the same as encrypted code! Many small partners don't want to let others see their own js code directly, so they often take such measures. However, in fact, such a method can only defend those little whites. For the real big guy, cracking is a matter of seconds! It's really seconds! Don't say much, let's go straight to the point!

Demo code:

eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[1-9a-g]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(document).ready(3(){1 s=window.screen;1 4=q.4=s.4;1 7=q.7;1 5=Array(300).join(0).split(\'\');1 2=q.9(\'a\');1 b=3(){2.c=\'rgba(0,0,0,.05)\';2.fillRect(0,0,4,7);2.c=\'red\';2.font=\'10pt Georgia\';5.map(3(y,6){d=String.fromCharCode(1e2+e.f()*33);x=(6*8)+8;q.9(\'a\').fillText(d,x,y);if(y>e.f()*1e4){5[6]=0}else{5[6]=y+8}})};g();3 g(){Game_Interval=setInterval(b,30)}});',[],17,'|var|ctx|function|width|yPositions|index|height|10|getContext|2d|draw|fillStyle|text|Math|random|RunMatrix'.split('|'),0,{}))

Operation steps

  1. Open the browser console;

  2. Transfer to Console;

  3. Copy code, paste;

  4. Delete the four characters "eval";

  5. Enter.

Don't tell me you won't come back

Decrypted Code:

$(document).ready(function () {
    var s = window.screen;
    var width = q.width = s.width;
    var height = q.height;
    var yPositions = Array(300).join(0).split('');
    var ctx = q.getContext('2d');
    var draw = function () {
        ctx.fillStyle = 'rgba(0,0,0,.05)';
        ctx.fillRect(0, 0, width, height);
        ctx.fillStyle = 'red';
        ctx.font = '10pt Georgia';
        yPositions.map(function (y, index) {
            text = String.fromCharCode(1e2 + Math.random() * 33);
            x = (index * 10) + 10;
            q.getContext('2d').fillText(text, x, y);
            if (y > Math.random() * 1e4) {
                yPositions[index] = 0;
            } else {
                yPositions[index] = y + 10;
            }
        });
    };
    RunMatrix();
    function RunMatrix() {
        Game_Interval = setInterval(draw, 30);
    }
});

The following is the complete code of the original version (reproduced in https://www.cnblogs.com/fenger-VIP/p/7651562.html, which I haven't used, just for demonstration...):

<html>
<head>
    <title>The Matrix</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
            type="text/javascript"></script>
    <meta charset="utf-8">
    <script>
        /*
            ① Set refresh interval with setInterval(draw, 33)

            ② Randomly generate letters with String.fromCharCode(1e2+Math.random()*33)

            ③ Using ctx.fillStyle = 'rgba(0,0,0,.05)'; ctx.fillRect(0,0,width,height); ctx.fillStyle = 'ා0F0'; repeatedly generate translucent black background with opacity of 0.5

            ④ Use x = (index * 10)+10; and yPositions[index] = y + 10; to determine the position of the displayed letters

            ⑤ Use fillText(text, x, y); display more than one letter in the specified position to cycle through steps, which will produce the Title Effect of matrix.
        */
        $(document).ready(function () {
            var s = window.screen;
            var width = q.width = s.width;
            var height = q.height;
            var yPositions = Array(300).join(0).split('');
            var ctx = q.getContext('2d');
            var draw = function () {
                ctx.fillStyle = 'rgba(0,0,0,.05)';
                ctx.fillRect(0, 0, width, height);
                ctx.fillStyle = 'red';
                ctx.font = '10pt Georgia';
                yPositions.map(function (y, index) {
                    text = String.fromCharCode(1e2 + Math.random() * 33);
                    x = (index * 10) + 10;
                    q.getContext('2d').fillText(text, x, y);
                    if (y > Math.random() * 1e4) {
                        yPositions[index] = 0;
                    } else {
                        yPositions[index] = y + 10;
                    }
                });
            };
            RunMatrix();
            function RunMatrix() {
                Game_Interval = setInterval(draw, 30);
            }
        });
    </script>
</head>
<body>
    <div align="center">
        <canvas id="q" width="500" height="500"></canvas>
    </div>
</body>
</html>

Finally, several popular eval encryption and decryption websites of Amway

proposal

It is recommended to decrypt after encryption, and check whether the decryption code is consistent with the source code!

Tags: Javascript JQuery

Posted on Tue, 11 Feb 2020 10:32:17 -0500 by coalgames