Descobri agora como obter os dados finais.
Eu criei um script Perl que cria um arquivo com os dados à direita. Ele é strongmente baseado em link :
#!/usr/bin/perl
use strict;
use warnings;
use IO::Uncompress::Gunzip qw(:all);
use IO::File;
unshift(@ARGV, '-') unless -t STDIN;
my $input_file_name = shift;
my $output_file_name = shift;
if (! defined $input_file_name) {
die <<END;
Usage:
$0 ( GZIP_FILE | - ) [OUTPUT_FILE]
... | $0 [OUTPUT_FILE]
Extracts the trailing data of a gzip archive.
Outputs to stdout if no OUTPUT_FILE is given.
- as input file file causes it to read from stdin.
Examples:
$0 archive.tgz trailing.bin
cat archive.tgz | $0
END
}
my $in = new IO::File "<$input_file_name" or die "Couldn't open gzip file.\n";
gunzip $in => "/dev/null",
TrailingData => my $trailing;
undef $in;
if (! defined $output_file_name) {
print $trailing;
} else {
open(my $fh, ">", $output_file_name) or die "Couldn't open output file.\n";
print $fh $trailing;
close $fh;
print "Output file written.\n";
}