views:

280

answers:

3

Hi all! 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?

+4  A: 

You can with online unpackers: try one of these, find one that suits you:

http://dean.edwards.name/packer/

http://jsunpack.jeek.org/dec/go

Lex
Excellent, these work great!
altvali
A: 

It's not possible to get the original code back. That information is gone. It would take manual labour to understand the code and try to make sense of it.

The eval part is hard too. The use of eval indicate that there is some dynamic code generation. You'll have to identify those parts to know whether it's possible to get rid of the eval part or not.

Ikke
+1  A: 

Here's an unpacker.

Darin Dimitrov