Skip to content

Commit

Permalink
Merge pull request longld#49 from mancha1/hexdump
Browse files Browse the repository at this point in the history
Fix bug in hexdump when called with a byte count parameter
  • Loading branch information
longld committed Mar 18, 2015
2 parents 8c831be + 1a2ef59 commit d3b656e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions peda.py
Original file line number Diff line number Diff line change
Expand Up @@ -3276,12 +3276,13 @@ def ascii_char(ch):
if address is None:
self._missing_argument()

if count and count.startswith("/"):
if count is None:
count = 16

if not to_int(count) and count.startswith("/"):
count = to_int(count[1:])
count = count * 16 if count else None

if count is None:
count = 16
bytes = peda.dumpmem(address, address+count)
if bytes is None:
warning_msg("cannot retrieve memory content")
Expand Down

0 comments on commit d3b656e

Please sign in to comment.