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
31402726
Commit
31402726
authored
Jan 10, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/devttys0/binwalk
parents
5fc6df7b
fdf29459
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
8 deletions
+13
-8
display.py
src/binwalk/core/display.py
+1
-1
module.py
src/binwalk/core/module.py
+2
-3
plugin.py
src/binwalk/core/plugin.py
+1
-1
hashmatch.py
src/binwalk/modules/hashmatch.py
+8
-2
compressd.py
src/binwalk/plugins/compressd.py
+1
-1
No files found.
src/binwalk/core/display.py
View file @
31402726
...
...
@@ -83,7 +83,7 @@ class Display(object):
# four spaces in the description string, which would break auto-formatting.
for
i
in
range
(
len
(
args
)):
if
isinstance
(
args
[
i
],
str
):
while
" "
in
args
[
i
]:
while
"
"
in
args
[
i
]:
args
[
i
]
=
args
[
i
]
.
replace
(
" "
,
" "
)
self
.
_fprint
(
self
.
result_format
,
tuple
(
args
))
...
...
src/binwalk/core/module.py
View file @
31402726
...
...
@@ -537,10 +537,9 @@ class Modules(object):
def
_set_arguments
(
self
,
argv
=
[],
kargv
=
{}):
for
(
k
,
v
)
in
iterator
(
kargv
):
k
=
self
.
_parse_api_opt
(
k
)
argv
.
append
(
k
)
if
v
not
in
[
True
,
False
,
None
]:
argv
.
append
(
"
%
s
%
s"
%
(
k
,
v
))
else
:
argv
.
append
(
k
)
argv
.
append
(
v
)
if
not
argv
and
not
self
.
arguments
:
self
.
arguments
=
sys
.
argv
[
1
:]
...
...
src/binwalk/core/plugin.py
View file @
31402726
...
...
@@ -177,7 +177,7 @@ class Plugins(object):
if
file_name
.
endswith
(
self
.
MODULE_EXTENSION
):
module
=
file_name
[:
-
len
(
self
.
MODULE_EXTENSION
)]
try
:
try
:
plugin
=
imp
.
load_source
(
module
,
os
.
path
.
join
(
plugins
[
key
][
'path'
],
file_name
))
plugin_class
=
self
.
_find_plugin_class
(
plugin
)
...
...
src/binwalk/modules/hashmatch.py
View file @
31402726
...
...
@@ -65,7 +65,6 @@ class HashMatch(Module):
Kwarg
(
name
=
'strings'
,
default
=
False
),
Kwarg
(
name
=
'same'
,
default
=
True
),
Kwarg
(
name
=
'symlinks'
,
default
=
False
),
Kwarg
(
name
=
'name'
,
default
=
False
),
Kwarg
(
name
=
'max_results'
,
default
=
None
),
Kwarg
(
name
=
'abspath'
,
default
=
False
),
Kwarg
(
name
=
'filter_by_name'
,
default
=
False
),
...
...
@@ -87,7 +86,7 @@ class HashMatch(Module):
FUZZY_MIN_FILE_SIZE
=
4096
HEADER_FORMAT
=
"
\n
%
s"
+
" "
*
11
+
"
%
s
\n
"
RESULT_FORMAT
=
"
%
.3
d
%%
"
+
" "
*
17
+
"
%
s
\n
"
RESULT_FORMAT
=
"
%
d
%%
"
+
" "
*
17
+
"
%
s
\n
"
HEADER
=
[
"SIMILARITY"
,
"FILE NAME"
]
RESULT
=
[
"percentage"
,
"description"
]
...
...
@@ -104,6 +103,13 @@ class HashMatch(Module):
def
_show_result
(
self
,
match
,
fname
):
if
self
.
abspath
:
fname
=
os
.
path
.
abspath
(
fname
)
# Add description string padding for alignment
if
match
<
100
:
fname
=
' '
+
fname
if
match
<
10
:
fname
=
' '
+
fname
self
.
result
(
percentage
=
match
,
description
=
fname
)
def
_compare_files
(
self
,
file1
,
file2
):
...
...
src/binwalk/plugins/compressd.py
View file @
31402726
...
...
@@ -23,7 +23,7 @@ class CompressdPlugin(binwalk.core.plugin.Plugin):
def
scan
(
self
,
result
):
if
result
.
file
and
result
.
description
.
lower
()
.
startswith
(
"compress'd data"
):
fd
=
BlockFile
(
result
.
file
.
name
,
"r"
,
offset
=
result
.
offset
,
length
=
self
.
READ_SIZE
)
fd
=
self
.
module
.
config
.
open_file
(
result
.
file
.
name
,
offset
=
result
.
offset
,
length
=
self
.
READ_SIZE
)
compressed_data
=
fd
.
read
(
self
.
READ_SIZE
)
fd
.
close
()
...
...
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