root/honeyclient/tags/exp/PRE-kindlund-firefox/bin/FlashTest.pl

Revision 696, 0.6 kB (checked in by kindlund, 1 year ago)

Merged active_content branch back into trunk.

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl -w -Ilib
2
3 use File::Temp ();
4 use HoneyClient::Agent::Driver::ActiveContent qw(process);
5
6 $ARGV[0] or die "Usage: FlashTest.pl <file.swf>\n";
7
8 open(SWF, $ARGV[0]);
9 binmode SWF;
10
11 my $tempFile = new File::Temp(SUFFIX => '.swf');
12 my $buffer;
13
14 while (
15   read(SWF, $buffer, 65536) and print $tempFile $buffer
16 ) {};
17
18 close(SWF);
19 $tempFile->close();
20
21 my %urls = HoneyClient::Agent::Driver::ActiveContent::process(
22   file      => $tempFile,
23   base_url  => 'http://foo.bar.com',
24 );
25
26 print "\nURLs:\n";
27
28 foreach (sort keys %urls) {
29   print "\t$_\n";
30 }
31
32 use Data::Dumper;
33 $Data::Dumper::Terse = 0;
34 $Data::Dumper::Indent = 1;
35 print Dumper(\%urls) . "\n";
Note: See TracBrowser for help on using the browser.