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
2b82b156
Commit
2b82b156
authored
Nov 07, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for multiple -R options in a single command
parent
6bc02d6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
signature.py
src/binwalk/modules/signature.py
+11
-5
No files found.
src/binwalk/modules/signature.py
View file @
2b82b156
...
...
@@ -18,8 +18,9 @@ class Signature(Module):
description
=
'Scan target file(s) for common file signatures'
),
Option
(
short
=
'R'
,
long
=
'raw'
,
kwargs
=
{
'enabled'
:
True
,
'raw_bytes'
:
''
},
type
=
str
,
kwargs
=
{
'enabled'
:
True
,
'raw_bytes'
:
[]},
type
=
list
,
dtype
=
str
.
__name__
,
description
=
'Scan target file(s) for the specified sequence of bytes'
),
Option
(
short
=
'A'
,
long
=
'opcodes'
,
...
...
@@ -58,7 +59,7 @@ class Signature(Module):
Kwarg
(
name
=
'show_invalid'
,
default
=
False
),
Kwarg
(
name
=
'include_filters'
,
default
=
[]),
Kwarg
(
name
=
'exclude_filters'
,
default
=
[]),
Kwarg
(
name
=
'raw_bytes'
,
default
=
None
),
Kwarg
(
name
=
'raw_bytes'
,
default
=
[]
),
Kwarg
(
name
=
'search_for_opcodes'
,
default
=
False
),
Kwarg
(
name
=
'explicit_signature_scan'
,
default
=
False
),
Kwarg
(
name
=
'dumb_scan'
,
default
=
False
),
...
...
@@ -88,10 +89,15 @@ class Signature(Module):
# Create a signature from the raw bytes, if any
if
self
.
raw_bytes
:
binwalk
.
core
.
common
.
debug
(
"Generating signature for raw byte sequence: '
%
s'"
%
self
.
raw_bytes
)
self
.
magic
.
parse
([
"0 string
%
s Raw signature"
%
self
.
raw_bytes
])
print
(
self
.
raw_bytes
)
raw_signatures
=
[]
for
raw_bytes
in
self
.
raw_bytes
:
raw_signatures
.
append
(
"0 string
%
s
%
s"
%
(
raw_bytes
,
raw_bytes
))
binwalk
.
core
.
common
.
debug
(
"Parsing raw signatures:
%
s"
%
str
(
raw_signatures
))
self
.
magic
.
parse
(
raw_signatures
)
# Parse the magic file(s)
if
self
.
magic_files
:
binwalk
.
core
.
common
.
debug
(
"Loading magic files:
%
s"
%
str
(
self
.
magic_files
))
for
f
in
self
.
magic_files
:
self
.
magic
.
load
(
f
)
...
...
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