I want to describe it with ahk, but the JS grammar is really confusing. I have to ask for help.
I want to start with n(), but I got stuck here at the beginning.
Code: Select all
var n = function() {
var r;
var s = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (r = document.cookie.match(s)) {
return unescape(r[2])
} else {
return null
}
};
n("TEST");
Although f(){} can be called with f(x), I don't know who is the "TEST" passed to here, and what is the name in s?
I guess, the intention is to match
/(^| )TEST=([^;]*)(;|$)/
, but the results of the Chrome console verification are different from my guess.
The following is the complete JS code.
Code: Select all
var f = function() {
var j = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/~!@#¥%……&";
var q = String.fromCharCode;
var k = function(s) {
if (s.length < 2) {
var r = s.charCodeAt(0);
return r < 128 ? s : r < 2048 ? (q(192 | (r >>> 6)) + q(128 | (r & 63))) : (q(224 | ((r >>> 12) & 15)) + q(128 | ((r >>> 6) & 63)) + q(128 | (r &63)))
} else {
var r = 65536 + (s.charCodeAt(0) - 55296) * 1024 + (s.charCodeAt(1) - 56320);
return (q(240 | ((r >>> 18) & 7)) + q(128 | ((r >>> 12) & 63)) + q(128 | ((r >>> 6) & 63)) + q(128 | (r & 63)))
}
};
var l = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
var p = function(r) {
return (r + "" + Math.random()).replace(l, k)
};
var h = function(u) {
var t = [0, 2, 1][u.length % 3];
var r = u.charCodeAt(0) << 16 | ((u.length > 1 ? u.charCodeAt(1) : 0) << 8) | ((u.length > 2 ? u.charCodeAt(2) : 0));
var s = [j.charAt(r >>> 18), j.charAt((r >>> 12) & 63), t >= 2 ? "=" : j.charAt((r >>> 6) & 63), t >= 1 ? "=" : j.charAt(r & 63)];
return s.join("")
};
var o = function(r) {
return r.replace(/[\s\S]{1,3}/g, h)
};
var g = function(r) {
return o(p(new Date().getTime()))
};
var m = function(r, s) {
return !s ? g(String(r)) : g(String(r)).replace(/[+\/]/g, function(t) {
return t === "+" ? "-" : "_"
}).replace(/=/g, "")
};
var n = function() {
var r;
var s = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (r = document.cookie.match(s)) {
return unescape(r[2])
} else {
return null
}
};
return m(n("TEST"))
};