#!/usr/bin/perl use strict; use SWF::Parser; use SWF::Element; use SWF::BinStream; use SWF::BinStream::File; my $frame = 0; if (@ARGV==0) { print STDERR <$ARGV[1]") or die "Can't open $ARGV[1]"; select F; } print <new('header-callback' => \&header, 'tag-callback' => \&data); $p->parse_file($ARGV[0]); print <close; END sub header { my ($self, $signature, $version, $length, $xmin, $ymin, $xmax, $ymax, $rate, $count)=@_; print STDERR <new("\$ARGV[0].swf", Version => $version); # $ARGV[0] SWF header \$new->FrameSize($xmin, $ymin, $xmax, $ymax); \$new->FrameRate($rate); #\$new->FrameCount($count); # $ARGV[0] SWF tags HEADER2 } sub data { my ($self, $tag, $length, $stream)=@_; my $t = SWF::Element::Tag->new(Tag=>$tag, Length=>$length); my ($tagname) = $t->tag_name; print STDERR <unpack($stream); }; if ($@) { my $mes = $@; $t->dumper; die $mes; } $t->dumper; print "->pack(\$new);\n"; if ($tagname eq 'ShowFrame') { print "#^------------------------------Frame No. $frame END.\n\n"; $frame++; } }