How do I make sense of this apparently deliberately obscurified JS code?

梦想与她 提交于 2019-12-22 14:49:08

问题


I'm trying to code my own, private interface for asking questions on Stack (without using the API, which requires an account, which defeats the point of having some minimal amount of anonymity), because I strongly prefer to have my own form in my own "control panel" where I can type it according to my own setup.

After spending countless hours on this, I have come to the conclusion that Stack entirely refuses anyone trying to post without JavaScript enabled. When JavaScript is enabled in a normal browser, it fetches all sorts of .js files which, through some very convoluted manner, generates a string which it puts into the hidden form field "i1l" (which is not present in the HTML from the beginning).

I have painstakingly reverse-engineered this but I get stuck at the last step, where it goes crazy with the obscurified code. This is how it does it (these snippets are from several different .js files, and have been beautified for the purpose of showing them in a more sane manner here):

The part where it adds the hidden form element with JS:

"loadTicks": function(e) {
    var t;
    t = e ? e.find(".edit-block") : $(".edit-block"), 0 === t.find("input[name=i1l]").length && (t.data("loading-ticks") || (t.data("loading-ticks", !0), $.ajax({
        "url": "/questions/ticks",
        "cache": !1,
        "success": function(e) {
            t.append("<input type='hidden' name='i1l' value='" + e + "' />")
        },
        "complete": function() {
            t.data("loading-ticks", !1)
        }
    })))
},

As you can tell, it sets the value to "e", which is whatever value is sent with the function call to loadTicks. loadTicks is mentioned as:

f = function() {
    return StackExchange.helpers.loadTicks(s), d.unbind("keydown", f), !0
};

As you can see, it calls it with the "s" variable, which is defined earlier as:

var s = new Markdown.Converter({
    "nonAsciiLetters": !0,
    "asteriskIntraWordEmphasis": StackExchange.settings.markdown.asteriskIntraWordEmphasis,
    "autoNewlines": StackExchange.settings.markdown.autoNewlines,
    "linkEmails": StackExchange.settings.markdown.linkEmails,
    "codeFences": !StackExchange.settings.markdown.disableCodeFences
});

This is where it gets really crazy. The "s" variable is set to the result of Markdown.Converter(...). That function, or series of functions (Is this even valid JavaScript at this point? Apparently...), looks like this:

Markdown.Converter = function(t) {
    function i(e) {
        return e = e.replace(/^[ ]{0,3}\[([^\[\]]+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(\n+)/gm, function(e, t, n, r, i, o, a) {
            return t = t.toLowerCase(), U.set(t, _(n)), i ? r + a : (o && B.set(t, o.replace(/"/g, "&quot;")), "")
        })
    }

    function o(e) {
        return e = e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm, s), e = e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, s), e = e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, s), e = e.replace(/\n\n[ ]{0,3}(<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g, s), e = e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, s)
    }

    function a(e) {
        return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n§K" + (q.push(e) - 1) + "K\n\n"
    }

    function s(e, t) {
        return a(t)
    }

    function l(e, n, r, i) {
        e = N.preBlockGamut(e, W), t.codeFences && !i && (e = w(e)), e = m(e);
        var a = "<hr />\n";
        return e = e.replace(/^[ ]{0,2}( ?\*){3,}[ \t]*$/gm, a), e = e.replace(/^[ ]{0,2}( ?-){3,}[ \t]*$/gm, a), e = e.replace(/^[ ]{0,2}( ?_){3,}[ \t]*$/gm, a), e = v(e), e = y(e), e = E(e), e = N.postBlockGamut(e, W), e = o(e), e = C(e, n, r)
    }

    function c(e) {
        return e = N.preSpanGamut(e), e = x(e), e = u(e), e = T(e), e = p(e), e = d(e), e = A(e), e = e.replace(/§P/g, "://"), e = _(e), e = H(e), e = t.autoNewlines ? e.replace(/\n/g, "<br>\n") : e.replace(/  +\n/g, " <br>\n"), e = N.postSpanGamut(e)
    }

    function u(e) {
        var t = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;
        return e = e.replace(t, function(e) {
            var t = e.replace(/(.)<\/?code>(?=.)/g, "$1`");
            return t = L(t, "!" == e.charAt(1) ? "\\`*_/" : "\\`*_")
        })
    }

    function d(e) {
        return -1 === e.indexOf("[") ? e : (e = e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, f), e = e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?((?:\([^)]*\)|[^()\s])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, f), e = e.replace(/(\[([^\[\]]+)\])()()()()()/g, f))
    }

    function f(e, t, n, r, i, o, a, s) {
        void 0 == s && (s = "");
        var l = t,
            c = n.replace(/:\/\//g, "§P"),
            u = r.toLowerCase(),
            d = i,
            f = s;
        if ("" == d)
            if ("" == u && (u = c.toLowerCase().replace(/ ?\n/g, " ")), d = "#" + u, void 0 != U.get(u)) d = U.get(u), void 0 != B.get(u) && (f = B.get(u));
            else {
                if (!(l.search(/\(\s*\)$/m) > -1)) return l;
                d = ""
            }
        d = M(d);
        var p = '<a href="' + d + '"';
        return "" != f && (f = h(f), f = L(f, "*_"), p += ' title="' + f + '"'), p += ">" + c + "</a>"
    }

    function p(e) {
        return -1 === e.indexOf("![") ? e : (e = e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, g), e = e.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, g))
    }

    function h(e) {
        return e.replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;")
    }

    function g(e, t, n, r, i, o, a, s) {
        var l = t,
            c = n,
            u = r.toLowerCase(),
            d = i,
            f = s;
        if (f || (f = ""), "" == d) {
            if ("" == u && (u = c.toLowerCase().replace(/ ?\n/g, " ")), d = "#" + u, void 0 == U.get(u)) return l;
            d = U.get(u), void 0 != B.get(u) && (f = B.get(u))
        }
        c = L(h(c), "*_[]()"), d = L(d, "*_");
        var p = '<img src="' + d + '" alt="' + c + '"';
        return f = h(f), f = L(f, "*_"), p += ' title="' + f + '"', p += " />"
    }

    function m(e) {
        return e = e.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm, function(e, t) {
            return "<h1>" + c(t) + "</h1>\n\n"
        }), e = e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm, function(e, t) {
            return "<h2>" + c(t) + "</h2>\n\n"
        }), e = e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm, function(e, t, n) {
            var r = t.length;
            return "<h" + r + ">" + c(n) + "</h" + r + ">\n\n"
        })
    }

    function v(e, t) {
        e += "§0";
        var n = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(§0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
        return z ? e = e.replace(n, function(e, n, r) {
            var i, o = n,
                a = r.search(/[*+-]/g) > -1 ? "ul" : "ol";
            "ol" === a && (i = parseInt(r, 10));
            var s = b(o, a, t);
            s = s.replace(/\s+$/, "");
            var l = "<" + a;
            return i && 1 !== i && (l += ' start="' + i + '"'), s = l + ">" + s + "</" + a + ">\n"
        }) : (n = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(§0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g, e = e.replace(n, function(e, t, n, r) {
            var i, o = t,
                a = n,
                s = r.search(/[*+-]/g) > -1 ? "ul" : "ol";
            "ol" === s && (i = parseInt(r, 10));
            var l = b(a, s),
                c = "<" + s;
            return i && 1 !== i && (c += ' start="' + i + '"'), l = o + c + ">\n" + l + "</" + s + ">\n"
        })), e = e.replace(/§0/, "")
    }

    function b(e, t) {
        z++, e = e.replace(/\n{2,}$/, "\n"), e += "§0";
        var n = K[t],
            r = new RegExp("(^[ \\t]*)(" + n + ")[ \\t]+([^\\r]+?(\\n+))(?=(§0|\\1(" + n + ")[ \\t]+))", "gm"),
            i = !1;
        return e = e.replace(r, function(e, t, n, r) {
            var o = r,
                a = /\n\n$/.test(o),
                s = a || o.search(/\n{2,}/) > -1,
                c = s || i;
            return o = l(R(o), !0, !c), i = a, "<li>" + o + "</li>\n"
        }), e = e.replace(/§0/g, ""), z--, e
    }

    function y(e) {
        return e += "§0", e = e.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=§0))/g, function(e, t, n) {
            var r = t,
                i = n;
            return r = k(R(r)), r = O(r), r = r.replace(/^\n+/g, ""), r = r.replace(/\n+$/g, ""), r = "<pre><code>" + r + "\n</code></pre>", "\n\n" + r + "\n\n" + i
        }), e = e.replace(/§0/, "")
    }

    function w(e) {
        return e = e.replace(/(?:\n|^)([ ]{0,3})(([`~])\3{2,})([^`\n]*)(?=\n)([^\r]*?)(?:(\n\n$)|\n([ ]{0,3})\2\3*[ ]*(?=\n|$))/g, function(e, t, n, r, i, o, s) {
            if (o.length && (o = o.substr(1)), t.length) {
                var l = new RegExp("^[ ]{1," + t.length + "}", "gm");
                o = o.replace(l, "")
            }
            i = i.trim();
            var c = "";
            /^[a-z0-9#+\-.]+$/i.test(i) && (c = "<!-- language: " + i + " -->\n\n");
            var u = "<pre><code>" + k(o) + "\n</code></pre>";
            return u = a(u), "\n\n" + c + u + (s || "")
        })
    }

    function x(e) {
        return e = e.replace(/(^|[^\\`])(`+)(?!`)([^\r]*?[^`])\2(?!`)/gm, function(e, t, n, r) {
            var i = r;
            return i = i.replace(/^([ \t]*)/g, ""), i = i.replace(/[ \t]*$/g, ""), i = k(i), i = i.replace(/:\/\//g, "§P"), t + "<code>" + i + "</code>"
        })
    }

    function k(e) {
        return e = e.replace(/&/g, "&amp;"), e = e.replace(/</g, "&lt;"), e = e.replace(/>/g, "&gt;"), e = L(e, "*_{}[]\\`~", !1)
    }

    function S(e) {
        return -1 === e.indexOf("*") && -1 === e.indexOf("_") ? e : (e = F(e), e = e.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)\2(?=\S)([^\r]*?\S)\2\2(?!\2)(?=[\W_]|$)/g, "$1<strong>$3</strong>"), e = e.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)(?=\S)((?:(?!\2)[^\r])*?\S)\2(?!\2)(?=[\W_]|$)/g, "$1<em>$3</em>"), V(e))
    }

    function $(e) {
        return -1 === e.indexOf("*") && -1 === e.indexOf("_") ? e : (e = F(e), e = e.replace(/(?=[^\r][*_]|[*_])(^|(?=\W__|(?!\*)[\W_]\*\*|\w\*\*\w)[^\r])(\*\*|__)(?!\2)(?=\S)((?:|[^\r]*?(?!\2)[^\r])(?=\S_|\w|\S\*\*(?:[\W_]|$)).)(?=__(?:\W|$)|\*\*(?:[^*]|$))\2/g, "$1<strong>$3</strong>"), e = e.replace(/(?=[^\r][*_]|[*_])(^|(?=\W_|(?!\*)(?:[\W_]\*|\D\*(?=\w)\D))[^\r])(\*|_)(?!\2\2\2)(?=\S)((?:(?!\2)[^\r])*?(?=[^\s_]_|(?=\w)\D\*\D|[^\s*]\*(?:[\W_]|$)).)(?=_(?:\W|$)|\*(?:[^*]|$))\2/g, "$1<em>$3</em>"), V(e))
    }

    function E(e) {
        return e = e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm, function(e, t) {
            var n = t;
            return n = n.replace(/^[ \t]*>[ \t]?/gm, "§0"), n = n.replace(/§0/g, ""), n = n.replace(/^[ \t]+$/gm, ""), n = l(n), n = n.replace(/(^|\n)/g, "$1  "), n = n.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(e, t) {
                var n = t;
                return n = n.replace(/^  /gm, "§0"), n = n.replace(/§0/g, "")
            }), a("<blockquote>\n" + n + "\n</blockquote>")
        })
    }

    function C(e, t, n) {
        e = e.replace(/^\n+/g, ""), e = e.replace(/\n+$/g, "");
        for (var r = e.split(/\n{2,}/g), i = [], o = /§K(\d+)K/, a = r.length, s = 0; a > s; s++) {
            var l = r[s];
            o.test(l) ? i.push(l) : /\S/.test(l) && (l = c(l), l = l.replace(/^([ \t]*)/g, n ? "" : "<p>"), n || (l += "</p>"), i.push(l))
        }
        if (!t) {
            a = i.length;
            for (var s = 0; a > s; s++)
                for (var u = !0; u;) u = !1, i[s] = i[s].replace(/§K(\d+)K/g, function(e, t) {
                    return u = !0, q[t]
                })
        }
        return i.join("\n\n")
    }

    function _(e) {
        return e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;"), e = e.replace(/<(?![a-z\/?!]|§D)/gi, "&lt;")
    }

    function T(e) {
        return e = e.replace(/\\(\\)/g, D), e = e.replace(/\\([`*_{}\[\]()>#+-.!])/g, D)
    }

    function j(e, t, n, r) {
        if (t) return e;
        if (")" !== r.charAt(r.length - 1)) return "<" + n + r + ">";
        for (var i = r.match(/[()]/g), o = 0, a = 0; a < i.length; a++) "(" === i[a] ? 0 >= o ? o = 1 : o++ : o--;
        var s = "";
        if (0 > o) {
            var l = new RegExp("\\){1," + -o + "}$");
            r = r.replace(l, function(e) {
                return s = e, ""
            })
        }
        if (s) {
            var c = r.charAt(r.length - 1);
            Z.test(c) || (s = c + s, r = r.substr(0, r.length - 1))
        }
        return "<" + n + r + ">" + s
    }

    function A(e) {
        e = F(e), e = e.replace(Q, j), e = V(e);
        var n = function(e, t) {
            var n = M(t);
            return '<a href="' + n + '">' + N.plainLinkText(t) + "</a>"
        };
        return e = e.replace(/<((https?|ftp):[^'">\s]+)>/gi, n), t.linkEmails && (e = e.replace(/(<|=")?(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)/gi, I), e = e.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, function(e, t) {
            var n = P(t);
            return '<a href="mailto:' + n + '">' + n + "</a>"
        })), e
    }

    function I(e) {
        return e ? e.length > 0 && "<" === e[0] ? e : e.length > 1 && "=" === e[0] && '"' === e[1] ? e : "<" + e + ">" : ""
    }

    function P(e) {
        return e = e.replace(/§E(\d+)E/g, function(e, t) {
            var n = parseInt(t);
            return String.fromCharCode(n)
        })
    }

    function R(e) {
        return e = e.replace(/^(\t|[ ]{1,4})/gm, "§0"), e = e.replace(/§0/g, "")
    }

    function O(e) {
        if (!/\t/.test(e)) return e;
        var t, n = ["    ", "   ", "  ", " "],
            r = 0;
        return e.replace(/[\n\t]/g, function(e, i) {
            return "\n" === e ? (r = i + 1, e) : (t = (i - r) % 4, r = i + 1, n[t])
        })
    }

    function M(e) {
        return e = h(e), e = L(e, "*_:()[]")
    }

    function L(e, t, n) {
        var r = "([" + t.replace(/([\[\]\\])/g, "\\$1") + "])";
        n && (r = "\\\\" + r);
        var i = new RegExp(r, "g");
        return e = e.replace(i, D)
    }

    function D(e, t) {
        var n = t.charCodeAt(0);
        return "§E" + n + "E"
    }
    var N = this.hooks = new n;
    N.addNoop("plainLinkText"), N.addNoop("preConversion"), N.addNoop("postNormalization"), N.addNoop("preBlockGamut"), N.addNoop("postBlockGamut"), N.addNoop("preSpanGamut"), N.addNoop("postSpanGamut"), N.addNoop("postConversion");
    var U, B, q, z;
    t = t || {};
    var F = e,
        V = e;
    t.nonAsciiLetters && ! function() {
        var e = /[Q\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua67f-\ua697\ua717-\ua71f\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]/g,
            t = "Q".charCodeAt(0),
            n = "A".charCodeAt(0),
            r = "Z".charCodeAt(0),
            i = "a".charCodeAt(0) - r - 1;
        F = function(o) {
            return o.replace(e, function(e) {
                for (var o, a = e.charCodeAt(0), s = ""; a > 0;) o = a % 51 + n, o >= t && o++, o > r && (o += i), s = String.fromCharCode(o) + s, a = a / 51 | 0;
                return "Q" + s + "Q"
            })
        }, V = function(e) {
            return e.replace(/Q([A-PR-Za-z]{1,3})Q/g, function(e, o) {
                for (var a, s = 0, l = 0; l < o.length; l++) a = o.charCodeAt(l), a > r && (a -= i), a > t && a--, a -= n, s = 51 * s + a;
                return String.fromCharCode(s)
            })
        }
    }();
    var H = t.asteriskIntraWordEmphasis ? $ : S;
    this.makeHtml = function(e) {
        if (U) throw new Error("Recursive call to converter.makeHtml");
        return U = new r, B = new r, q = [], z = 0, e = N.preConversion(e), e = e.replace(/§/g, "§T"), e = e.replace(/\$/g, "§D"), e = e.replace(/\r\n/g, "\n"), e = e.replace(/\r/g, "\n"), e = "\n\n" + e + "\n\n", e = O(e), e = e.replace(/^[ \t]+$/gm, ""), e = N.postNormalization(e), e = w(e), e = o(e), e = i(e), e = l(e, !1, !1, !0), e = P(e), e = e.replace(/§D/g, "$$"), e = e.replace(/§T/g, "§"), e = N.postConversion(e), q = B = U = null, e
    };
    var W = function(e) {
            return l(e)
        },
        K = {
            "ol": "\\d+[.]",
            "ul": "[*+-]"
        },
        G = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",
        Y = "[-A-Z0-9+&@#/%=~_|[\\])]",
        Q = new RegExp('(="|<)?\\b(https?|ftp)(://' + G + "*" + Y + ")(?=$|\\W)", "gi"),
        Z = new RegExp(Y, "i")
}

This is where I'm stuck. I can't for the life of me make any sense of this last part. What is the actual value it wants for the hidden POST field "i1l"?


回答1:


You are looking at the wrong place.

e is not the param that is send to loadTicks. It is the parameter passed in the success callback

    "success": function(e) { // <-- This is the e you are looking for
        t.append("<input type='hidden' name='i1l' value='" + e + "' />")
    },


来源:https://stackoverflow.com/questions/59306239/how-do-i-make-sense-of-this-apparently-deliberately-obscurified-js-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!