Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
binwalk
Commits
9eefb489
Commit
9eefb489
authored
Dec 14, 2015
by
sviehb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use internal lzmaextract for xz and 7z as an alternative (tar can only tar.xz files)
parent
a450bdf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
extract.conf
src/binwalk/config/extract.conf
+2
-1
lzmaextract.py
src/binwalk/plugins/lzmaextract.py
+7
-1
No files found.
src/binwalk/config/extract.conf
View file @
9eefb489
...
...
@@ -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
:
7
z
:
7
z
e
-
y
'%e'
:
0
,
1
^
xz
compressed
data
:
tar
:
tar
xJf
'%e'
^
xz
compressed
data
:
xz
:
7
z
e
-
y
'%e'
:
0
,
1
^
bzip2
compressed
data
:
bz2
:
bzip2
-
d
'%e'
^
compress
'd data:Z:gzip -d '
%
e
'
^
zip
archive
data
:
zip
:
7
z
x
-
y
'%e'
-
p
''
:
0
,
1
...
...
src/binwalk/plugins/lzmaextract.py
100644 → 100755
View file @
9eefb489
...
...
@@ -9,7 +9,9 @@ class LZMAExtractPlugin(binwalk.core.plugin.Plugin):
def
init
(
self
):
try
:
import
lzma
# 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.
self
.
decompressor
=
lzma
.
decompress
# If the extractor is enabled for the module we're currently loaded
...
...
@@ -19,6 +21,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment