lib/Win32/Exe/ResourceEntry.pm

filter: Statementstmt 95.0% 38 / 40 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 93.3% 14 / 15 Podpod 0.0% 0 / 10 totaltotal 80.0% 52 / 65 CC 1 SCAR 0.6
CC
1
Cov
95%
SetVirtualAddress
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« lib/Win32/Exe/IconFile.pm ↑ Summary script/exe_update.pl »
1 # Copyright 2004 by Audrey Tang <cpan@audreyt.org>
2  
3 package Win32::Exe::ResourceEntry;
4  
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use base 'Win32::Exe::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use constant FORMAT => (
Subroutine BEGIN: called CC=1 SCAR=0.0
8 Data => 'V',
9 E_RVA => 'V',
10 5 );
11 5 ▶use constant HIGH_BIT => 0x80_00_00_00;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Win32::Exe::ResourceData;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 384 ▶sub high_bit {
Subroutine high_bit: called CC=1 SCAR=0.0
Pod undocumented
15 384 my ($self) = @_;
16 384 return +HIGH_BIT;
17 }
18  
19 160 ▶sub path {
Subroutine path: called CC=1 SCAR=0.0
Pod undocumented
20 160 my ($self) = @_;
21 160 return $self->parent->path;
22 }
23  
24 48 ▶sub PathName {
Subroutine PathName: called CC=1 SCAR=0.0
Pod undocumented
25 48 my ($self) = @_;
26 48 return join('/', '', $self->path, $self->Name);
27 }
28  
29 184 ▶sub VirtualAddress {
Subroutine VirtualAddress: called CC=1 SCAR=0.0
Pod undocumented
30 184 my ($self) = @_;
31 184 $self->E_RVA & ~($self->high_bit);
32 }
33  
34 0 ▶sub SetVirtualAddress {
Subroutine SetVirtualAddress: not called CC=1 SCAR=6.9
Pod undocumented
35 0 my ($self, $data) = @_;
36 0 $self->SetE_RVA($data | $self->IsDirectory);
37 }
38  
39 112 ▶sub IsDirectory {
Subroutine IsDirectory: called CC=1 SCAR=0.0
Pod undocumented
40 112 my ($self) = @_;
41 112 $self->E_RVA & ($self->high_bit);
42 }
43  
44 112 ▶sub initialize {
Subroutine initialize: called CC=1 SCAR=0.0
Pod undocumented
45 112 my ($self) = @_;
46 112 my $section = $self->first_parent('Resources');
47 112 my $data = $section->substr($self->VirtualAddress, 12);
48 112 my $res_data = Win32::Exe::ResourceData->new(\$data, { parent => $self });
49 112 $res_data->initialize;
50 112 $self->{res_data} = $res_data;
51 }
52  
53 64 ▶sub Data {
Subroutine Data: called CC=1 SCAR=0.0
Pod undocumented
54 64 my ($self) = @_;
55 64 return $self->{res_data}->Data;
56 }
57  
58 30 ▶sub CodePage {
Subroutine CodePage: called CC=1 SCAR=0.0
Pod undocumented
59 30 my ($self) = @_;
60 30 return $self->{res_data}->CodePage;
61 }
62  
63 86 ▶sub object {
Subroutine object: called CC=1 SCAR=0.0
Pod undocumented
64 86 my ($self) = @_;
65 86 return $self->{res_data}->object;
66 }
67  
68 5 1;
« lib/Win32/Exe/IconFile.pm ↑ Summary script/exe_update.pl »