Example #1
0
<?php

require_once 'IO/SWF/Editor.php';
if ($argc != 3) {
    echo "Usage: php swfgetmovieclip.php <swf_file> <target_path>\n";
    echo "ex) php swfgetmovieclip.php negimiku2_mcnest.swf miku/negi\n";
    exit(1);
}
assert(is_readable($argv[1]));
assert(isset($argv[2]));
$swfdata = file_get_contents($argv[1]);
$target_path = $argv[2];
$swf = new IO_SWF_Editor();
$swf->parse($swfdata);
$ret = $swf->getMovieClip($target_path);
if ($ret === false) {
    echo "getMovieClip({$target_path}) failed\n";
    exit(1);
}
echo $ret;
exit(0);
Example #2
0
                         $ext = "mmf";
                     } else {
                         $ext = "melo";
                     }
                 }
         }
         break;
     case 39:
         // Sprite
         if ($mc_extract === false) {
             continue;
             // skip
         }
         $tag->parseTagContent();
         $cid = $tag->tag->_spriteId;
         $data = $swf->getMovieClip($cid);
         $ext = "swf";
         //case 14: // DefineSound
         //break;
 }
 if ($cid !== false) {
     $outfile = "{$outfile_prefix}{$cid}.{$ext}";
     echo $outfile . PHP_EOL;
     file_put_contents($outfile, $data);
     if ($data2 !== false) {
         $outfile2 = "{$outfile_prefix}{$cid}.{$ext2}";
         echo $outfile2 . PHP_EOL;
         file_put_contents($outfile2, $data2);
     }
     if ($data3 !== false) {
         $outfile3 = "{$outfile_prefix}{$cid}.{$ext3}";