<?xml version="1.0"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Decaflon Thread: Decompressing (p,a,c,k,e,d) Javascript Files</title>
<link>http://decaflon.com/notes/</link>
<description>Decaflon Thread: Decompressing (p,a,c,k,e,d) Javascript Files</description>
<language>en</language>
<pubDate>Wed, 08 Oct 2008 06:06:49 +0000</pubDate>

<item>
<title>Decompressing (p,a,c,k,e,d) Javascript Files</title>
<link>http://decaflon.com/programming/notes/14030/p/1/#response-115612</link>
<pubDate>Wed, 07 May 2008 21:44:38</pubDate>
<dc:creator>Mike</dc:creator>
<guid isPermaLink="false">115612</guid>
<description>&lt;p&gt;Wow very nice, this will probably get hit by a ton of people searching for this on Google.&lt;/p&gt;
&lt;p&gt;Have you seen &lt;a href='http://blog.nihilogic.dk/2008/05/compression-using-canvas-and-png.html'&gt;this compression technique&lt;/a&gt; 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.
&lt;/p&gt;</description>
</item>
<item>
<title>Decompressing (p,a,c,k,e,d) Javascript Files</title>
<link>http://decaflon.com/programming/notes/14030/p/1/#response-115611</link>
<pubDate>Wed, 07 May 2008 19:47:19</pubDate>
<dc:creator>ldragon</dc:creator>
<guid isPermaLink="false">115611</guid>
<description>&lt;p&gt;Now, I know why most people compress they're&lt;strong&gt; js&lt;/strong&gt; 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.&lt;/p&gt;
&lt;p&gt;Basically we need to go into a &lt;strong&gt;js&lt;/strong&gt; 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...&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;eval(function(p,a,c,k,e,d){...&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is the trademark sign of the &lt;a href=&quot;http://dean.edwards.name/packer/&quot;&gt;packer by Dean Edwards&lt;/a&gt;. 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:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use the bookmarklet &lt;a href=&quot;http://yaisb.blogspot.com/2006/10/defeating-dean-edwards-javascript.html&quot;&gt;found here&lt;/a&gt; whilst on the packer encode/decode page.&lt;/strong&gt; This will enable the decode button and remove the read-only limitation on the bottom text area.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paste your encoded code into the bottom textarea and press decode&lt;/strong&gt;. In theory, you should get the original code, but without line breaks, whitespace etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To put the whitespace back in, I used 'J&lt;a href=&quot;http://www.howtocreate.co.uk/tutorials/jsexamples/JSTidy.html&quot;&gt;avascript Tidy&lt;/a&gt;'&lt;/strong&gt;. Whilst not 100% successful (depends on your browser it seems somewhat), is did tidy up the majority of the code.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So yeah, that's how to decode the p,a,c,k,e,r compressor. Hope this is useful :)
&lt;/p&gt;</description>
</item>

</channel>
</rss>

