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
7a08b8b5
Commit
7a08b8b5
authored
Jan 10, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed one-of-many keyword handling bug
parent
5b7bfef5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
smart.py
src/binwalk/core/smart.py
+8
-8
extractor.py
src/binwalk/modules/extractor.py
+2
-2
signature.py
src/binwalk/modules/signature.py
+2
-3
No files found.
src/binwalk/core/smart.py
View file @
7a08b8b5
...
...
@@ -80,7 +80,6 @@ class Signature(object):
Returns None.
'''
self
.
filter
=
filter
self
.
valid
=
True
self
.
last_one_of_many
=
None
self
.
ignore_smart_signatures
=
ignore_smart_signatures
...
...
@@ -94,6 +93,7 @@ class Signature(object):
'''
results
=
{}
self
.
valid
=
True
self
.
display
=
True
if
data
:
for
tag
in
self
.
TAGS
:
...
...
@@ -118,6 +118,7 @@ class Signature(object):
self
.
valid
=
False
results
[
'valid'
]
=
self
.
valid
results
[
'display'
]
=
self
.
display
return
binwalk
.
core
.
module
.
Result
(
**
results
)
...
...
@@ -170,13 +171,12 @@ class Signature(object):
'''
if
self
.
filter
.
valid_result
(
data
):
if
self
.
last_one_of_many
is
not
None
and
data
.
startswith
(
self
.
last_one_of_many
):
return
(
data
,
False
)
if
tag
.
tag
in
data
:
# Only match on the data before the first comma, as that is typically unique and static
self
.
last_one_of_many
=
data
.
split
(
','
)[
0
]
else
:
self
.
last_one_of_many
=
None
self
.
display
=
False
elif
tag
.
tag
in
data
:
# Only match on the data before the first comma, as that is typically unique and static
self
.
last_one_of_many
=
data
.
split
(
','
)[
0
]
else
:
self
.
last_one_of_many
=
None
return
(
data
,
True
)
...
...
src/binwalk/modules/extractor.py
View file @
7a08b8b5
...
...
@@ -106,8 +106,8 @@ class Extractor(Module):
else
:
size
=
r
.
size
# Only extract valid results
marked for extraction
if
r
.
valid
and
r
.
extract
:
# Only extract valid results
displayed to the user and marked for extraction
if
r
.
valid
and
r
.
display
and
r
.
extract
:
# Do the extraction
(
extraction_directory
,
dd_file
)
=
self
.
extract
(
r
.
offset
,
r
.
description
,
r
.
file
.
name
,
size
,
r
.
name
)
...
...
src/binwalk/modules/signature.py
View file @
7a08b8b5
...
...
@@ -44,7 +44,7 @@ class Signature(Module):
Kwarg
(
name
=
'search_for_opcodes'
,
default
=
False
),
Kwarg
(
name
=
'cast_data_types'
,
default
=
False
),
Kwarg
(
name
=
'dumb_scan'
,
default
=
False
),
Kwarg
(
name
=
'force_default_scan'
,
default
=
False
),
Kwarg
(
name
=
'force_default_scan'
,
default
=
False
),
Kwarg
(
name
=
'magic_files'
,
default
=
[]),
]
...
...
@@ -100,7 +100,7 @@ class Signature(Module):
if
r
.
jump
and
(
r
.
jump
+
r
.
offset
)
>
r
.
file
.
size
:
r
.
valid
=
False
r
.
valid
=
self
.
config
.
filter
.
valid_result
(
r
.
description
)
def
scan_file
(
self
,
fp
):
...
...
@@ -132,7 +132,6 @@ class Signature(Module):
# The smart filter parser returns a binwalk.core.module.Result object
r
=
self
.
smart
.
parse
(
magic_result
)
# Set the absolute offset inside the target file
r
.
offset
=
block_start
+
candidate_offset
+
r
.
adjust
...
...
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