Skip to content

Instantly share code, notes, and snippets.

@Gee19
Created June 13, 2019 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gee19/b6a16e0b05634804511bb932548f0734 to your computer and use it in GitHub Desktop.
Save Gee19/b6a16e0b05634804511bb932548f0734 to your computer and use it in GitHub Desktop.
deobfuscate attempt
'use strict';
var g = this || self;
var h = Date.now || function() {
return +new Date;
};
var k = function() {
this.f = "";
};
k.prototype.toString = function() {
return "SafeScript{" + this.f + "}";
};
k.prototype.a = function(a$jscomp$0) {
this.f = a$jscomp$0;
};
(new k).a("");
var l = String.prototype.trim ? function(a$jscomp$1) {
return a$jscomp$1.trim();
} : function(a$jscomp$2) {
return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a$jscomp$2)[1];
};
var m = function() {
this.h = "";
};
m.prototype.toString = function() {
return "SafeStyle{" + this.h + "}";
};
m.prototype.a = function(a$jscomp$3) {
this.h = a$jscomp$3;
};
(new m).a("");
var n = function() {
this.g = "";
};
n.prototype.toString = function() {
return "SafeStyleSheet{" + this.g + "}";
};
n.prototype.a = function(a$jscomp$4) {
this.g = a$jscomp$4;
};
(new n).a("");
var p = function() {
this.c = "";
};
p.prototype.toString = function() {
return "SafeHtml{" + this.c + "}";
};
p.prototype.a = function(a$jscomp$5) {
this.c = a$jscomp$5;
};
(new p).a("<!DOCTYPE html>");
(new p).a("");
(new p).a("<br>");
var q = function() {
this.b = ("undefined" == typeof document ? null : document) || {
cookie : ""
};
};
q.prototype.isEnabled = function() {
return navigator.cookieEnabled;
};
q.prototype.set = function(a$jscomp$6, b$jscomp$0, c$jscomp$0, d$jscomp$0, f$jscomp$1, e$jscomp$7) {
if (/[;=\s]/.test(a$jscomp$6)) {
throw Error('Invalid cookie name "' + a$jscomp$6 + '"');
}
if (/[;\r\n]/.test(b$jscomp$0)) {
throw Error('Invalid cookie value "' + b$jscomp$0 + '"');
}
if (!(void 0 !== c$jscomp$0)) {
c$jscomp$0 = -1;
}
f$jscomp$1 = f$jscomp$1 ? ";domain=" + f$jscomp$1 : "";
d$jscomp$0 = d$jscomp$0 ? ";path=" + d$jscomp$0 : "";
e$jscomp$7 = e$jscomp$7 ? ";secure" : "";
c$jscomp$0 = 0 > c$jscomp$0 ? "" : 0 == c$jscomp$0 ? ";expires=" + (new Date(1970, 1, 1)).toUTCString() : ";expires=" + (new Date(h() + 1E3 * c$jscomp$0)).toUTCString();
this.b.cookie = a$jscomp$6 + "=" + b$jscomp$0 + f$jscomp$1 + d$jscomp$0 + c$jscomp$0 + e$jscomp$7;
};
q.prototype.get = function(a$jscomp$7, b$jscomp$1) {
var c$jscomp$1 = a$jscomp$7 + "=";
var d$jscomp$1 = (this.b.cookie || "").split(";");
var f$jscomp$2 = 0;
var e$jscomp$8;
for (; f$jscomp$2 < d$jscomp$1.length; f$jscomp$2++) {
e$jscomp$8 = l(d$jscomp$1[f$jscomp$2]);
if (0 == e$jscomp$8.lastIndexOf(c$jscomp$1, 0)) {
return e$jscomp$8.substr(c$jscomp$1.length);
}
if (e$jscomp$8 == a$jscomp$7) {
return "";
}
}
return b$jscomp$1;
};
q.prototype.remove = function(a$jscomp$8, b$jscomp$2, c$jscomp$2) {
var d$jscomp$2 = void 0 !== this.get(a$jscomp$8);
this.set(a$jscomp$8, "", 0, b$jscomp$2, c$jscomp$2);
return d$jscomp$2;
};
q.prototype.clear = function() {
var a$jscomp$9 = (this.b.cookie || "").split(";");
var b$jscomp$3 = [];
var c$jscomp$3 = [];
var d$jscomp$3;
var f$jscomp$3;
var e$jscomp$9 = 0;
for (; e$jscomp$9 < a$jscomp$9.length; e$jscomp$9++) {
f$jscomp$3 = l(a$jscomp$9[e$jscomp$9]);
d$jscomp$3 = f$jscomp$3.indexOf("=");
if (-1 == d$jscomp$3) {
b$jscomp$3.push("");
c$jscomp$3.push(f$jscomp$3);
} else {
b$jscomp$3.push(f$jscomp$3.substring(0, d$jscomp$3));
c$jscomp$3.push(f$jscomp$3.substring(d$jscomp$3 + 1));
}
}
a$jscomp$9 = b$jscomp$3.length - 1;
for (; 0 <= a$jscomp$9; a$jscomp$9--) {
this.remove(b$jscomp$3[a$jscomp$9]);
}
};
var r = new q;
var t = function(a$jscomp$10, b$jscomp$4, c$jscomp$4) {
var d$jscomp$4 = r.get(b$jscomp$4);
if (d$jscomp$4 == a$jscomp$10) {
c$jscomp$4(d$jscomp$4);
} else {
g.setTimeout(function() {
t(d$jscomp$4, b$jscomp$4, c$jscomp$4);
}, Math.floor(15 * Math.random()) + 5);
}
};
var u = function(a$jscomp$11, b$jscomp$5, c$jscomp$5, d$jscomp$5, f$jscomp$4) {
var e$jscomp$10 = r.get(b$jscomp$5);
if (!e$jscomp$10) {
if (!r.isEnabled()) {
g.location.assign(d$jscomp$5);
return;
}
e$jscomp$10 = a$jscomp$11;
r.set(b$jscomp$5, e$jscomp$10, -1, "/", null, c$jscomp$5);
}
g.setTimeout(function() {
t(e$jscomp$10, b$jscomp$5, f$jscomp$4);
}, Math.floor(15 * Math.random()) + 5);
};
var v = function(a$jscomp$12, b$jscomp$6, c$jscomp$6, d$jscomp$6, f$jscomp$5) {
u(b$jscomp$6, c$jscomp$6, d$jscomp$6, f$jscomp$5, function(e$jscomp$11) {
if (e$jscomp$11 == b$jscomp$6) {
g.location.replace(a$jscomp$12);
} else {
g.location.reload();
}
});
};
var w = ["xsrfstatemanager", "chooseKeyAndRedirect"];
var x = g;
if (!(w[0] in x || "undefined" == typeof x.execScript)) {
x.execScript("var " + w[0]);
}
var y;
for (; w.length && (y = w.shift());) {
if (w.length || void 0 === v) {
x = x[y] && x[y] !== Object.prototype[y] ? x[y] : x[y] = {};
} else {
x[y] = v;
}
}
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment