line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Compress::unLZMA; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20725
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
388
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
11
|
|
|
|
|
|
|
uncompress uncompressfile |
12
|
|
|
|
|
|
|
) ] ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
require XSLoader; |
19
|
|
|
|
|
|
|
XSLoader::load('Compress::unLZMA', $VERSION); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub compress { |
22
|
0
|
|
|
0
|
0
|
0
|
die "not implemented!\n"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub compressfile { |
26
|
0
|
|
|
0
|
0
|
0
|
die "not implemented!\n"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub uncompress { |
30
|
1007
|
|
|
1007
|
1
|
9113
|
my ($data) = @_; |
31
|
|
|
|
|
|
|
|
32
|
1007
|
100
|
|
|
|
2615
|
return undef if (length($data) < 14); |
33
|
|
|
|
|
|
|
|
34
|
1006
|
|
|
|
|
1955
|
my $properties = substr($data, 0, 5); |
35
|
|
|
|
|
|
|
|
36
|
1006
|
|
|
|
|
1449
|
my $size = 0; |
37
|
1006
|
|
|
|
|
2439
|
for (my $ii = 0; $ii < 4; $ii++) { |
38
|
4024
|
|
|
|
|
5983
|
my $b = ord(substr($data, $ii + 5, 1)); |
39
|
4024
|
|
|
|
|
9744
|
$size += $b << ($ii * 8); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
1006
|
|
|
|
|
2389
|
for (my $ii = 0; $ii < 4; $ii++) { |
43
|
4024
|
|
|
|
|
5138
|
my $b = ord(substr($data, $ii + 9, 1)); |
44
|
4024
|
50
|
|
|
|
11787
|
if ($b != 0) { |
45
|
0
|
|
|
|
|
0
|
return undef; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
1006
|
50
|
|
|
|
2170
|
if (ord(substr($properties, 0, 1)) >= (9 * 5 * 5)) { |
50
|
0
|
|
|
|
|
0
|
return undef; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
1006
|
100
|
|
|
|
1792
|
if ( $size == 0 ) { # empty file: no data to uncompress |
54
|
2
|
|
|
|
|
7
|
return ''; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
1004
|
|
|
|
|
1966
|
$data = substr($data, 13); |
58
|
|
|
|
|
|
|
|
59
|
1004
|
|
|
|
|
322112
|
my $result = uncompressdata($data, length($data), $size, $properties); |
60
|
|
|
|
|
|
|
|
61
|
1004
|
|
|
|
|
3549
|
return $result; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |