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-depend
binwalk
Commits
da84a44e
Unverified
Commit
da84a44e
authored
Mar 16, 2021
by
Peter Eacmen
Committed by
GitHub
Mar 16, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #518 from llamasoft/patch-1
Actually implement exponent and shift operators
parents
701e128b
ab0fef0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
magic.py
src/binwalk/core/magic.py
+8
-2
No files found.
src/binwalk/core/magic.py
View file @
da84a44e
...
...
@@ -97,7 +97,7 @@ class SignatureLine(object):
# AND the data with 0xFF before the comparison is performed).
#
# We support the following operators:
for
operator
in
[
'&'
,
'|'
,
'*'
,
'+'
,
'-'
,
'/'
,
'~'
,
'^'
]:
for
operator
in
[
'
**'
,
'<<'
,
'>>'
,
'
&'
,
'|'
,
'*'
,
'+'
,
'-'
,
'/'
,
'~'
,
'^'
]:
# Look for each operator in self.type
if
operator
in
self
.
type
:
# If found, split self.type into the type and operator value
...
...
@@ -632,7 +632,13 @@ class Magic(object):
opval
=
self
.
_do_math
(
offset
,
line
.
opvalue
)
# Perform the specified operation
if
line
.
operator
==
'&'
:
if
line
.
operator
==
'**'
:
dvalue
**=
opval
elif
line
.
operator
==
'<<'
:
dvalue
<<=
opval
elif
line
.
operator
==
'>>'
:
dvalue
>>=
opval
elif
line
.
operator
==
'&'
:
dvalue
&=
opval
elif
line
.
operator
==
'|'
:
dvalue
|=
opval
...
...
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