Commit cd0c26e4 by Craig Heffner

Merge branch 'master' of https://github.com/devttys0/binwalk

parents 35d5b776 704ae358
......@@ -20,13 +20,14 @@
#
# o gzip
# o lzma
# o xz
#
#######################################################################################################################################
# Assumes these utilities are installed in $PATH.
^gzip compressed data:gz:gzip -d -f '%e':0,2
^lzma compressed data:7z:7z e -y '%e':0,1
^xz compressed data:tar:tar xJf '%e'
^xz compressed data:xz:7z e -y '%e':0,1
^bzip2 compressed data:bz2:bzip2 -d '%e'
^compress'd data:Z:gzip -d '%e'
^zip archive data:zip:7z x -y '%e' -p '':0,1
......
......@@ -9,6 +9,9 @@ class LZMAExtractPlugin(binwalk.core.plugin.Plugin):
def init(self):
try:
# lzma package in Python 2.0 decompress() does not handle multiple
# compressed streams, only first stream is extracted.
# backports.lzma package could be used to keep consistent behaviour.
import lzma
self.decompressor = lzma.decompress
......@@ -19,6 +22,10 @@ class LZMAExtractPlugin(binwalk.core.plugin.Plugin):
regex="^lzma compressed data",
extension="7z",
cmd=self.extractor)
self.module.extractor.add_rule(txtrule=None,
regex="^xz compressed data",
extension="xz",
cmd=self.extractor)
except ImportError as e:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment