Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 06:57
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  Replace variables on swf to obfuscate the code
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Replace variables on swf to obfuscate the code  (Read 2380 times)
saschart
Jr. Programmer
**
Posts: 62



View Profile WWW Email
« on: 05/27/09, 11:36 »

I try to build a PHP script to obfuscate the code on the swf files replacing variables and functions. I try this:

Code:
function replaceSwf($src,$dest) {
$content=file_get_contents($src);

$header=substr($content, 0, 8);
$content=gzuncompress(substr($content, 8));

// replace variables
$content=str_replace($str_find,$str_repl,$content);

// compress SWF file
$real_size=pack("V", strlen($header.$content));
$header=substr($header,0,4).$real_size;
$header="CWS".substr($header,3);
$content=$header.gzcompress($content);  

// save new SWF
$fp=fopen($dest,"wb");
$result=fwrite($fp,$content);
fclose($fp);
}

This code work only if $str_find and $str_repl variables have the same length. Why don't with different length ?

Logged
saschart
Jr. Programmer
**
Posts: 62



View Profile WWW Email
« Reply #1 on: 06/11/09, 05:07 »

For who need I upload one example of swf obfuscator with variables/functions names replacing to http://soft.saschart.com/#SWF%20Obfuscator

Thanks
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!