lib/Win32/Exe/ResourceEntry/Name.pm

filter: Statementstmt 38.4% 10 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 33.3% 13 / 39 CC 1 SCAR 4.9
CC
1
Cov
38%
NameAddress
2.0
SetNameAddress
2.0
IsEscaped
2.0
CRAP 1.6
« lib/Win32/Exe/PE/Header/PE32Plus.pm ↑ Summary lib/Win32/Exe/ResourceEntry/Id.pm »
1 # Copyright 2004 by Audrey Tang <cpan@audreyt.org>
2  
3 package Win32::Exe::ResourceEntry::Name;
4  
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use base 'Win32::Exe::ResourceEntry';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use constant SUBFORMAT => (
Subroutine BEGIN: called CC=1 SCAR=0.0
8 N_RVA => 'V',
9 5 );
10  
11 0 ▶sub NameAddress {
Subroutine NameAddress: not called CC=1 SCAR=6.9
Pod undocumented
12 0 my ($self) = @_;
13 0 $self->N_RVA & ~($self->high_bit);
14 }
15  
16 0 ▶sub SetNameAddress {
Subroutine SetNameAddress: not called CC=1 SCAR=6.9
Pod undocumented
17 0 my ($self, $data) = @_;
18 0 $self->SetN_RVA($data | $self->IsDirectory);
19 }
20  
21 0 ▶sub IsEscaped {
Subroutine IsEscaped: not called CC=1 SCAR=6.9
Pod undocumented
22 0 my ($self) = @_;
23 0 $self->N_RVA & ($self->high_bit);
24 }
25  
26 0 ▶sub Name {
Subroutine Name: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my ($self) = @_;
28 0 my $section = $self->first_parent('Resources');
29 0 my $addr = $self->NameAddress;
30 0 my $size = unpack('v', $section->substr($addr, 2));
31 0 my $ustr = $section->substr($addr + 2, $size * 2);
32 0 my $name = $self->decode_ucs2($ustr);
33 0 $name =~ s{([%#/])}{sprintf('%%%02X', ord($1))}eg;
34 0 return $name;
35 }
36  
37 0 ▶sub SetName {
Subroutine SetName: not called CC=1 SCAR=6.9
Pod undocumented
38 0 die "XXX unimplemented";
39 }
40  
41 5 1;
« lib/Win32/Exe/PE/Header/PE32Plus.pm ↑ Summary lib/Win32/Exe/ResourceEntry/Id.pm »