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
b666c8fb
Commit
b666c8fb
authored
Nov 14, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CRC32 polynomial table signatures
parent
70df244e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
14 deletions
+30
-14
magic.py
src/binwalk/core/magic.py
+13
-1
code
src/binwalk/magic/code
+5
-1
firmware
src/binwalk/magic/firmware
+12
-12
No files found.
src/binwalk/core/magic.py
View file @
b666c8fb
...
@@ -37,6 +37,7 @@ class SignatureResult(binwalk.core.module.Result):
...
@@ -37,6 +37,7 @@ class SignatureResult(binwalk.core.module.Result):
self
.
strlen
=
0
self
.
strlen
=
0
self
.
string
=
False
self
.
string
=
False
self
.
invalid
=
False
self
.
invalid
=
False
self
.
once
=
False
# These are set by code internally
# These are set by code internally
self
.
id
=
0
self
.
id
=
0
...
@@ -374,6 +375,8 @@ class Magic(object):
...
@@ -374,6 +375,8 @@ class Magic(object):
self
.
data
=
""
self
.
data
=
""
# A list of Signature class objects, populated by self.parse (see also: self.load)
# A list of Signature class objects, populated by self.parse (see also: self.load)
self
.
signatures
=
[]
self
.
signatures
=
[]
# A set of signatures with the 'once' keyword that have already been displayed once
self
.
display_once
=
set
()
self
.
show_invalid
=
invalid
self
.
show_invalid
=
invalid
self
.
includes
=
[
re
.
compile
(
x
)
for
x
in
include
]
self
.
includes
=
[
re
.
compile
(
x
)
for
x
in
include
]
...
@@ -509,7 +512,7 @@ class Magic(object):
...
@@ -509,7 +512,7 @@ class Magic(object):
tag_strlen
=
None
tag_strlen
=
None
max_line_level
=
0
max_line_level
=
0
previous_line_end
=
0
previous_line_end
=
0
tags
=
{
'id'
:
signature
.
id
,
'offset'
:
offset
,
'invalid'
:
False
}
tags
=
{
'id'
:
signature
.
id
,
'offset'
:
offset
,
'invalid'
:
False
,
'once'
:
False
}
# Apply each line of the signature to self.data, starting at the specified offset
# Apply each line of the signature to self.data, starting at the specified offset
for
n
in
range
(
0
,
len
(
signature
.
lines
)):
for
n
in
range
(
0
,
len
(
signature
.
lines
)):
...
@@ -735,7 +738,16 @@ class Magic(object):
...
@@ -735,7 +738,16 @@ class Magic(object):
# Generate a SignatureResult object and append it to the results list if the
# Generate a SignatureResult object and append it to the results list if the
# signature is valid, or if invalid results were requested.
# signature is valid, or if invalid results were requested.
if
not
tags
[
'invalid'
]
or
self
.
show_invalid
:
if
not
tags
[
'invalid'
]
or
self
.
show_invalid
:
# Only display results with the 'once' tag once.
if
tags
[
'once'
]:
if
signature
.
title
in
self
.
display_once
:
continue
else
:
self
.
display_once
.
add
(
signature
.
title
)
# Append the result to the results list
results
.
append
(
SignatureResult
(
**
tags
))
results
.
append
(
SignatureResult
(
**
tags
))
# Add this offset to the matched_offsets set, so that it can be ignored by
# Add this offset to the matched_offsets set, so that it can be ignored by
# subsequent loops.
# subsequent loops.
matched_offsets
.
add
(
offset
)
matched_offsets
.
add
(
offset
)
...
...
src/binwalk/magic/code
View file @
b666c8fb
# Base64 index tables
# Base64 index tables
0 string ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
=
Standard base64 index table
0 string ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
Standard base64 index table
0 string ACEGIKMOQSUWYBDFHJLNPRTVXZacegikmoqsuwybdfhjlnprtvxz0246813579=+/ SerComm base64 index table
0 string ACEGIKMOQSUWYBDFHJLNPRTVXZacegikmoqsuwybdfhjlnprtvxz0246813579=+/ SerComm base64 index table
# CRC32 polynomial table
0 string \x00\x00\x00\x00\x77\x07\x30\x96\xEE\x0E\x61\x2C\x99\x09\x51\xBA CRC32 polynomial table, big endian
0 string \x00\x00\x00\x00\x96\x30\x07\x77\x2C\x61\x0E\xEE\xBA\x51\x09\x99 CRC32 polynomial table, little endian
src/binwalk/magic/firmware
View file @
b666c8fb
...
@@ -585,9 +585,9 @@
...
@@ -585,9 +585,9 @@
# Signatures to identify the start of a VxWorks symbol table
# 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,
8 string \x00\x00\x05\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
>4 belong 0 {invalid}
>4 belong 0 {invalid}
>4
belong
x first entry: [type: function, code address: 0x%X,
>4
ubelong
x first entry: [type: function, code address: 0x%X,
>0 belong 0 {invalid}
>0 belong 0 {invalid}
>0
belong x symbol address: 0x%X]{display-
once}
>0
ubelong x symbol address: 0x%X]{
once}
>24 belong !0x500
>24 belong !0x500
>>24 belong !0x700
>>24 belong !0x700
>>>24 belong !0x900 \b, {invalid}
>>>24 belong !0x900 \b, {invalid}
...
@@ -618,9 +618,9 @@
...
@@ -618,9 +618,9 @@
8 string \x00\x00\x07\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
8 string \x00\x00\x07\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
>4 belong 0 {invalid}
>4 belong 0 {invalid}
>4
belong
x first entry: [type: initialized data, code address: 0x%X,
>4
ubelong
x first entry: [type: initialized data, code address: 0x%X,
>0 belong 0 {invalid}
>0 belong 0 {invalid}
>0
belong x symbol address: 0x%X]{display-
once}
>0
ubelong x symbol address: 0x%X]{
once}
>24 belong !0x500
>24 belong !0x500
>>24 belong !0x700
>>24 belong !0x700
>>>24 belong !0x900 \b, {invalid}
>>>24 belong !0x900 \b, {invalid}
...
@@ -651,9 +651,9 @@
...
@@ -651,9 +651,9 @@
8 string \x00\x00\x09\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
8 string \x00\x00\x09\x00\x00\x00\x00\x00 VxWorks symbol table, big endian,
>4 belong 0 {invalid}
>4 belong 0 {invalid}
>4
belong
x first entry: [type: uninitialized data, code address: 0x%X,
>4
ubelong
x first entry: [type: uninitialized data, code address: 0x%X,
>0 belong 0 {invalid}
>0 belong 0 {invalid}
>0
belong x symbol address: 0x%X]{display-
once}
>0
ubelong x symbol address: 0x%X]{
once}
>24 belong !0x500
>24 belong !0x500
>>24 belong !0x700
>>24 belong !0x700
>>>24 belong !0x900 \b, {invalid}
>>>24 belong !0x900 \b, {invalid}
...
@@ -684,9 +684,9 @@
...
@@ -684,9 +684,9 @@
8 string \x00\x05\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
8 string \x00\x05\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
>4 lelong 0 {invalid}
>4 lelong 0 {invalid}
>4
lelong
x first entry: [type: function, code address: 0x%X,
>4
ulelong
x first entry: [type: function, code address: 0x%X,
>0 lelong 0 {invalid}
>0 lelong 0 {invalid}
>0
lelong x symbol address: 0x%X]{display-
once}
>0
ulelong x symbol address: 0x%X]{
once}
>24 lelong !0x500
>24 lelong !0x500
>>24 lelong !0x700
>>24 lelong !0x700
>>>24 lelong !0x900 \b, {invalid}
>>>24 lelong !0x900 \b, {invalid}
...
@@ -717,9 +717,9 @@
...
@@ -717,9 +717,9 @@
8 string \x00\x07\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
8 string \x00\x07\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
>4 lelong 0 {invalid}
>4 lelong 0 {invalid}
>4
lelong
x first entry: [type: initialized data, code address: 0x%X,
>4
ulelong
x first entry: [type: initialized data, code address: 0x%X,
>0 lelong 0 {invalid}
>0 lelong 0 {invalid}
>0
lelong x symbol address: 0x%X]{display-
once}
>0
ulelong x symbol address: 0x%X]{
once}
>24 lelong !0x500
>24 lelong !0x500
>>24 lelong !0x700
>>24 lelong !0x700
>>>24 lelong !0x900 \b, {invalid}
>>>24 lelong !0x900 \b, {invalid}
...
@@ -750,9 +750,9 @@
...
@@ -750,9 +750,9 @@
8 string \x00\x09\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
8 string \x00\x09\x00\x00\x00\x00\x00\x00 VxWorks symbol table, little endian,
>4 lelong 0 {invalid}
>4 lelong 0 {invalid}
>4
lelong
x first entry: [type: uninitialized data, code address: 0x%X,
>4
ulelong
x first entry: [type: uninitialized data, code address: 0x%X,
>0 lelong 0 {invalid}
>0 lelong 0 {invalid}
>0
lelong x symbol address: 0x%X]{display-
once}
>0
ulelong x symbol address: 0x%X]{
once}
>24 lelong !0x500
>24 lelong !0x500
>>24 lelong !0x700
>>24 lelong !0x700
>>>24 lelong !0x900 \b, {invalid}
>>>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