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
283b1ee2
Commit
283b1ee2
authored
11 years ago
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed hexdiff colorization bug
parent
15a1d97a
master
…
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.0
v2.1.1
v2.0.1
v2.0.0
python27
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
hexdiff.py
src/binwalk/modules/hexdiff.py
+17
-12
No files found.
src/binwalk/modules/hexdiff.py
View file @
283b1ee2
...
...
@@ -82,21 +82,26 @@ class HexDiff(Module):
return
False
def
hexascii
(
self
,
target_data
,
byte
,
offset
):
diff_count
=
0
color
=
"green"
for
(
fp
,
data
)
in
iterator
(
target_data
):
try
:
if
data
[
offset
]
!=
byte
:
for
(
fp_i
,
data_i
)
in
iterator
(
target_data
):
diff_count
=
0
for
(
fp_j
,
data_j
)
in
iterator
(
target_data
):
if
fp_i
==
fp_j
:
continue
try
:
if
data_i
[
offset
]
!=
data_j
[
offset
]:
diff_count
+=
1
except
IndexError
as
e
:
diff_count
+=
1
except
IndexError
as
e
:
diff_count
+=
1
if
diff_count
==
len
(
target_data
)
-
1
:
color
=
"red"
elif
diff_count
>
0
:
color
=
"blue"
else
:
color
=
"green"
if
diff_count
==
len
(
target_data
)
-
1
:
color
=
"red"
elif
diff_count
>
0
:
color
=
"blue"
break
hexbyte
=
self
.
colorize
(
"
%.2
X"
%
ord
(
byte
),
color
)
...
...
This diff is collapsed.
Click to expand it.
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