
13.08.2009, 09:13
|
|
Познавший АНТИЧАТ
Регистрация: 01.04.2007
Сообщений: 1,268
С нами:
10058786
Репутация:
4589
|
|
PHP код:
<?php
function pack_php($file)
{
if (!file_exists($file) or !is_readable($file))
{
die('The file could not be found. Trying to hack yourself? 0_o');
}
$code = bzcompress('?>'. shell_exec('php -nw '. $file), 9);
$output_fname = dirname($file). '/'. basename($file, '.php'). '_bz.php';
$output = fopen($output_fname, 'w');
fputs($output, '<?php $f=fopen(__FILE__,\'r\');'.
'fseek($f,133);$c=\'\';'.
'while (!feof($f)){$c.=fread($f,1024);}'.
'eval(bzdecompress($c));'.
'__halt_compiler(); ?>'. "\n". chr(0));
fputs($output, $code);
fclose($output);
chmod($output_fname, 0777);
echo "done.\n";
$before = filesize($file);
$after = filesize($output_fname);
echo '> Before compress : '. ($before / 1024). " Kb\n";
echo '> After compress : '. ($after / 1024). " Kb\n";
echo '> Compress ratio : '. (($before - $after) * 100) / $before. "%\n";
}
?>
> Before compress : 151.182617188 Kb
> After compress : 27.3408203125 Kb
> Compress ratio : 81.915367771%
Последний раз редактировалось BlackSun; 13.08.2009 в 09:20..
Причина: форум сует не приличные весчи в жизненно важные куски кода ( внимательней с пробелами!
|
|
|