Similar to How to get trailing data of gzip archive? for GZIP archives I need a way to get the trailing data of an LZMA archives.
Asked
Active
Viewed 172 times
1 Answers
1
Similar to the solution posted in the GZIP thread, I created a Perl script to get the data. Note that this one uses a Perl module which isn't installed per default and in my case required another module and the sources for LZMA encoding/decoding, so I had to do the following on my Ubuntu 16.04 server first:
sudo apt install -y liblzma-dev
sudo cpan Compress::Raw::Lzma
sudo cpan IO::Uncompress::UnLzma
The Perl script:
#!/usr/bin/perl
use strict;
use warnings;
use IO::Uncompress::UnLzma qw(:all);
use IO::File;
my $in = new IO::File "<-" or die "Input error!\n";
unlzma $in => "/dev/null",
TrailingData => my $trailing;
undef $in;
print $trailing;
Usage:
./lzmaTrailingDataGet.pl </path/to/input.lzma >/path/to/output.bin
phk
- 5,893
- 7
- 41
- 70