line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Compress::unLZMA; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
30672
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
505
|
|
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.04'; |
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
|
12282
|
my ($data) = @_; |
31
|
|
|
|
|
|
|
|
32
|
1007
|
100
|
|
|
|
3221
|
return undef if (length($data) < 14); |
33
|
|
|
|
|
|
|
|
34
|
1006
|
|
|
|
|
2154
|
my $properties = substr($data, 0, 5); |
35
|
|
|
|
|
|
|
|
36
|
1006
|
|
|
|
|
1894
|
my $size = 0; |
37
|
1006
|
|
|
|
|
2957
|
for (my $ii = 0; $ii < 4; $ii++) { |
38
|
4024
|
|
|
|
|
5748
|
my $b = ord(substr($data, $ii + 5, 1)); |
39
|
4024
|
|
|
|
|
11049
|
$size += $b << ($ii * 8); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
1006
|
|
|
|
|
2572
|
for (my $ii = 0; $ii < 4; $ii++) { |
43
|
4024
|
|
|
|
|
5606
|
my $b = ord(substr($data, $ii + 9, 1)); |
44
|
4024
|
50
|
|
|
|
18651
|
if ($b != 0) { |
45
|
0
|
|
|
|
|
0
|
return undef; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
1006
|
50
|
|
|
|
2560
|
if (ord(substr($properties, 0, 1)) >= (9 * 5 * 5)) { |
50
|
0
|
|
|
|
|
0
|
return undef; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
1006
|
100
|
|
|
|
2149
|
if ( $size == 0 ) { # empty file: no data to uncompress |
54
|
2
|
|
|
|
|
5
|
return ''; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
1004
|
|
|
|
|
2214
|
$data = substr($data, 13); |
58
|
|
|
|
|
|
|
|
59
|
1004
|
|
|
|
|
341830
|
my $result = uncompressdata($data, length($data), $size, $properties); |
60
|
|
|
|
|
|
|
|
61
|
1004
|
|
|
|
|
4108
|
return $result; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |