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
5860c32d
Commit
5860c32d
authored
Apr 19, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed graphing bugs
parent
afc5ad77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
module.py
src/binwalk/core/module.py
+8
-5
entropy.py
src/binwalk/modules/entropy.py
+2
-1
No files found.
src/binwalk/core/module.py
View file @
5860c32d
...
...
@@ -54,13 +54,15 @@ class Option(object):
if
self
.
type
and
(
self
.
type
.
__name__
==
self
.
dtype
):
# Be sure to specify a base of 0 for int() so that the base is auto-detected
if
self
.
type
==
int
:
return
self
.
type
(
value
,
0
)
t
=
self
.
type
(
value
,
0
)
else
:
return
self
.
type
(
value
)
elif
default_value
:
return
default_value
t
=
self
.
type
(
value
)
elif
default_value
is
not
None
:
t
=
default_value
else
:
return
value
t
=
value
return
t
class
Kwarg
(
object
):
'''
...
...
@@ -766,6 +768,7 @@ class Modules(object):
except
Exception
as
e
:
raise
ModuleException
(
"Invalid usage:
%
s"
%
str
(
e
))
binwalk
.
core
.
common
.
debug
(
"
%
s ::
%
s =>
%
s"
%
(
module
.
TITLE
,
str
(
argv
),
str
(
kwargs
)))
return
kwargs
def
kwargs
(
self
,
obj
,
kwargs
):
...
...
src/binwalk/modules/entropy.py
View file @
5860c32d
...
...
@@ -156,6 +156,7 @@ class Entropy(Module):
def
plot_entropy
(
self
,
fname
):
import
numpy
as
np
import
binwalk.pyqtgraph
as
pg
import
binwalk.pyqtgraph.exporters
as
exporters
i
=
0
x
=
[]
...
...
@@ -195,7 +196,7 @@ class Entropy(Module):
# TODO: legend is not displayed properly when saving plots to disk
if
self
.
save_plot
:
exporter
=
pg
.
exporters
.
ImageExporter
.
ImageExporter
(
plt
.
plotItem
)
exporter
=
exporters
.
ImageExporter
.
ImageExporter
(
plt
.
plotItem
)
exporter
.
parameters
()[
'width'
]
=
self
.
FILE_WIDTH
exporter
.
export
(
binwalk
.
core
.
common
.
unique_file_name
(
os
.
path
.
basename
(
fname
),
self
.
FILE_FORMAT
))
else
:
...
...
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