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
35fb045b
Commit
35fb045b
authored
Dec 01, 2013
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added plot3d method to Binwalk class.
parent
7736d903
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
binwalk
src/bin/binwalk
+9
-3
__init__.py
src/binwalk/__init__.py
+18
-0
No files found.
src/bin/binwalk
View file @
35fb045b
...
@@ -56,8 +56,12 @@ Diffing multiple files:
...
@@ -56,8 +56,12 @@ Diffing multiple files:
\t
$
%
s -W firmware1.bin firmware2.bin firmware3.bin
\t
$
%
s -W firmware1.bin firmware2.bin firmware3.bin
Generating a 3D plot:
\t
$
%
s --3D firmware.bin
See http://binwalk.org/wiki/usage for more.
See http://binwalk.org/wiki/usage for more.
"""
%
(
name
,
name
,
name
,
name
,
name
,
name
,
name
,
name
))
"""
%
(
name
,
name
,
name
,
name
,
name
,
name
,
name
,
name
,
name
))
sys
.
exit
(
0
)
sys
.
exit
(
0
)
def
main
():
def
main
():
...
@@ -433,8 +437,10 @@ def main():
...
@@ -433,8 +437,10 @@ def main():
bwalk
.
concatenate_results
(
results
,
r
)
bwalk
.
concatenate_results
(
results
,
r
)
elif
scan_type
==
binwalk
.
Binwalk
.
BINVIS
:
elif
scan_type
==
binwalk
.
Binwalk
.
BINVIS
:
binwalk
.
plotter
.
Plotter3D
(
target_files
,
offset
=
offset
,
length
=
length
,
weight
=
weight
,
verbose
=
True
)
.
plot
()
# Always enable verbose mode; generating the plot can take some time for large files,
# and without verbose mode enabled it looks like binwalk is just sitting there doing nothing.
bwalk
.
plot3d
(
target_files
,
offset
=
offset
,
length
=
length
,
weight
=
weight
,
verbose
=
True
)
elif
scan_type
==
binwalk
.
Binwalk
.
ENTROPY
:
elif
scan_type
==
binwalk
.
Binwalk
.
ENTROPY
:
...
...
src/binwalk/__init__.py
View file @
35fb045b
...
@@ -10,6 +10,7 @@ from binwalk.update import *
...
@@ -10,6 +10,7 @@ from binwalk.update import *
from
binwalk.filter
import
*
from
binwalk.filter
import
*
from
binwalk.parser
import
*
from
binwalk.parser
import
*
from
binwalk.plugins
import
*
from
binwalk.plugins
import
*
from
binwalk.plotter
import
*
from
binwalk.hexdiff
import
*
from
binwalk.hexdiff
import
*
from
binwalk.entropy
import
*
from
binwalk.entropy
import
*
from
binwalk.extractor
import
*
from
binwalk.extractor
import
*
...
@@ -287,6 +288,23 @@ class Binwalk(object):
...
@@ -287,6 +288,23 @@ class Binwalk(object):
return
data
return
data
def
plot3d
(
self
,
target_files
,
offset
=
0
,
length
=
0
,
weight
=
None
,
verbose
=
False
):
'''
Generates a 3D data plot of the specified target files.
@target_files - File or list of files to scan.
@offset - Starting offset at which to start the scan.
@length - Number of bytes to scan. Specify 0 to scan the entire file(s).
@weight - A data point must occur at least this many times before being plotted (default: auto-detect).
@verbose - Set to True to enable verbose output.
Returns None.
'''
if
not
isinstance
(
target_files
,
type
([])):
target_files
=
[
target_files
]
Plotter3D
(
target_files
,
offset
=
offset
,
length
=
length
,
weight
=
weight
,
verbose
=
verbose
)
.
plot
()
def
scan
(
self
,
target_files
,
offset
=
0
,
length
=
0
,
show_invalid_results
=
False
,
callback
=
None
,
start_callback
=
None
,
end_callback
=
None
,
base_dir
=
None
,
matryoshka
=
1
,
plugins_whitelist
=
[],
plugins_blacklist
=
[]):
def
scan
(
self
,
target_files
,
offset
=
0
,
length
=
0
,
show_invalid_results
=
False
,
callback
=
None
,
start_callback
=
None
,
end_callback
=
None
,
base_dir
=
None
,
matryoshka
=
1
,
plugins_whitelist
=
[],
plugins_blacklist
=
[]):
'''
'''
Performs a binwalk scan on a file or list of files.
Performs a binwalk scan on a file or list of files.
...
...
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