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
b3eb8b66
Commit
b3eb8b66
authored
Sep 04, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added display-once keyword
parent
64160326
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
smart.py
src/binwalk/core/smart.py
+22
-0
firmware
src/magic/firmware
+6
-6
No files found.
src/binwalk/core/smart.py
View file @
b3eb8b66
...
...
@@ -60,6 +60,7 @@ class Signature(object):
Tag
(
name
=
'string-len'
,
keyword
=
'string-len'
,
type
=
str
,
handler
=
'parse_string_len'
),
Tag
(
name
=
'math'
,
keyword
=
'math'
,
type
=
int
,
handler
=
'parse_math'
),
Tag
(
name
=
'one-of-many'
,
keyword
=
'one-of-many'
,
handler
=
'one_of_many'
),
Tag
(
name
=
'display-once'
,
keyword
=
'display-once'
,
handler
=
'display_once'
),
Tag
(
name
=
'jump'
,
keyword
=
'jump-to-offset'
,
type
=
int
),
Tag
(
name
=
'name'
,
keyword
=
'file-name'
,
type
=
str
),
...
...
@@ -85,6 +86,7 @@ class Signature(object):
'''
self
.
filter
=
filter
self
.
last_one_of_many
=
None
self
.
valid_once_already_seen
=
set
()
self
.
ignore_smart_signatures
=
ignore_smart_signatures
def
parse
(
self
,
data
):
...
...
@@ -164,6 +166,26 @@ class Signature(object):
data
=
data
.
replace
(
'"'
+
quoted_string
+
'"'
,
""
)
return
data
def
display_once
(
self
,
data
,
tag
):
'''
Determines if a given data string should be printed if {display-once} was specified.
@data - String result data.
Returns False if the string result should not be displayed.
Returns True if the string result should be displayed.
'''
if
self
.
filter
.
valid_result
(
data
):
signature
=
data
.
split
(
','
)[
0
]
if
signature
in
self
.
valid_once_already_seen
:
self
.
display
=
False
return
(
data
,
False
)
else
:
self
.
valid_once_already_seen
.
add
(
signature
)
return
(
data
,
True
)
return
(
data
,
True
)
def
one_of_many
(
self
,
data
,
tag
):
'''
Determines if a given data string is one result of many.
...
...
src/magic/firmware
View file @
b3eb8b66
...
...
@@ -585,7 +585,7 @@
# Signatures to identify the start of a VxWorks symbol table
8 string \x00\x00\x05\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
>4 belong x first entry: [type: function, code address: 0x%X,
>0 belong x symbol address: 0x%X]{
one-of-many
}
>0 belong x symbol address: 0x%X]{
display-once
}
>24 belong !0x500
>>24 belong !0x700
>>>24 belong !0x900 \b, invalid
...
...
@@ -601,7 +601,7 @@
8 string \x00\x00\x07\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
>4 belong x first entry: [type: initialized data, code address: 0x%X,
>0 belong x symbol address: 0x%X]{
one-of-many
}
>0 belong x symbol address: 0x%X]{
display-once
}
>24 belong !0x500
>>24 belong !0x700
>>>24 belong !0x900 \b, invalid
...
...
@@ -617,7 +617,7 @@
8 string \x00\x00\x09\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
>4 belong x first entry: [type: uninitialized data, code address: 0x%X,
>0 belong x symbol address: 0x%X]{
one-of-many
}
>0 belong x symbol address: 0x%X]{
display-once
}
>24 belong !0x500
>>24 belong !0x700
>>>24 belong !0x900 \b, invalid
...
...
@@ -633,7 +633,7 @@
8 string \x00\x05\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
>4 lelong x first entry: [type: function, code address: 0x%X,
>0 lelong x symbol address: 0x%X]{
one-of-many
}
>0 lelong x symbol address: 0x%X]{
display-once
}
>24 lelong !0x500
>>24 lelong !0x700
>>>24 lelong !0x900 \b, invalid
...
...
@@ -649,7 +649,7 @@
8 string \x00\x07\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
>4 lelong x first entry: [type: initialized data, code address: 0x%X,
>0 lelong x symbol address: 0x%X]{
one-of-many
}
>0 lelong x symbol address: 0x%X]{
display-once
}
>24 lelong !0x500
>>24 lelong !0x700
>>>24 lelong !0x900 \b, invalid
...
...
@@ -665,7 +665,7 @@
8 string \x00\x09\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
>4 lelong x first entry: [type: uninitialized data, code address: 0x%X,
>0 lelong x symbol address: 0x%X]{
one-of-many
}
>0 lelong x symbol address: 0x%X]{
display-once
}
>24 lelong !0x500
>>24 lelong !0x700
>>>24 lelong !0x900 \b, invalid
...
...
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