"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bin/zipdetails" between
IO-Compress-2.100.tar.gz and IO-Compress-2.101.tar.gz

About: IO-Compress is a Perl interface to the zlib compression library (contains Compress-Zlib, IO-Compress-Zlib, IO-Compress-Bzip2, IO-Compress-Base).

zipdetails  (IO-Compress-2.100):zipdetails  (IO-Compress-2.101)
skipping to change at line 205 skipping to change at line 205
my $NIBBLES = 8; my $NIBBLES = 8;
my $LocalHeaderCount = 0; my $LocalHeaderCount = 0;
my $CentralHeaderCount = 0; my $CentralHeaderCount = 0;
my $START; my $START;
my $OFFSET = U64->new( 0 ); my $OFFSET = U64->new( 0 );
my $TRAILING = 0 ; my $TRAILING = 0 ;
my $PAYLOADLIMIT = 256; # U64->new( 256 ); my $PAYLOADLIMIT = 256; # U64->new( 256 );
my $ZERO = U64->new( 0 ); my $ZERO = U64->new( 0 );
my $SEEN = Seen->new();
sub prOff sub prOff
{ {
my $offset = shift; my $offset = shift;
my $s = offset($OFFSET); my $s = offset($OFFSET);
$OFFSET->add($offset); $OFFSET->add($offset);
return $s; return $s;
} }
sub offset sub offset
{ {
skipping to change at line 863 skipping to change at line 865
{ {
my $id = shift ; my $id = shift ;
Value_v($id) . " '" . ($ZIP_CompressionMethods{$id} || "Unknown Method") . " '" ; Value_v($id) . " '" . ($ZIP_CompressionMethods{$id} || "Unknown Method") . " '" ;
} }
sub LocalHeader sub LocalHeader
{ {
my $signature = shift ; my $signature = shift ;
my $data = shift ; my $data = shift ;
my $from_offset = $FH->tell() - 4;
print "\n"; print "\n";
++ $LocalHeaderCount; ++ $LocalHeaderCount;
out $data, "LOCAL HEADER #" . sprintf("%X", $LocalHeaderCount) , Value_V($si gnature); out $data, "LOCAL HEADER #" . sprintf("%X", $LocalHeaderCount) , Value_V($si gnature);
my $buffer; my $buffer;
my ($loc, $CDcompressedLength) ; my ($loc, $CDcompressedLength) ;
($loc, $CDcompressedLength) = @{ shift @CentralDirectory } ($loc, $CDcompressedLength) = @{ shift @CentralDirectory }
if ! $opt_scan ; if ! $opt_scan ;
skipping to change at line 930 skipping to change at line 934
# if ($CDcompressedLength->getHigh() || $CDcompressedLength->getLow()) { # if ($CDcompressedLength->getHigh() || $CDcompressedLength->getLow()) {
if ($CDcompressedLength) { if ($CDcompressedLength) {
outSomeData($CDcompressedLength, "PAYLOAD") ; outSomeData($CDcompressedLength, "PAYLOAD") ;
} }
if ($compressedMethod == 99) { if ($compressedMethod == 99) {
my $auth ; my $auth ;
myRead($auth, 10); myRead($auth, 10);
out $auth, "AES Auth", hexDump($auth); out $auth, "AES Auth", hexDump($auth);
} }
# $SEEN->save("LOCAL HEADER #" . sprintf("%X", $LocalHeaderCount), $filename
, $from_offset, $from_offset + $CDcompressedLength)
} }
sub outputFilename sub outputFilename
{ {
my $filename = shift; my $filename = shift;
if (length $filename > 256) if (length $filename > 256)
{ {
my $f = substr($filename, 0, 256) ; my $f = substr($filename, 0, 256) ;
out $f, "Filename", "'". $f . "' ..."; out $f, "Filename", "'". $f . "' ...";
skipping to change at line 952 skipping to change at line 958
{ {
out $filename, "Filename", "'". $filename . "'"; out $filename, "Filename", "'". $filename . "'";
} }
} }
sub CentralHeader sub CentralHeader
{ {
my $signature = shift ; my $signature = shift ;
my $data = shift ; my $data = shift ;
my $from_offset = $FH->tell() - 4;
++ $CentralHeaderCount; ++ $CentralHeaderCount;
print "\n"; print "\n";
out $data, "CENTRAL HEADER #" . sprintf("%X", $CentralHeaderCount) . "", Val ue_V($signature); out $data, "CENTRAL HEADER #" . sprintf("%X", $CentralHeaderCount) . "", Val ue_V($signature);
my $buffer; my $buffer;
out_C "Created Zip Spec", \&decodeZipVer; out_C "Created Zip Spec", \&decodeZipVer;
out_C "Created OS", \&decodeOS; out_C "Created OS", \&decodeOS;
out_C "Extract Zip Spec", \&decodeZipVer; out_C "Extract Zip Spec", \&decodeZipVer;
out_C "Extract OS", \&decodeOS; out_C "Extract OS", \&decodeOS;
skipping to change at line 1018 skipping to change at line 1026
$ExtraContext{InCentralDir} = 1; $ExtraContext{InCentralDir} = 1;
walkExtra($extraLength, \%ExtraContext); walkExtra($extraLength, \%ExtraContext);
} }
if ($comment_length) if ($comment_length)
{ {
my $comment ; my $comment ;
myRead($comment, $comment_length); myRead($comment, $comment_length);
out $comment, "Comment", "'". $comment . "'"; out $comment, "Comment", "'". $comment . "'";
} }
$SEEN->save("CENTRAL HEADER ref Local #" . sprintf("%X", $CentralHeaderCount
), $filename, $lcl_hdr_offset, $lcl_hdr_offset + $compressedLength) ;
# $SEEN->save("CENTRAL HEADER #" . sprintf("%X", $CentralHeaderCount), $file
name, $from_offset, $FH-tell());
} }
sub decodeZipVer sub decodeZipVer
{ {
my $ver = shift ; my $ver = shift ;
my $sHi = int($ver /10) ; my $sHi = int($ver /10) ;
my $sLo = $ver % 10 ; my $sLo = $ver % 10 ;
#out1 "Zip Spec", "$sHi.$sLo"; #out1 "Zip Spec", "$sHi.$sLo";
skipping to change at line 2235 skipping to change at line 2247
for my $pair (@nibbles) for my $pair (@nibbles)
{ {
my ($count, $limit) = @{ $pair }; my ($count, $limit) = @{ $pair };
return $count return $count
if $value >= $limit ; if $value >= $limit ;
} }
} }
} }
{
package Seen;
sub new
{
my $class = shift ;
my %object = ( overlaps => [],
detail => [],
) ;
bless \%object, $class;
}
sub save
{
my $self = shift ;
my $hdrId = shift;
my $name = shift;
my $from_offset = shift;
my $to_offset = shift ;
for my $entry ( @{ $self->{detail} } )
{
if ( $from_offset == $entry->{from} && $to_offset == $entry->{to} )
{
warn "$hdrId: '$name' matches with $entry->{str}\n"
}
elsif ( ($from_offset >= $entry->{from} && $from_offset <= $entry->{
to} ) ||
($to_offset >= $entry->{from} && $to_offset <= $entry->{to}
)
)
{
# die "overlap!"
# push @{ $self->{overlap} },
die "$hdrId: '$name' overlaps with $entry->{str}\n"
}
}
warn "ADD $from_offset $to_offset $hdrId: $name\n";
push @{ $self->{detail} },
{
from => $from_offset,
to => $to_offset,
id => $hdrId,
name => $name,
str => "$hdrId: '$name'",
} ;
}
sub summary
{
my $self = shift ;
for my $outer ( sort { $a->{from} <=> $b->{from} } @{ $self->{detail} }
)
{
my $from_offset = $outer->{from};
my $to_offset = $outer->{to};
my $hdrId = $outer->{id};
my $name = $outer->{name};
for my $entry ( sort { $a->{from} <=> $b->{from} } @{ $self->{detail
} } )
{
# next if
if ( ($from_offset >= $entry->{from} && $from_offset <= $entry->
{to} ) ||
($to_offset >= $entry->{from} && $to_offset <= $entry->{
to} )
)
{
# die "overlap!"
die $entry->{str} . " overlaps with $hdrId: '$name'\n"
}
}
}
}
}
sub Usage sub Usage
{ {
if (@_) if (@_)
{ {
warn "$_\n" warn "$_\n"
for @_ ; for @_ ;
warn "\n"; warn "\n";
} }
skipping to change at line 2439 skipping to change at line 2526
See also L<Archive::Zip::SimpleZip>, L<IO::Compress::Zip>, See also L<Archive::Zip::SimpleZip>, L<IO::Compress::Zip>,
L<IO::Uncompress::Unzip>. L<IO::Uncompress::Unzip>.
=head1 AUTHOR =head1 AUTHOR
Paul Marquess F<pmqs@cpan.org>. Paul Marquess F<pmqs@cpan.org>.
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (c) 2011-2020 Paul Marquess. All rights reserved. Copyright (c) 2011-2021 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. under the same terms as Perl itself.
 End of changes. 7 change blocks. 
1 lines changed or deleted 97 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)