Changeset 237

Show
Ignore:
Timestamp:
03/31/07 22:55:29 (2 years ago)
Author:
jpuchalski
Message:

Made some changes that may be broken, but need to check-in now. Will fix
later if so.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/jpuchalski-active_content/lib/HoneyClient/Agent/Driver/ActiveContent.pm

    r218 r237  
    9898####################################################################### 
    9999 
     100sub 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 
    100117sub process { 
    101118  my %args = @_; 
    102119  my $argsExist = scalar(%args); 
    103120 
    104   # Sanity check: make sure a URL is defined 
     121  # Sanity check: make sure an input file is defined 
    105122  unless ($argsExist && exists($args{'file'}) && defined($args{'file'})) { 
    106     Carp::croak "Error: No URL provided!\n"; 
     123    Carp::croak "Error: No input file provided!\n"; 
    107124  } 
    108125 
    109   # Sanity check: make sure the URL points to a resource we understand  
     126  # Sanity check: make sure the input is a known resource type  
    110127  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); 
    113129  } else { 
    114     Carp::croak "Error: URL does not contain a known resource!\n"; 
     130    Carp::croak "Error: Input file does not contain a known resource!\n"; 
    115131   } 
    116132}