Commit 283b1ee2 by devttys0

Fixed hexdiff colorization bug

parent 15a1d97a
...@@ -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("%.2X" % ord(byte), color) hexbyte = self.colorize("%.2X" % ord(byte), color)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment