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
Jan 09, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed hexdiff colorization bug
parent
15a1d97a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
hexdiff.py
src/binwalk/modules/hexdiff.py
+9
-4
No files found.
src/binwalk/modules/hexdiff.py
View file @
283b1ee2
...
@@ -82,11 +82,17 @@ class HexDiff(Module):
...
@@ -82,11 +82,17 @@ class HexDiff(Module):
return
False
return
False
def
hexascii
(
self
,
target_data
,
byte
,
offset
):
def
hexascii
(
self
,
target_data
,
byte
,
offset
):
color
=
"green"
for
(
fp_i
,
data_i
)
in
iterator
(
target_data
):
diff_count
=
0
diff_count
=
0
for
(
fp
,
data
)
in
iterator
(
target_data
):
for
(
fp_j
,
data_j
)
in
iterator
(
target_data
):
if
fp_i
==
fp_j
:
continue
try
:
try
:
if
data
[
offset
]
!=
byte
:
if
data_i
[
offset
]
!=
data_j
[
offset
]
:
diff_count
+=
1
diff_count
+=
1
except
IndexError
as
e
:
except
IndexError
as
e
:
diff_count
+=
1
diff_count
+=
1
...
@@ -95,8 +101,7 @@ class HexDiff(Module):
...
@@ -95,8 +101,7 @@ class HexDiff(Module):
color
=
"red"
color
=
"red"
elif
diff_count
>
0
:
elif
diff_count
>
0
:
color
=
"blue"
color
=
"blue"
else
:
break
color
=
"green"
hexbyte
=
self
.
colorize
(
"
%.2
X"
%
ord
(
byte
),
color
)
hexbyte
=
self
.
colorize
(
"
%.2
X"
%
ord
(
byte
),
color
)
...
...
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