.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Scan 3pm" .TH Scan 3pm "2009-07-19" "perl v5.10.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" File::Scan \- Perl extension for Scanning files for Viruses .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use File::Scan; \& \& $fs = File::Scan\->new([, OPTION ...]); \& $fs\->set_callback( \& sub { \& my $filename = shift; \& my $bytes = shift; \& ... \& return("Callback Value"); \& } \& ); \& $fs\->scan([FILE]); \& if(my $e = $fs\->error) { print "$e\en"; } \& if(my $c = $fs\->skipped) { print "file skipped ($c)\en"; } \& if($fs\->suspicious) { print "suspicious file\en"; } \& if(my $res = $fs\->callback) { print "$res\en"; } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is designed to allows users to scan files for known viruses. The purpose is to provide a perl module to make plataform independent virus scanners. .SH "METHODS" .IX Header "METHODS" .SS "new([, \s-1OPTION\s0 ...])" .IX Subsection "new([, OPTION ...])" This method create a new File::Scan object. The following keys are available: .IP "callback => 'subroutine reference'" 7 .IX Item "callback => 'subroutine reference'" if the item is set then use a callback subroutine reference to provide extra information and functionalities. The callback subroutine have two arguments: filename and first 1024 bytes read from the file. This only work for binary files. .IP "extension => 'string'" 7 .IX Item "extension => 'string'" add the specified extension to the infected file .IP "move => 'directory'" 7 .IX Item "move => 'directory'" move the infected file to the specified directory .IP "copy => 'directory'" 7 .IX Item "copy => 'directory'" copy the infected file to the specified directory .IP "mkdir => octal_number" 7 .IX Item "mkdir => octal_number" if the value is set to octal number then make the specified directories (example: mkdir => 0755). .IP "delete => 0 or 1" 7 .IX Item "delete => 0 or 1" if the value is set to 1 delete the infected file .IP "max_txt_size => 'size in kbytes'" 7 .IX Item "max_txt_size => 'size in kbytes'" scan only the text file if the file size is less then max_txt_size. The default value is 5120 kbytes. Set to 0 for no limit. .IP "max_bin_size => 'size in kbytes'" 7 .IX Item "max_bin_size => 'size in kbytes'" scan only the binary file if the file size is less then max_bin_size. The default value is 10240 kbytes. Set to 0 for no limit. .SS "scan([\s-1FILE\s0])" .IX Subsection "scan([FILE])" This method scan a file for viruses and return the name of virus if a virus is found. .SS "set_callback([\s-1SUBREF\s0])" .IX Subsection "set_callback([SUBREF])" This method is another way to install a callback subroutine reference. Take a look in callback kay. .SS "\fIskipped()\fP" .IX Subsection "skipped()" This method return a code number if the file was skipped and 0 if not. The following skipped codes are available: .IP "0" 6 file not skipped .IP "1" 6 .IX Item "1" file is not vulnerable .IP "2" 6 .IX Item "2" file has zero size .IP "3" 6 .IX Item "3" the size of file is small .IP "4" 6 .IX Item "4" the text file size is greater that the 'max_txt_size' argument .IP "5" 6 .IX Item "5" the binary file size is greater that the 'max_bin_size' argument .SS "\fIsuspicious()\fP" .IX Subsection "suspicious()" This method return 1 if the file is suspicious and 0 if not. .SS "\fIcallback()\fP" .IX Subsection "callback()" This method return the result from the callback subroutine. .SS "\fIerror()\fP" .IX Subsection "error()" This method return a error message if a error happens. .SH "AUTHOR" .IX Header "AUTHOR" Henrique Dias .SH "CREDITS" .IX Header "CREDITS" Thanks to Rui de Castro, Sergio Castro, Ricardo Oliveira, Antonio Campelo, Branca Silveira, Helena Gomes and Anita Afonso for the help. .PP Thanks to Fernando Martins for the personal collection of viruses. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1).