'Display hex/ascii dump of data in memory
Usage:
MYNAME address (dump 16 bytes from address)
MYNAME address count
MYNAME address /count (dump "count" lines, 16-bytes each)'

def hexdump(self, *arg):

    def ascii_char(ch):
        if ((ord(ch) >= 32) and (ord(ch) < 126)):
            return chr(ord(ch))
        else:
            return '.'
    (address, count) = normalize_argv(arg, 2)
    if (address is None):
        self._missing_argument()
    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)
    bytes_ = peda.dumpmem(address, (address + count))
    if (bytes_ is None):
        warning_msg('cannot    retrieve    memory    content')
    else:
        linelen = 16
        i = 0
        text = ''
        while bytes_:
            buf = bytes_[:linelen]
            hexbytes = '    '.join([('%02x' % ord(c)) for c in bytes_iterator(buf)])
            asciibytes = ''.join([ascii_char(c) for c in bytes_iterator(buf)])
            text += ('%s    :    %s        %s\n' % (blue(to_address((address + (i * linelen)))), hexbytes.ljust((linelen * 3)), asciibytes))
            bytes_ = bytes_[linelen:]
            i += 1
        pager(text)
    return
