Click here to Skip to main content
15,886,689 members
Articles / Programming Languages / Javascript

Decoder for Dean Edwards' JavaScript Packer

Rate me:
Please Sign up or sign in to vote.
3.40/5 (3 votes)
4 Mar 2010CPOL 44.2K   911   4   3
This short article shows how to decrypt and beautify code encoded with Dean Edwards' Javascript Packer.

Introduction

If you are a website admin, you might want to know if the JavaScript provided to you is malicious. This code will decrypt the JavaScript code encrypted with Dean Edwards' Javascript Packer. JavaScript encoded with Dean Edwards' JavaScript Packer begins with this line:

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

Using the Code

This code is a simple HTML page with few lines of JavaScript.

HTML
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Decoder for Dean Edwards' Javascript Packer</title>
<script language="javascript" type="text/javascript">
function Decode() {
eval("var value=String" + txtInput.value.slice(4));
txtOutput.value = value;
}
</script>
</head>
<body>
<div>Input</div>
<textarea id="txtInput" style="width: 632px; height: 253px"></textarea>
<br />
<input id="btnDecode" style="width: 198px" 
type="button" value="Decode" onclick="Decode()" />
<br />
<div>Output</div>
<textarea id="txtOutput" style="width: 630px; height: 273px"></textarea>
<br />
<a href="http://dean.edwards.name/packer/">Dean Edwards' JS packer</a>
<br />
<a href="http://jsbeautifier.org/">Javascript unpacker and beautifier</a>
</body>
</html>

Points of Interest

After you decode the JavaScript with the page, beautify it with Javascript unpacker and beautifier.

You can read more about Dean Edwards' JS packer's inner workings on Golan Yosef blog.

History

  • 5th March, 2010: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Igor is a business intelligence consultant working in Tampa, Florida. He has a BS in Finance from University of South Carolina and Masters in Information Management System from University of South Florida. He also has following professional certifications: MCSD, MCDBA, MCAD.

Comments and Discussions

 
GeneralJust what I was looking for Pin
geekgirljas4-Apr-10 22:57
geekgirljas4-Apr-10 22:57 
GeneralMy vote of 1 Pin
JLuterek5-Mar-10 5:22
JLuterek5-Mar-10 5:22 
GeneralRe: My vote of 1 Pin
Igor Krupitsky5-Mar-10 16:33
mvaIgor Krupitsky5-Mar-10 16:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.