How to unpack the contents of a JavaScript file?

Valentin Brasso picture Valentin Brasso · Mar 17, 2010 · Viewed 22.3k times · Source

You know how those packed js files look like, right?

 eval(function(p,a,c,k,e,d){ ... } ('obfuscated-string'.split('|'),0,{}))

It just so happens to be that i have to tweak some large legacy code that looks like that and I want to find a way to turn this into a more readable version.

If that's not possible, can i at least get rid of the eval?

Answer

Dan Grossman picture Dan Grossman · Feb 9, 2011

JS Beautifier will both reformat and unpack:

http://jsbeautifier.org/