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
1d50eaae
Commit
1d50eaae
authored
Jan 17, 2015
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check for pyqtgraph and warning if not found during entropy scans
parent
5a6458c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
entropy.py
src/binwalk/modules/entropy.py
+14
-6
No files found.
src/binwalk/modules/entropy.py
View file @
1d50eaae
...
...
@@ -113,6 +113,14 @@ class Entropy(Module):
self
.
block_size
=
None
def
run
(
self
):
# Sanity check and warning if pyqtgraph isn't found
if
self
.
do_plot
:
try
:
import
pyqtgraph
as
pg
except
ImportError
as
e
:
binwalk
.
core
.
common
.
warning
(
"pyqtgraph not found, visual entropy graphing will be disabled"
)
self
.
do_plot
=
False
for
fp
in
iter
(
self
.
next_file
,
None
):
if
self
.
display_results
:
...
...
@@ -124,12 +132,9 @@ class Entropy(Module):
self
.
footer
()
if
self
.
do_plot
:
import
pyqtgraph
as
pg
if
not
self
.
save_plot
:
from
pyqtgraph.Qt
import
QtGui
QtGui
.
QApplication
.
instance
()
.
exec_
()
pg
.
exit
()
def
calculate_file_entropy
(
self
,
fp
):
...
...
@@ -229,9 +234,12 @@ class Entropy(Module):
return
e
def
plot_entropy
(
self
,
fname
):
import
numpy
as
np
import
pyqtgraph
as
pg
import
pyqtgraph.exporters
as
exporters
try
:
import
numpy
as
np
import
pyqtgraph
as
pg
import
pyqtgraph.exporters
as
exporters
except
ImportError
as
e
:
return
i
=
0
x
=
[]
...
...
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