line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::VirusScan::Engine::Command::Norman::NVCC; |
2
|
1
|
|
|
1
|
|
109712
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
351
|
use File::VirusScan::Engine::Command; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
50
|
use vars qw( @ISA ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
8
|
|
|
|
|
|
|
@ISA = qw( File::VirusScan::Engine::Command ); |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use Cwd 'abs_path'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
529
|
use File::VirusScan::Result; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
255
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub default_arguments |
15
|
|
|
|
|
|
|
{ |
16
|
5
|
|
|
5
|
0
|
45
|
return [qw( -u -c -s)]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub scan |
20
|
|
|
|
|
|
|
{ |
21
|
0
|
|
|
0
|
1
|
|
my ($self, $path) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $abs = abs_path($path); |
24
|
0
|
0
|
0
|
|
|
|
if ($abs && $abs ne $path) { |
25
|
0
|
|
|
|
|
|
$path = $abs; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my ($exitcode, $scan_response) = eval { $self->_run_commandline_scanner(join(' ', $self->{command}, @{ $self->{args} }, $path, '2>&1')); }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
if($@) { |
31
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error($@); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
if(0 == $exitcode) { |
35
|
0
|
|
|
|
|
|
return File::VirusScan::Result->clean(); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
0
|
|
|
|
if( 1 == $exitcode |
|
|
|
0
|
|
|
|
|
39
|
|
|
|
|
|
|
|| 2 == $exitcode |
40
|
|
|
|
|
|
|
|| 14 == $exitcode) |
41
|
|
|
|
|
|
|
{ |
42
|
0
|
|
|
|
|
|
my ($virus_name) = $scan_response =~ m/Possible virus[^']*'(\S+)'$/; |
43
|
0
|
|
0
|
|
|
|
$virus_name ||= 'unknown-NVCC-virus'; |
44
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus($virus_name); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
if(11 == $exitcode) { |
48
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus('NVCC-suspicious-code-11'); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error("Unknown return code from nvcc: $exitcode"); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
__END__ |