如何编写这样的JavaScript?

时间:2016-02-15 18:34:46

标签: javascript obfuscation

老实说,我很想知道如何编写这类代码?我真的很想学。我不知道为什么,但它看起来很有趣。我根本无法理解。我只能在用http://ddecode.com/hexdecoder/

解码时阅读

以下是我的观点,如何编写此类代码?

演示:(仅举例)

    var _0x66ee=["\x64\x69\x73\x61\x62\x6C\x65\x64","\x61\x74\x74\x72","\x23\x6D\x61\x74\x6F\x6B\x65\x6E","\x68\x69\x64\x65","\x23\x62\x74\x6E\x2D\x63\x6C\x69\x63\x6B","\x73\x68\x6F\x77","\x23\x62\x74\x6E\x2D\x6C\x6F\x61\x64","\x72\x65\x6D\x6F\x76\x65\x41\x74\x74\x72","\x2E\x6C\x6F\x67\x69\x6E\x5F\x72\x65\x73\x75\x6C\x74","\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x62\x72\x3E\x3C\x69\x6D\x67\x20\x73\x72\x63\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x69\x67\x74\x62\x2E\x63\x6F\x6D\x2F\x73\x69\x74\x65\x73\x2F\x61\x6C\x6C\x2F\x74\x68\x65\x6D\x65\x73\x2F\x74\x62\x5F\x77\x61\x6C\x6C\x2F\x69\x6D\x61\x67\x65\x73\x2F\x6C\x6F\x61\x64\x69\x6E\x67\x2D\x69\x6D\x67\x2E\x67\x69\x66\x22\x3E\x3C\x2F\x69\x6D\x67\x3E\x20\u0110\x61\x6E\x67\x20\u0111\u0103\x6E\x67\x20\x78\x75\u1EA5\x74\x20\x76\x75\x69\x20\x6C\xF2\x6E\x67\x20\u0111\u1EE3\x69\x20\x74\x72\x6F\x6E\x67\x20\x67\x69\xE2\x79\x20\x6C\xE1\x74\x20\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E","\x68\x74\x6D\x6C","\x6C\x6F\x67\x6F\x75\x74\x3D\x6C\x6F\x67\x6F\x75\x74","\x50\x4F\x53\x54","\x69\x6E\x64\x65\x78\x2E\x70\x68\x70","\x61\x6A\x61\x78","\x63\x6C\x69\x63\x6B","\x23\x6C\x6F\x67\x6F\x75\x74","\x66\x6F\x63\x75\x73","\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x62\x72\x3E\x3C\x69\x6D\x67\x20\x73\x72\x63\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x69\x67\x74\x62\x2E\x63\x6F\x6D\x2F\x73\x69\x74\x65\x73\x2F\x61\x6C\x6C\x2F\x74\x68\x65\x6D\x65\x73\x2F\x74\x62\x5F\x77\x61\x6C\x6C\x2F\x69\x6D\x61\x67\x65\x73\x2F\x6C\x6F\x61\x64\x69\x6E\x67\x2D\x69\x6D\x67\x2E\x67\x69\x66\x22\x3E\x3C\x2F\x69\x6D\x67\x3E\x20\u0110\x61\x6E\x67\x20\x78\u1EED\x20\x6C\xFD\x20\u0111\u0103\x6E\x67\x20\x6E\x68\u1EAD\x70\x20\x76\x75\x69\x20\x6C\xF2\x6E\x67\x20\u0111\u1EE3\x69\x20\x74\x72\x6F\x6E\x67\x20\x67\x69\xE2\x79\x20\x6C\xE1\x74\x20\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E","\x76\x61\x6C","","\x3C\x62\x72\x3E\x3C\x6C\x69\x20\x63\x6C\x61\x73\x73\x3D\x22\x61\x6C\x65\x72\x74\x20\x61\x6C\x65\x72\x74\x2D\x64\x61\x6E\x67\x65\x72\x22\x3E\x42\u1EA1\x6E\x20\x63\x68\u01B0\x61\x20\x6E\x68\u1EAD\x70\x20\x74\x6F\x6B\x65\x6E\x20\x76\x75\x69\x20\x6C\xF2\x6E\x67\x20\x6C\u1EA5\x79\x20\x74\x6F\x6B\x65\x6E\x20\u0111\u0103\x6E\x67\x20\x6E\x68\u1EAD\x70\x20\x6C\u1EA1\x69\x2E\x3C\x2F\x6C\x69\x3E","\x74\x6F\x6B\x65\x6E\x3D","\x64\x61\x6E\x67\x6E\x68\x61\x70\x2E\x70\x68\x70","\x23\x6C\x6F\x67\x69\x6E","\x72\x65\x61\x64\x79"]
var _0x8d8f=[_0x66ee[0],_0x66ee[1],_0x66ee[2],_0x66ee[3],_0x66ee[4],_0x66ee[5],_0x66ee[6],_0x66ee[7],_0x66ee[8],_0x66ee[9],_0x66ee[10],_0x66ee[11],_0x66ee[12],_0x66ee[13],_0x66ee[14],_0x66ee[15],_0x66ee[16],_0x66ee[17],_0x66ee[18],_0x66ee[19],_0x66ee[20],_0x66ee[21],_0x66ee[22],_0x66ee[23],_0x66ee[24],_0x66ee[25]]
var _0xa1dc=[_0x8d8f[0],_0x8d8f[1],_0x8d8f[2],_0x8d8f[3],_0x8d8f[4],_0x8d8f[5],_0x8d8f[6],_0x8d8f[7],_0x8d8f[8],_0x8d8f[9],_0x8d8f[10],_0x8d8f[11],_0x8d8f[12],_0x8d8f[13],_0x8d8f[14],_0x8d8f[15],_0x8d8f[16],_0x8d8f[17],_0x8d8f[18],_0x8d8f[19],_0x8d8f[20],_0x8d8f[21],_0x8d8f[22],_0x8d8f[23],_0x8d8f[24],_0x8d8f[25]];
var _0x951b=[_0xa1dc[0],_0xa1dc[1],_0xa1dc[2],_0xa1dc[3],_0xa1dc[4],_0xa1dc[5],_0xa1dc[6],_0xa1dc[7],_0xa1dc[8],_0xa1dc[9],_0xa1dc[10],_0xa1dc[11],_0xa1dc[12],_0xa1dc[13],_0xa1dc[14],_0xa1dc[15],_0xa1dc[16],_0xa1dc[17],_0xa1dc[18],_0xa1dc[19],_0xa1dc[20],_0xa1dc[21],_0xa1dc[22],_0xa1dc[23],_0xa1dc[24],_0xa1dc[25]];
function btn_load(_0x8c7ax5)
{
    _0x8c7ax5[_0x951b[1]](_0x951b[0],_0x951b[0]);
    $(_0x951b[2])[_0x951b[1]](_0x951b[0],_0x951b[0]);
    $(_0x951b[4])[_0x951b[3]]();
    $(_0x951b[6])[_0x951b[5]]()
}
function btn_reset(_0x8c7ax5)
{
    _0x8c7ax5[_0x951b[7]](_0x951b[0]);
    $(_0x951b[2])[_0x951b[7]](_0x951b[0]);
    $(_0x951b[4])[_0x951b[5]]();
    $(_0x951b[6])[_0x951b[3]]()
}
$(document)[_0x951b[25]](function()
{
    $(_0x951b[16])[_0x951b[15]](function()
    {
        var _0x8c7ax7=$(_0x951b[8]);
        _0x8c7ax7[_0x951b[10]](_0x951b[9]);
        var _0x8c7ax8=_0x951b[11];
        $[_0x951b[14]]({type:_0x951b[12],data:_0x8c7ax8,url:_0x951b[13],success:function(_0x8c7ax9)
        {
            _0x8c7ax7[_0x951b[10]](_0x8c7ax9)
        }
        })
    }
    );
    $(_0x951b[2])[_0x951b[17]]();
    $(_0x951b[24])[_0x951b[15]](function()
    {
        var _0x8c7axa=$(_0x951b[2]);
        var _0x8c7ax7=$(_0x951b[8]);
        _0x8c7ax7[_0x951b[10]](_0x951b[18]);
        if(_0x8c7axa[_0x951b[19]]()==_0x951b[20])
        {
            $[_0x951b[14]]({success:function(_0x8c7ax9)
            {
                _0x8c7ax7[_0x951b[10]](_0x951b[21]);
                btn_reset(button)
            }
            });
            return false
        }
        ;
        if(_0x8c7axa[_0x951b[19]]()!=_0x951b[20])
        {
            var _0x8c7axb=_0x951b[22]+_0x8c7axa[_0x951b[19]]();
            $[_0x951b[14]]({type:_0x951b[12],data:_0x8c7axb,url:_0x951b[23],success:function(_0x8c7ax9)
            {
                _0x8c7ax7[_0x951b[10]](_0x8c7ax9);
                btn_reset(button)
            }
            })
        }
        ;
        return false
    }
    );
    $(_0x951b[24])[_0x951b[15]](function()
    {
        button=$(this);
        btn_load(button)
    }
    )
}
)\x64\x61\x6E\x67\x6E\x68\x61\x70\x2E\x70\x68\x70

??????

2 个答案:

答案 0 :(得分:0)

之前我已经看过其中一些,其中一个你可以转换任何javascript代码只显示几个字符序列

http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html

还有一个解释:)

答案 1 :(得分:0)

快速浏览后,似乎编写此代码的人只是在全局变量的变量中创建了一些字符串。他只是用Unicode替换了字母和字符。这是唯一的伎俩。

这很棘手。除了之外没有魔法。