Decompressing (p,a,c,k,e,d) Javascript Files

Now, I know why most people compress they’re js files, because they don’t won’t people to steal the code, but it must be the case that sometimes, like what happened to me today, you’ve just gotta crack that encryption. I’m a bit worried about posting this, so I hope it’s in someway new and/or useful.

Basically we need to go into a js file that was given to us, in order to change a few DOM-based functions. I opened up the file, and lo and behold, this was the first few characters…

eval(function(p,a,c,k,e,d){…

This is the trademark sign of the packer by Dean Edwards. I’d seen this a few more times, and used it myself too, but never had to decode it before. So I did a little searching and found a nice method of decoding it:

  1. Use the bookmarklet found here whilst on the packer encode/decode page. This will enable the decode button and remove the read-only limitation on the bottom text area.
  2. Paste your encoded code into the bottom textarea and press decode. In theory, you should get the original code, but without line breaks, whitespace etc.
  3. To put the whitespace back in, I used ‘Javascript Tidy. Whilst not 100% successful (depends on your browser it seems somewhat), is did tidy up the majority of the code.

So yeah, that’s how to decode the p,a,c,k,e,r compressor. Theres other ways too, apparently replacing the eval function with alert works too, didn’t seem too for me unfortunately.

« The Redemption of Wordpress

Comments

Post a comment

RSS Icon RSS Feed | hCard Icon Download vCard | CV Icon Download CV | Going up?
© Luke Williams / Red Root 2008
 

It seems you're using an unsafe, out-of-date browser. Click here to upgrade to Firefox for free. X