Dean Edwards Packer exposed.

Have you ever packed code and misplaced the original? Sadly, so have I.

Well after really looking at the packer for the first time the solution to decode it is painfully easy!

The secret lies in the eval() function

That is the function that allows the JavaScript engine to make sense of the code from Dean Edwards packer function. Replacing that function is what will allow us to make sense of the code.

So using JavaScript (mootools in this example) we can do something super simple such as:

Prep Work

  * Open your packed code in your fav IDE.
  * Remove the opening eval(
  * than at the end of the string remove the );
  * copy what is left. (minus any comments, other JS functions etc...)


<textarea id="decoded"></textarea>

Core Javascript (mooTools)

var decoder = function() {
    $('decoded').set('value', PASTE_YOUR_CODE_HERE);

window.addEvent('domready' , decoder);

Run the code and behold your unPacked Javascript!

Complete code example:

<!doctype html>
	<title>Javascript UnPacker</title>
	<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
		var decoder = function() {
		    $('decoded').set('value', PASTE_YOUR_CODE_HERE);
		window.addEvent('domready' , decoder);
		body {
		textarea {
			display: block;
			height: 500px;
			margin: 12px auto;
			width: 80%;
		p {
			text-align: center;
	<p>Copy your code below and use it here: <a href="http://jsbeautifier.org/">Beautify JavaScript</a>
	<textarea id="decoded"></textarea>

2 Comments + Add Comment

Leave a comment to Sara

Show/Hide Footer Actions

Status: Available for your project.