Changeset 237
- Timestamp:
- 03/31/07 22:55:29 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/jpuchalski-active_content/lib/HoneyClient/Agent/Driver/ActiveContent.pm
r218 r237 98 98 ####################################################################### 99 99 100 sub isActiveContent { 101 my %args = @_; 102 my $argsExist = scalar(%args); 103 104 # Sanity check: make sure an input file is defined 105 unless ($argsExist && exists($args{'file'}) && defined($args{'file'})) { 106 Carp::croak "Error: No input file provided!\n"; 107 } 108 109 # Sanity check: make sure the input is a known resource type 110 if ($args{'file'}->filename =~ /\.swf$/) { 111 return true; 112 } else { 113 return false; 114 } 115 } 116 100 117 sub process { 101 118 my %args = @_; 102 119 my $argsExist = scalar(%args); 103 120 104 # Sanity check: make sure a URLis defined121 # Sanity check: make sure an input file is defined 105 122 unless ($argsExist && exists($args{'file'}) && defined($args{'file'})) { 106 Carp::croak "Error: No URLprovided!\n";123 Carp::croak "Error: No input file provided!\n"; 107 124 } 108 125 109 # Sanity check: make sure the URL points to a resource we understand126 # Sanity check: make sure the input is a known resource type 110 127 if ($args{'file'}->filename =~ /\.swf$/) { 111 my %urls = HoneyClient::Agent::Driver::ActiveContent::Flash::extract(%args); 112 return %urls; 128 return HoneyClient::Agent::Driver::ActiveContent::Flash::extract(%args); 113 129 } else { 114 Carp::croak "Error: URLdoes not contain a known resource!\n";130 Carp::croak "Error: Input file does not contain a known resource!\n"; 115 131 } 116 132 }
