mirror of https://github.com/snare/voltron.git
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.
This commit is contained in:
parent
cd141b56dd
commit
0d4f3d3296
|
@ -90,13 +90,11 @@ class MemoryView(TerminalView):
|
||||||
byte_array = []
|
byte_array = []
|
||||||
for i, x in enumerate(six.iterbytes(chunk)):
|
for i, x in enumerate(six.iterbytes(chunk)):
|
||||||
n = "%02X" % x
|
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 self.args.track and self.last_memory and self.last_address == m_res.address:
|
||||||
if x != six.indexbytes(self.last_memory, c + i):
|
if x != six.indexbytes(self.last_memory, c + i):
|
||||||
byte_array.append((Error, n))
|
token = Error
|
||||||
else:
|
byte_array.append((token, n))
|
||||||
byte_array.append((Text, n))
|
|
||||||
else:
|
|
||||||
byte_array.append((Text, n))
|
|
||||||
|
|
||||||
if self.args.words:
|
if self.args.words:
|
||||||
if target['byte_order'] =='little':
|
if target['byte_order'] =='little':
|
||||||
|
@ -112,7 +110,7 @@ class MemoryView(TerminalView):
|
||||||
# ASCII representation
|
# ASCII representation
|
||||||
yield (Punctuation, '| ')
|
yield (Punctuation, '| ')
|
||||||
for i, x in enumerate(six.iterbytes(chunk)):
|
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 self.args.track and self.last_memory and self.last_address == m_res.address:
|
||||||
if x != six.indexbytes(self.last_memory, c + i):
|
if x != six.indexbytes(self.last_memory, c + i):
|
||||||
token = Error
|
token = Error
|
||||||
|
|
Loading…
Reference in New Issue