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
acae7cb2
Commit
acae7cb2
authored
Mar 28, 2015
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed entropy pg.exit bug
parent
a42362f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
entropy.py
src/binwalk/modules/entropy.py
+10
-4
No files found.
src/binwalk/modules/entropy.py
View file @
acae7cb2
...
...
@@ -3,6 +3,7 @@
import
os
import
math
import
zlib
import
multiprocessing
import
binwalk.core.common
from
binwalk.core.compat
import
*
from
binwalk.core.module
import
Module
,
Option
,
Kwarg
...
...
@@ -113,6 +114,14 @@ class Entropy(Module):
self
.
block_size
=
None
def
run
(
self
):
# Need to invoke the pyqtgraph stuff via a separate process, as calling pg.exit
# is pretty much required. pg.exit calls os._exit though, and we don't want to
# exit out of the main process (especially if being run via the API).
p
=
multiprocessing
.
Process
(
target
=
self
.
_run
)
p
.
start
()
p
.
join
()
def
_run
(
self
):
# Sanity check and warning if pyqtgraph isn't found
if
self
.
do_plot
:
try
:
...
...
@@ -135,10 +144,7 @@ class Entropy(Module):
if
not
self
.
save_plot
:
from
pyqtgraph.Qt
import
QtGui
QtGui
.
QApplication
.
instance
()
.
exec_
()
# Calling pg.exit causes a sys.exit. If using the binwalk module
# from a script, this is probably undesirable. Are there any negative
# side effect to *not* calling pg.exit?
#pg.exit()
pg
.
exit
()
def
calculate_file_entropy
(
self
,
fp
):
# Tracks the last displayed rising/falling edge (0 for falling, 1 for rising, None if nothing has been printed yet)
...
...
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