Decompressing (p,a,c,k,e,d) Javascript Files
Written By ldragon on May. 7, 2008.
1 Comments
Report Note
+ Clip This
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:
- 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.
- 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.
- 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. Hope this is useful :)

Mike
Written May. 7, 2008 / Report /
Wow very nice, this will probably get hit by a ton of people searching for this on Google.
Have you seen this compression technique that puts code into a PNG image where each pixel is a range of 255 ascii values? I just read it the other day and it sounds really cool, but not totally practical yet.