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
95bce4ed
Commit
95bce4ed
authored
9 years ago
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check for backports.lzma when importing lzma module
parent
c2cec5f6
fix-entropy-graph-legend
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletions
+11
-1
compression.py
src/binwalk/modules/compression.py
+4
-1
lzmaextract.py
src/binwalk/plugins/lzmaextract.py
+4
-0
lzmavalid.py
src/binwalk/plugins/lzmavalid.py
+3
-0
No files found.
src/binwalk/modules/compression.py
View file @
95bce4ed
...
...
@@ -2,11 +2,14 @@
import
os
import
zlib
import
lzma
import
struct
import
binwalk.core.compat
import
binwalk.core.common
from
binwalk.core.module
import
Option
,
Kwarg
,
Module
try
:
import
lzma
except
ImportError
:
from
backports
import
lzma
class
LZMAHeader
(
object
):
def
__init__
(
self
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
src/binwalk/plugins/lzmaextract.py
View file @
95bce4ed
...
...
@@ -12,7 +12,11 @@ class LZMAExtractPlugin(binwalk.core.plugin.Plugin):
# 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.
try
:
import
lzma
except
ImportError
:
from
backports
import
lzma
self
.
decompressor
=
lzma
.
decompress
# If the extractor is enabled for the module we're currently loaded
...
...
This diff is collapsed.
Click to expand it.
src/binwalk/plugins/lzmavalid.py
View file @
95bce4ed
...
...
@@ -17,7 +17,10 @@ class LZMAPlugin(binwalk.core.plugin.Plugin):
def
init
(
self
):
try
:
try
:
import
lzma
except
ImportError
:
from
backports
import
lzma
self
.
decompressor
=
lzma
.
decompress
except
ImportError
as
e
:
self
.
decompressor
=
None
...
...
This diff is collapsed.
Click to expand it.
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