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
aa428bb5
Commit
aa428bb5
authored
May 27, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug where -B would be ignored if specified with other signature options (e.g., -A)
parent
fb767b1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
signature.py
src/binwalk/modules/signature.py
+6
-6
No files found.
src/binwalk/modules/signature.py
View file @
aa428bb5
...
...
@@ -13,7 +13,7 @@ class Signature(Module):
CLI
=
[
Option
(
short
=
'B'
,
long
=
'signature'
,
kwargs
=
{
'enabled'
:
True
},
kwargs
=
{
'enabled'
:
True
,
'explicit_signature_scan'
:
True
},
description
=
'Scan target file(s) for common file signatures'
),
Option
(
short
=
'R'
,
long
=
'raw'
,
...
...
@@ -44,6 +44,7 @@ class Signature(Module):
Kwarg
(
name
=
'enabled'
,
default
=
False
),
Kwarg
(
name
=
'raw_bytes'
,
default
=
None
),
Kwarg
(
name
=
'search_for_opcodes'
,
default
=
False
),
Kwarg
(
name
=
'explicit_signature_scan'
,
default
=
False
),
Kwarg
(
name
=
'cast_data_types'
,
default
=
False
),
Kwarg
(
name
=
'dumb_scan'
,
default
=
False
),
Kwarg
(
name
=
'magic_files'
,
default
=
[]),
...
...
@@ -74,13 +75,12 @@ class Signature(Module):
]
# Use the system default magic file if no other was specified, or if -B was explicitly specified
elif
not
self
.
magic_files
:
self
.
magic_files
=
[
self
.
config
.
settings
.
get_file_path
(
'user'
,
self
.
config
.
settings
.
BINWALK_MAGIC_FILE
),
self
.
config
.
settings
.
get_file_path
(
'system'
,
self
.
config
.
settings
.
BINWALK_MAGIC_FILE
),
]
if
(
not
self
.
magic_files
)
or
(
self
.
explicit_signature_scan
and
not
self
.
cast_data_types
):
self
.
magic_files
.
append
(
self
.
config
.
settings
.
get_file_path
(
'user'
,
self
.
config
.
settings
.
BINWALK_MAGIC_FILE
))
self
.
magic_files
.
append
(
self
.
config
.
settings
.
get_file_path
(
'system'
,
self
.
config
.
settings
.
BINWALK_MAGIC_FILE
))
# Parse the magic file(s) and initialize libmagic
binwalk
.
core
.
common
.
debug
(
"Loading magic files:
%
s"
%
str
(
self
.
magic_files
))
self
.
mfile
=
self
.
parser
.
parse
(
self
.
magic_files
)
self
.
magic
=
binwalk
.
core
.
magic
.
Magic
(
self
.
mfile
)
...
...
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