分享一个十分麻烦的JS解密

混淆是一种常用的 JavaScript 优化技术,它通过将代码重新命名、删除注释、简化代码等方式来减小代码体积和增加代码难度。

但是,有时候我们需要查看混淆后的代码,或者希望将其转换回原始的未混淆的版本。这时,就需要使用解密工具或者服务。

废话不多说了,贴一个昨天解的JS,部分源码如下

function F() {
            var b0 = a6
              , L = {
                'yZsYB': function(U) {
                    var aZ = b;
                    return c[aZ(0x19f)](U);
                },
                'VghoS': function(U, V) {
                    return c['tcBNB'](U, V);
                },
                'nNJLf': c[b0(0x23e)],
                'pGahF': function(U, V) {
                    var b1 = b0;
                    return c[b1(0x1d7)](U, V);
                },
                'VaHEo': function(U, V) {
                    var b2 = b0;
                    return c[b2(0x232)](U, V);
                },
                'mjZFK': c[b0(0x103)],
                'UXLxj': function(U, V) {
                    return c['lNpLw'](U, V);
                },
                'dciVZ': c[b0(0x238)],
                'iOrAA': c[b0(0xfe)],
                'GBlxF': function(U, V) {
                    var b3 = b0;
                    return c[b3(0x121)](U, V);
                },
                'UekeV': function(U, V) {
                    var b4 = b0;
                    return c[b4(0x154)](U, V);
                },
                'oRfMK': c[b0(0x1a4)],
                'zgvgB': function(U, V) {
                    var b5 = b0;
                    return c[b5(0x233)](U, V);
                },
                'LeAcS': b0(0x184),
                'nljZJ': c[b0(0x13b)],
                'BvFdD': function(U, V) {
                    return c['TTOjc'](U, V);
                },
                'cWMyz': function(U, V) {
                    var b6 = b0;
                    return c[b6(0x10c)](U, V);
                },
                'YOqtZ': c[b0(0x256)]
            };
            if (c[b0(0x23d)] !== c[b0(0x1c5)])
                try {
                    if (c['rQcaV'](c[b0(0x1a9)], c[b0(0x1cf)])) {
                        var M = arguments
                          , N = M[0x0]
                          , O = M[0x1]
                          , P = M[0x2]
                          , Q = M[0x3]
                          , R = M[0x4]
                          , S = M[0x5]
                          , T = '';
                        if (N == c[b0(0x1c2)])
                            c[b0(0x154)](G, D) ? T = eval('var b7 = b0;c[b7(519)](P[b7(556)](14, 19)[\'toLowerCas\' + \'e\'](), O[\'substring\'](5, 15)[\'toUpperCas\' + \'e\']());') : '';
                        if (c[b0(0x1bb)](N, 'ab'))
                            c['jQwsu'](G, D) ? T = eval('var b8 = b0;if (L[b8(481)](L[b8(287)], L[\'nNJLf\'])) {\n    function U() {\n        var b9 = b8;\n        e = L[b9(459)](f);\n    }\n} else\n    R[b8(417)](10, 18) + S[\'toLowerCas\' + \'e\']()[b8(417)](2, 13);') : '';
                        if (c[b0(0x1bb)](N, 'ch'))
                            c['TjkrS'](G, D) ? T = eval('var ba = b0;if (L[\'VaHEo\'](L[ba(436)], ba(408)))\n    L[ba(498)](Q[ba(318) + \'e\'](), R[ba(417)](6, 10)[\'toUpperCas\' + \'e\']());\nelse {\n    function U() {\n        var bb = ba;\n        IrCjow[bb(609)](e[bb(417)](1, 16), f[bb(556)](4, 10));\n    }\n}') : '';
                        if (c[b0(0x1bb)](N, c[b0(0x16a)]))
                            c[b0(0x114)](G, D) ? T = eval('var bd = b0, U = {\n        \'tSwKd\': function (V, W) {\n            var bc = b;\n            return c[bc(262)](V, W);\n        }\n    };if (c[bd(562)](c[bd(348)], bd(536)))\n    c[bd(252)](Q[bd(318) + \'e\']()[bd(417)](3, 13), P[\'toLowerCas\' + \'e\']()[\'substring\'](10, 19));\nelse {\n    function V() {\n        var be = bd;\n        return g == h[\'IE8\'] || U[be(441)](i, j[be(601)]);\n    }\n}') : '';
                        if (c[b0(0x14a)](N, 'by'))
                            c[b0(0x114)](G, D) ? T = eval('var bf = b0;if (L[\'dciVZ\'] !== L[bf(612)])\n    L[\'GBlxF\'](O[\'substring\'](5, 8), P[bf(508)](/a/gi, \'c\'));\nelse {\n    function U() {\n        l[m] = n[o] == p ? q[r] : s[N];\n    }\n}') : '';
                        if (c[b0(0x14a)](N, 'xa'))
                            G(D) ? T = eval('var bg = b0;O[bg(417)](1, 16) + S[bg(556)](4, 10);') : '';
                        if (c[b0(0xf0)](N, c['YtWmo']))
                            c['XMngE'](G, D) ? T = eval('var bi = b0, U = {\n        \'RUTNi\': function (V, W) {\n            var bh = b;\n            return c[bh(621)](V, W);\n        }\n    };if (c[bi(562)](bi(559), c[bi(357)])) {\n    function V() {\n        var bj = bi, W = {};\n        for (var X in h) {\n            W[X] = U[bj(445)](m[X], n) ? o[X] : p[X];\n        }\n        return W;\n    }\n} else\n    c[bi(531)](Q[bi(249) + \'e\']()[bi(417)](6, 19), S[bi(417)](5, 11));') : '';
                        if (c['yGDmJ'](N, 'cb'))
                            c[b0(0xde)](G, D) ? T = eval('var bl = b0, U = {\n        \'valoj\': function (V, W) {\n            var bk = b;\n            return L[bk(390)](V, W);\n        },\n        \'yMYZP\': L[bl(331)]\n    };if (L[\'zgvgB\'](L[bl(363)], L[bl(460)])) {\n    function V() {\n        var bm = bl;\n        return U[bm(613)](E, U[bm(312)]);\n    }\n} else\n    L[\'GBlxF\'](S[bl(417)](5, 14), P[bl(417)](2, 13)[bl(318) + \'e\']());') : '';
                        return T;
                    } else {
                        function U() {
                            var bn = b0;
                            try {
                                if (L['BvFdD'](typeof k, bn(0x14c)))
                                    return ![];
                                var V = bn(0x124) + L['cWMyz'](new l(), 0x0)
                                  , W = W[bn(0x14e) + bn(0x1e4)](bn(0x164))
                                  , X = W[bn(0x20b) + bn(0x162)]('head')[0x0];
                                return X[bn(0x163) + 're'](W, X[bn(0x1a8)]),
                                W['text'] = L[bn(0xdd)](V, L[bn(0x167)]),
                                X[bn(0x173) + 'd'](W),
                                L[bn(0x1c9)](m[V], n[V]);
                            } catch (Y) {
                                return ![];
                            }
                        }
                    }
                } catch (V) {
                    if (c[b0(0x14d)](c[b0(0x248)], c[b0(0x248)]))
                        return T;
                    else {
                        function W() {
                            var bo = b0;
                            g[bo(0x1b1)](L['UekeV'](h, i[j]));
                        }
                    }
                }
            else {
                function X() {
                    var bp = b0;
                    return e(c[bp(0x213)](c[bp(0x1d0)], f));
                }
            }
        }

我解完之后

function countPrm() {
    try {
        var type = arguments[0],
            arg1 = arguments[1],
            arg2 = arguments[2],
            arg3 = arguments[3],
            arg4 = arguments[4],
            arg5 = arguments[5],
            res = '';

        if (type == "cca") {
            buildScript($win) ? res = (arg2.slice(14, 19).toLowerCase() + arg1.substring(5, 15).toUpperCase()) : '';
        }

        if (type == 'ab') {
            buildScript($win) ? res = (arg4.substring(10, 18) + arg5.toLowerCase().substring(2, 13)) : '';
        }

        if (type == 'ch') {
            buildScript($win) ? res = (arg3.toUpperCase() + arg4.substring(6, 10).toUpperCase()) : '';
        }

        if (type == "cbc") {
            buildScript($win) ? res = (arg3.toUpperCase().substring(3, 13) + arg2.toLowerCase().substring(10, 19)) : '';
        }

        if (type == 'by') {
            buildScript($win) ? res = (arg1.substring(5, 8) + arg2.replace(/a/gi, 'c')) : '';
        }

        if (type == 'xa') {
            buildScript($win) ? res = (arg1.substring(1, 16) + arg5.slice(4, 10)) : '';
        }

        if (type == "cza") {
            buildScript($win) ? res = (arg3.toLowerCase().substring(6, 19) + arg5.substring(5, 11)) : '';
        }

        if (type == 'cb') {
            buildScript($win) ? res = (arg5.substring(5, 14) + arg2.substring(2, 13).toUpperCase()) : '';
        }

        return res;
    } catch (e) {
        return res;
    }
}
解密后感言

我很少见到这么丧心病狂的加密方式,可以说仅次于jsjiami.com的中级模式。

有其他加密也可以找我们解密,可以说没有解不开的,只有解密成本问题。

jsjiami.com 底部有我的联系方式

你可能感兴趣的:(javascript)