Added ability to specify number of bytes to display with args.words

This commit is contained in:
raywang 2017-09-19 16:15:59 -04:00
parent cd11d2f93b
commit bd3b64572c
1 changed files with 7 additions and 5 deletions

View File

@ -100,10 +100,12 @@ class MemoryView(TerminalView):
if self.args.words:
if target['byte_order'] =='little':
byte_array.reverse()
for x in byte_array:
yield x
yield (Text, ' ')
byte_array_words = [byte_array[i:i+ target['addr_size']] for i in range(0, self.args.bytes, target['addr_size'])]
for word in byte_array_words:
word.reverse()
for x in word:
yield x
yield (Text, ' ')
else:
for x in byte_array:
yield x
@ -151,7 +153,7 @@ class MemoryView(TerminalView):
if t_res and t_res.is_success and len(t_res.targets) > 0:
target = t_res.targets[0]
if self.args.deref or self.args.words:
if self.args.deref:
self.args.bytes = target['addr_size']
f = pygments.formatters.get_formatter_by_name(self.config.format.pygments_formatter,