0

I am trying to reverse engineer a game which sends it's data through an Obfuscate and DeObfuscate function to protect itself. The code base is 50k+ lines long (pretty printed), and eval techniques will not work.

What type of obfuscation is this?

function t(a) {
    if (e[a]) return e[a].exports;
    var r = e[a] = {
        i: a,
        l: !1,
        exports: {}
    };
    return n[a].call(r.exports, r, r.exports, t), r.l = !0, r.exports
}
var e = {};
t.m = n, t.c = e, t.d = function(n, e, a) {
    t.o(n, e) || Object.defineProperty(n, e, {
        configurable: !1,
        enumerable: !0,
        get: a
    })
}, t.n = function(n) {
    var e = n && n.__esModule ? function() {
        return n.default
    } : function() {
        return n
    };
    return t.d(e, "a", e), e
}, t.o = function(n, t) {
    return Object.prototype.hasOwnProperty.call(n, t)
}, t.p = "/", t(t.s = 311)
//...
function d(n, t) {
    var e = n.messageName,
        r = n.response,
        o = a({}, n);
    switch (e) {
        case "v2/checkRoom":
        case "v2/checkAssignment":
        case "v2/join":
        case "v2/rejoin":
        case "v2/playerGameOver":
            m.default.isString(r) && (o.response = JSON.parse((0, l.deObfuscateData)(r, e)));
            break;
        case "v2/getQuestions":
            var i = {};
            m.default.forEach(r.questions, function(n, t) {
                var a = JSON.parse(n);
                a.structure.answer = JSON.parse((0, l.deObfuscateData)(a.structure.answer, e)), i[t] = JSON.stringify(a)
            }), o.response = a({}, o.response, {
                questions: i
            })
    }
    return o.messageName = e.replace("v2/", ""), o
}

How can I de-obfuscate this?

I'm a little lost haha, I have tried using chrome debugger and stepping through it, which has yielded some results but not a lot. Is there a better tool than setting breakpoints and inspecting values to see what happens?

Full Source

  • There are quite a few JS deobfuscators online, did you give any of those a shot? – NirIzr Mar 4 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.