[Javascript] unobfuscating code?

Pedro Mpa mail.pmpa at sapo.pt
Sat Jul 7 10:55:44 CDT 2007


I didn't check the link, I don't know if this is what you are looking for,
but I use this example code to "escape" html data.

[file.php]
<?php
// php code to escape:
$output = '<span style="color:#FF0000">Hello</span>';
$outputencoded = bin2hex("$output");
$outputencoded = chunk_split($outputencoded, 2, '%');
$outputencoded = '%'.substr($outputencoded, 0, strlen($outputencoded) - 1);
// Content type:
header('Content-type: text/javascript');
// Output to html:
echo 'document.write(unescape("'.$outputencoded.'"))';   
?>

[file.html]
<script src="http://server.com/file.php" type="text/javascript"></script>


Pedro.
________________________________________
From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]
On Behalf Of Anthony Ettinger
Sent: sábado, 7 de Julho de 2007 4:11
To: [JavaScript List]
Subject: [Javascript] unobfuscating code?

Does anyone have a link to a javascript unobfuscator?

The one I found that worked (about.com) did not convert the entire script.

-- 
Anthony Ettinger
Ph: 408-656-2473 
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");

http://chovy.dyndns.org/resume.html
http://utuxia.com/consulting 





More information about the Javascript mailing list