V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
lopetver
V2EX  ›  JavaScript

如何拿到这段 js 的执行结果?

  •  
  •   lopetver · 2023-01-04 17:32:44 +08:00 · 1894 次点击
    这是一个创建于 690 天前的主题,其中的信息可能已经有所发展或是发生改变。

    代码如下,简单说下个人需求,主要想拿到 204 行 return 的值。

    我尝试在代码首部定义全局变量 tmp ,然后在 203-204 行之间,在值返回之前赋值给全局变量 tmp ,然后执行完 CQjMxzxLaXGTrtvnVcFE 函数后,打印 tmp 是 undefined ,不明白白为什么拿不到返回值?

    function CQjMxzxLaXGTrtvnVcFE() {
        var GZCRpKjpbIauSFcLikZt = function() {
            function euRjxktMQksoGYXCFJDX() {
                var a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = 229;
                var a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = 129;
                var ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = 72;
                var e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d = 206;
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = ~ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d;
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = function(sZgqq, SiIBD, NByfu) {
                    function kaNlT(dgmUw) {
                        this.MBXPx = function() {
                            return this.xfcYc ^ dgmUw;
                        }
                    }
                    ;var uFWNI = {
                        xfcYc: NByfu
                    };
                    var uCnsU = new kaNlT(sZgqq);
                    uCnsU.xfcYc = SiIBD;
                    kaNlT.prototype = uFWNI;
                    return uCnsU.MBXPx() | (new kaNlT(SiIBD)).MBXPx();
                }(ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d, a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe, ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e & ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d;
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = ~(a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe & a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e);
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = function(CEwQP, uVixm, rSKVP) {
                    function gfyqB(EQrmC) {
                        this.zkgJY = function() {
                            return this.tUhKR ^ EQrmC;
                        }
                    }
                    ;var eYQmY = {
                        tUhKR: rSKVP
                    };
                    var lwZPs = new gfyqB(CEwQP);
                    lwZPs.tUhKR = uVixm;
                    gfyqB.prototype = eYQmY;
                    return lwZPs.zkgJY() | (new gfyqB(uVixm)).zkgJY();
                }(ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d, a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e, ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = function(isMcK, tTxcN, PoFvB) {
                    var jNOYu = document.createElement('div');
                    jNOYu.setAttribute('style', 'display:none;');
                    document.getElementsByTagName('body')[0].appendChild(jNOYu);
                    function AwZLc(kccWN, ToAkE) {
                        for (var i = 0; i < 8; i++) {
                            var lyITu = document.createElement('div');
                            kccWN.appendChild(lyITu);
                            lyITu.innerText = ToAkE;
                            if ((ToAkE & 1) == 0)
                                kccWN = lyITu;
                            ToAkE = ToAkE >> 1;
                        }
                        return kccWN;
                    }
                    ;function wKmFx(lyITu, jNOYu, ToAkE) {
                        if (!lyITu || lyITu == jNOYu)
                            return ToAkE % 256;
                        while (lyITu.children.length > 0)
                            lyITu.removeChild(lyITu.lastElementChild);
                        return wKmFx(lyITu.parentNode, jNOYu, ToAkE + parseInt(lyITu.innerText));
                    }
                    ;var ToAkE = wKmFx(AwZLc(AwZLc(AwZLc(jNOYu, isMcK), tTxcN), PoFvB), jNOYu, 0);
                    jNOYu.parentNode.removeChild(jNOYu);
                    return ToAkE;
                }(a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e, a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e, a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e & a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe;
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = function(rGwMx, tPieU, QMGho) {
                    function Abidx(oXXPv) {
                        this.xFDwl = function() {
                            return this.DJnEq ^ oXXPv;
                        }
                    }
                    ;var FHUfX = {
                        DJnEq: QMGho
                    };
                    var gPVxq = new Abidx(rGwMx);
                    gPVxq.DJnEq = tPieU;
                    Abidx.prototype = FHUfX;
                    return gPVxq.xFDwl() | (new Abidx(tPieU)).xFDwl();
                }(a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d);
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = ~a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe;
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e | ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d;
                e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d = ~(e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d & a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e ^ a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e;
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = function(sjxcY, hQcGz, iOZft) {
                    function ffayE(ExiaV) {
                        this.yOQXo = function() {
                            return this.eCOKz ^ ExiaV;
                        }
                    }
                    ;var jDSUg = {
                        eCOKz: iOZft
                    };
                    var GAAnM = new ffayE(sjxcY);
                    GAAnM.eCOKz = hQcGz;
                    ffayE.prototype = jDSUg;
                    return GAAnM.yOQXo() | (new ffayE(hQcGz)).yOQXo();
                }(a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d, a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e ^ new Date(a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e * 10000000000).getUTCDate();
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d | a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e;
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d & e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d;
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e ^ new Date(a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e * 10000000000).getUTCDate();
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe | ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d;
                e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d = ~(e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d & ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d);
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = function(QuDmo, RjHiF, QBDmx) {
                    var BlUDD = document.createElement('div');
                    BlUDD.setAttribute('style', 'display:none;');
                    document.getElementsByTagName('body')[0].appendChild(BlUDD);
                    function VFGUX(NEpcU, UaykK) {
                        for (var i = 0; i < 8; i++) {
                            var dkymk = document.createElement('div');
                            NEpcU.appendChild(dkymk);
                            dkymk.innerText = UaykK;
                            if ((UaykK & 1) == 0)
                                NEpcU = dkymk;
                            UaykK = UaykK >> 1;
                        }
                        return NEpcU;
                    }
                    ;function rQNdt(dkymk, BlUDD, UaykK) {
                        if (!dkymk || dkymk == BlUDD)
                            return UaykK % 256;
                        while (dkymk.children.length > 0)
                            dkymk.removeChild(dkymk.lastElementChild);
                        return rQNdt(dkymk.parentNode, BlUDD, UaykK + parseInt(dkymk.innerText));
                    }
                    ;var UaykK = rQNdt(VFGUX(VFGUX(VFGUX(BlUDD, QuDmo), RjHiF), QBDmx), BlUDD, 0);
                    BlUDD.parentNode.removeChild(BlUDD);
                    return UaykK;
                }(ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d, a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = ~a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e;
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = function(lTTEa, nEigJ, gOpwx) {
                    function XxKXu(yaeRm) {
                        this.IgydJ = function() {
                            return this.gDWsP ^ yaeRm;
                        }
                    }
                    ;var dvNTO = {
                        gDWsP: gOpwx
                    };
                    var uqzCT = new XxKXu(lTTEa);
                    uqzCT.gDWsP = nEigJ;
                    XxKXu.prototype = dvNTO;
                    return uqzCT.IgydJ() | (new XxKXu(nEigJ)).IgydJ();
                }(a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe, a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d);
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe ^ a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e;
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = function(QmOvW, alIyF, GPBJr) {
                    function PWtlc(FcPtb) {
                        this.boWPa = function() {
                            return this.BSkad ^ FcPtb;
                        }
                    }
                    ;var nxSiQ = {
                        BSkad: GPBJr
                    };
                    var LhLKV = new PWtlc(QmOvW);
                    LhLKV.BSkad = alIyF;
                    PWtlc.prototype = nxSiQ;
                    return LhLKV.boWPa() | (new PWtlc(alIyF)).boWPa();
                }(ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d, a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d);
                ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d = ~ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d;
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = ~(a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe & a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = function(YohRX, obnUm, nrNCA) {
                    var bNUEr = document.createElement('div');
                    bNUEr.setAttribute('style', 'display:none;');
                    document.getElementsByTagName('body')[0].appendChild(bNUEr);
                    function epsWW(aoRhv, BuXNg) {
                        for (var i = 0; i < 8; i++) {
                            var dmeAN = document.createElement('div');
                            aoRhv.appendChild(dmeAN);
                            dmeAN.innerText = BuXNg;
                            if ((BuXNg & 1) == 0)
                                aoRhv = dmeAN;
                            BuXNg = BuXNg >> 1;
                        }
                        return aoRhv;
                    }
                    ;function puhPQ(dmeAN, bNUEr, BuXNg) {
                        if (!dmeAN || dmeAN == bNUEr)
                            return BuXNg % 256;
                        while (dmeAN.children.length > 0)
                            dmeAN.removeChild(dmeAN.lastElementChild);
                        return puhPQ(dmeAN.parentNode, bNUEr, BuXNg + parseInt(dmeAN.innerText));
                    }
                    ;var BuXNg = puhPQ(epsWW(epsWW(epsWW(bNUEr, YohRX), obnUm), nrNCA), bNUEr, 0);
                    bNUEr.parentNode.removeChild(bNUEr);
                    return BuXNg;
                }(a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e, ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d, ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d);
                a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe = function(wBRPr, jKJfO, bIqbJ) {
                    function GgXSy(YFZJM) {
                        this.ktAOb = function() {
                            return this.iwQVd ^ YFZJM;
                        }
                    }
                    ;var GAaMZ = {
                        iwQVd: bIqbJ
                    };
                    var ZyhwO = new GgXSy(wBRPr);
                    ZyhwO.iwQVd = jKJfO;
                    GgXSy.prototype = GAaMZ;
                    return ZyhwO.ktAOb() | (new GgXSy(jKJfO)).ktAOb();
                }(a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe, e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d, a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e);
                a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e = ~(a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e & a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e);
                e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d = e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d | ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d;
                return {
                    'rf': {
                        'a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe': a3fd14a717921ef2f82fa170697ed7e814c16e1d5a184265f1b318c1e1d89cbe,
                        'a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e': a85d600abb0bdc23a13563aa41e4428397044ac419deb63e0c654485719dc12e,
                        'ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d': ab7ce96be41812b7d5091c781d58bb3eccca4e1479367779421070e87966039d,
                        'e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d': e9ac44df2d813157efafb2d99585637b5f9d17f001b0717c58790fa4c0d56e0d
                    },
                    's': 'fJkS8qZhdSrnm0A4fIQBW1o-ay7AjwirXO2Rxxd_rt2tUmrb7QX_1JZFTV8VaUf8gvToaY5pPku0ABKmUfMghA1Swlb74CyVxgreYQK3btiWp3YOViHS_05jng5h9LZxUzCvauBwhRfaNblRs-WiOCcSLct1RFYCMuzkok8WguLsRyQB2kKUWsQ6slMGU9RtLddIpbzrV_Nc2riIr-t20UY5U9THgJc_7P4wHpMQeFjFql5aWYj3SU27xRhadHPI8ltgI-MhxyO2k8QK6WDiJqKF3k7yWNmWcHrqqijBTShFWmxwBGo9RFEy3SSO0FfYYopRJVwVhKFY8cXiaqdEdAAAAYV8GGDL'
                };
            }
            ;var ECdMsSbFWk;
            try {
                ECdMsSbFWk = JSON.stringify(euRjxktMQksoGYXCFJDX());
            } catch (e) {
                ECdMsSbFWk = "exception " + e;
            }
            var inputs;
            inputs = document.getElementsByName('ui_metrics');
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].value = ECdMsSbFWk;
            }
    
        }
    
        var hrTmkBifGXUInziuDWEN = function() {
            document.removeEventListener('DOMContentLoaded', hrTmkBifGXUInziuDWEN);
            window.removeEventListener('load', hrTmkBifGXUInziuDWEN);
            window.setTimeout(GZCRpKjpbIauSFcLikZt);
        }
    
        if (document.readyState === 'complete') {
            window.setTimeout(GZCRpKjpbIauSFcLikZt);
        } else {
            document.addEventListener('DOMContentLoaded', hrTmkBifGXUInziuDWEN);
            window.addEventListener('load', hrTmkBifGXUInziuDWEN);
        }
    }
    ;CQjMxzxLaXGTrtvnVcFE();
    
    
    7 条回复    2023-01-05 16:38:09 +08:00
    jishuliu
        1
    jishuliu  
       2023-01-04 17:35:28 +08:00
    浏览器的话可以打断点看一下。也可以修改代码,然后覆盖远程的 js 文件
    lopetver
        2
    lopetver  
    OP
       2023-01-04 17:40:02 +08:00
    @jishuliu 断点打了,不用在意混淆。在浏览器中 console.log()是能正常出值的
    lzj724
        3
    lzj724  
       2023-01-04 17:44:21 +08:00
    我比较好奇是用什么插件混淆的
    lopetver
        4
    lopetver  
    OP
       2023-01-04 17:48:36 +08:00
    @lzj724 额,好吧。不知道什么混淆的,我只知道这是个动态 js 每次请求回来的代码变量都会改变
    leopod1995
        5
    leopod1995  
       2023-01-04 18:05:15 +08:00
    小学问题 你能找到 204 行是哪一行吗
    nekochyan
        6
    nekochyan  
       2023-01-04 18:51:48 +08:00   ❤️ 1
    因为这些代码并不是同步执行的,里面有 setTimeout ,也就是说你 console.log()的时候 temp 还没有被赋值,可以尝试给 console 也加个 setTimeout
    setTimeout(()=>{
    console.error(tmp)
    },1000)
    lopetver
        7
    lopetver  
    OP
       2023-01-05 16:38:09 +08:00
    @nekochyan 感谢大佬,加上延迟后,确实可以拿到值了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2711 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 11:10 · PVG 19:10 · LAX 03:10 · JFK 06:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.