Skip to content

Instantly share code, notes, and snippets.

@nikoncode
Created January 2, 2015 23:52
Show Gist options
  • Select an option

  • Save nikoncode/059a311c5bd275beea9c to your computer and use it in GitHub Desktop.

Select an option

Save nikoncode/059a311c5bd275beea9c to your computer and use it in GitHub Desktop.
depacker
function depack(p) {
if (p != "") {
c = unescape(p);
var _e = eval,
s = "eval=function(v){c=v;};" + c + ";eval=_e;";
eval(s)
} else {
c = p
};
return c
}
function unpack(arg) {
var c = arg;
var a = 5,
x = 1;
while (x < a) {
c = unescape(c);
if (/eval\(+function\(/.test(c)) {
c = depack(c);
x++
} else {
break
}
};
c = unescape(c);
return c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment