From 0d4f3d32969112d2549e1e3a5eb4a14bf996fd8c Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Sun, 5 Nov 2017 19:50:05 -0500 Subject: [PATCH] Style 00 bytes as comments in MemoryView This makes it easier to notice and pay attention to nonzero bytes in memory that's mostly zeroes. --- voltron/plugins/view/memory.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/voltron/plugins/view/memory.py b/voltron/plugins/view/memory.py index 6f9a819..d23da5d 100644 --- a/voltron/plugins/view/memory.py +++ b/voltron/plugins/view/memory.py @@ -90,13 +90,11 @@ class MemoryView(TerminalView): byte_array = [] for i, x in enumerate(six.iterbytes(chunk)): n = "%02X" % x + token = Text if x else Comment if self.args.track and self.last_memory and self.last_address == m_res.address: if x != six.indexbytes(self.last_memory, c + i): - byte_array.append((Error, n)) - else: - byte_array.append((Text, n)) - else: - byte_array.append((Text, n)) + token = Error + byte_array.append((token, n)) if self.args.words: if target['byte_order'] =='little': @@ -112,7 +110,7 @@ class MemoryView(TerminalView): # ASCII representation yield (Punctuation, '| ') for i, x in enumerate(six.iterbytes(chunk)): - token = String.Char + token = String.Char if x else Comment if self.args.track and self.last_memory and self.last_address == m_res.address: if x != six.indexbytes(self.last_memory, c + i): token = Error