line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finnigan::FileHeader; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
74
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings FATAL => qw( all ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
82
|
|
5
|
|
|
|
|
|
|
our $VERSION = 0.0206; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
use Finnigan; |
|
2
|
|
|
|
|
80
|
|
|
2
|
|
|
|
|
39
|
|
8
|
2
|
|
|
2
|
|
8
|
use base 'Finnigan::Decoder'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
153
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
10
|
use overload ('""' => 'stringify'); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub decode { |
13
|
2
|
|
|
2
|
1
|
53
|
my ($class, $stream) = @_; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
25
|
my $fields = [ |
16
|
|
|
|
|
|
|
magic => ['v', 'UInt16'], |
17
|
|
|
|
|
|
|
signature => ['U0C18', 'UTF16LE'], |
18
|
|
|
|
|
|
|
"unknown_long[1]" => ['V', 'UInt32'], |
19
|
|
|
|
|
|
|
"unknown_long[2]" => ['V', 'UInt32'], |
20
|
|
|
|
|
|
|
"unknown_long[3]" => ['V', 'UInt32'], |
21
|
|
|
|
|
|
|
"unknown_long[4]" => ['V', 'UInt32'], |
22
|
|
|
|
|
|
|
version => ['V', 'UInt32'], |
23
|
|
|
|
|
|
|
audit_start => ['object', 'Finnigan::AuditTag'], |
24
|
|
|
|
|
|
|
audit_end => ['object', 'Finnigan::AuditTag'], |
25
|
|
|
|
|
|
|
"unknown_long[5]" => ['V', 'UInt32'], |
26
|
|
|
|
|
|
|
unknown_area => ['C60', 'RawBytes'], |
27
|
|
|
|
|
|
|
tag => ['U0C1028', 'UTF16LE'], |
28
|
|
|
|
|
|
|
]; |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
15
|
my $self = Finnigan::Decoder->read($stream, $fields); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# make sure we're reading the right file |
33
|
2
|
|
|
|
|
11
|
my $magic = sprintf "%4x", $self->{data}->{magic}->{value}; |
34
|
2
|
50
|
|
|
|
8
|
die "unrecognized magic number $magic" unless $self->{data}->{magic}->{value} == 0xa101; |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
|
|
16
|
return bless $self, $class; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub version { |
40
|
74
|
|
|
74
|
1
|
2898
|
my ( $self ) = @_; |
41
|
74
|
|
|
|
|
457
|
$self->{data}->{version}->{value}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub audit_start { |
45
|
1
|
|
|
1
|
1
|
3
|
my ( $self ) = @_; |
46
|
1
|
|
|
|
|
7
|
$self->{data}->{audit_start}->{value}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub audit_end { |
50
|
0
|
|
|
0
|
1
|
|
my ( $self ) = @_; |
51
|
0
|
|
|
|
|
|
$self->{data}->{audit_end}->{value}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub tag { |
55
|
0
|
|
|
0
|
1
|
|
my ( $self ) = @_; |
56
|
0
|
|
|
|
|
|
$self->{data}->{tag}->{value}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub stringify { |
60
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $version = $self->version; |
63
|
0
|
|
|
|
|
|
my $audit_tag = $self->audit_start; |
64
|
0
|
|
|
|
|
|
return "V.$version; $audit_tag"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |