Beispiel #1
0
<?php

require 'IO/SWF.php';
// require dirname(__FILE__).'/../IO/SWF.php';
$options = getopt("f:hl");
if (isset($options['f']) === false || is_readable($options['f']) === false) {
    echo "Usage: php swfdump.php -f <swf_file> [-h] [-l]\n";
    echo "ex) php swfdump.php -f test.swf -h -l\n";
    exit(1);
}
$swfdata = file_get_contents($options['f']);
$swf = new IO_SWF();
$swf->parse($swfdata);
$opts = array();
if (isset($options['h'])) {
    $opts['hexdump'] = true;
}
if (isset($options['l'])) {
    $opts['addlabel'] = true;
}
$swf->dump($opts);
exit(0);
Beispiel #2
0
require 'IO/SWF.php';
// require dirname(__FILE__).'/../IO/SWF.php';
$options = getopt("f:cd");
function usage()
{
    echo "Usage: php swfcompress.php -[cd] -f <swf_file>\n";
    echo "ex) php swfcompress.php -c -f test.swf # compress (*WS=>CWS)\n";
    echo "ex) php swfcompress.php -d -f test.swf # decompress (*WS=>FWS)\n";
}
if (isset($options['f']) === false || is_readable($options['f']) === false) {
    usage();
    exit(1);
}
if (isset($options['c'])) {
    $compress = true;
} elseif (isset($options['d'])) {
    $compress = false;
} else {
    usage();
    exit(1);
}
$swfdata = file_get_contents($options['f']);
$swf = new IO_SWF();
$swf->parse($swfdata);
if ($compress) {
    $swf->_headers['Signature'] = 'CWS';
} else {
    $swf->_headers['Signature'] = 'FWS';
}
echo $swf->build();
exit(0);