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
48d48d28
Commit
48d48d28
authored
Nov 09, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for offset expressions
parent
58446a92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
magic.py
src/binwalk/core/magic.py
+3
-1
firmware
src/binwalk/magic/firmware
+1
-2
No files found.
src/binwalk/core/magic.py
View file @
48d48d28
...
...
@@ -418,7 +418,9 @@ class Magic(object):
for
period
in
[
match
.
start
()
for
match
in
self
.
period
.
finditer
(
expression
)]:
# Separate the offset field into the integer offset and type values (o and t respsectively)
s
=
expression
[:
period
]
.
rfind
(
'('
)
+
1
o
=
int
(
expression
[
s
:
period
],
0
)
# The offset address may be an evaluatable expression, such as '(4+0.L)', typically the result
# of the original offset being something like '(&0.L)'.
o
=
binwalk
.
core
.
common
.
MathExpression
(
expression
[
s
:
period
])
.
value
t
=
expression
[
period
+
1
]
# Re-build just the parsed offset portion of the expression
...
...
src/binwalk/magic/firmware
View file @
48d48d28
...
...
@@ -576,8 +576,7 @@
>(198.L+202) belong 3
>>&4 string @(RECENT_FIRMWARE)/ \b, alias:
>>&23 string x "%s"
#>>(&0.L(0)) belong x
#>>>&4 belong x \b, file size: %d bytes
>>(&0.L+4) belong x \b, file size: %d bytes
# 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,
...
...
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