line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
2455
|
use 5.006; |
|
3
|
|
|
|
|
10
|
|
2
|
3
|
|
|
3
|
|
14
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
63
|
|
3
|
3
|
|
|
3
|
|
23
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
203
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package ELF::Extract::Sections::Meta::Scanner; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Interface Contract for Scanners |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.001002'; # TRIAL |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
1338
|
use Moose::Role qw( with requires ); |
|
3
|
|
|
|
|
524016
|
|
|
3
|
|
|
|
|
20
|
|
14
|
|
|
|
|
|
|
with 'MooseX::Log::Log4perl'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
requires 'open_file'; |
17
|
|
|
|
|
|
|
requires 'next_section'; |
18
|
|
|
|
|
|
|
requires 'section_offset'; |
19
|
|
|
|
|
|
|
requires 'section_size'; |
20
|
|
|
|
|
|
|
requires 'section_name'; |
21
|
|
|
|
|
|
|
requires 'can_compute_size'; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
3
|
|
12137
|
no Moose::Role; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
21
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding UTF-8 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
ELF::Extract::Sections::Meta::Scanner - Interface Contract for Scanners |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 1.001002 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 Required Methods for Applying Roles |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 C<open_file> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $file = $scanner->open_file( file => FILE ) |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Must take a file name and assume a state reset. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 C<next_section> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $boolean = $scanner->next_section |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Must return true if a section was discovered. |
54
|
|
|
|
|
|
|
Must return false otherwise. |
55
|
|
|
|
|
|
|
This method is called before getting data out. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 C<section_offset> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my $offset = $scanner->section_offset; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Returns the offset as an Integer |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 C<section_size> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $size = $scanner->section_size; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Returns the sections computed size ( if possible ) |
68
|
|
|
|
|
|
|
If you can't compute the size, please call $self->log->logcroak() |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 C<section_name> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $name = $scanner->section_name; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Returns the sections name |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 C<can_compute_size> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
my $boolean = $scanner->can_compute_size; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This returns whether or not this code is capable of discerning section sizes on its own. |
81
|
|
|
|
|
|
|
return 1 if true, return C<undef> otherwise. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This will make us try guessing how big sections are by sorting them. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 AUTHOR |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Kent Fredric <kentfredric@gmail.com>. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
94
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |