'Get virtual mapping address ranges of section(s) in debugged process
Usage:
MYNAME [mapname] (e.g binary, all, libc, stack)
MYNAME address (find mapname contains this address)
MYNAME (equiv to cat /proc/pid/maps)'

def vmmap(self, *arg):

    (mapname,) = normalize_argv(arg, 1)
    if (not self._is_running()):
        maps = peda.get_vmmap()
    elif (to_int(mapname) is None):
        maps = peda.get_vmmap(mapname)
    else:
        addr = to_int(mapname)
        maps = []
        allmaps = peda.get_vmmap()
        if (allmaps is not None):
            for (start, end, perm, name) in allmaps:
                if ((addr >= start) and (addr < end)):
                    maps += [(start, end, perm, name)]
    if ((maps is not None) and (len(maps) > 0)):
        l = (10 if (peda.intsize() == 4) else 18)
        msg(('%s    %s    %s DCTB %s' % ('Start'.ljust(l, '    '), 'End'.ljust(l, '    '), 'Perm', 'Name')), 'blue', 'bold')
        for (start, end, perm, name) in maps:
            color = ('red' if ('rwx' in perm) else None)
            msg(('%s    %s    %s DCTB %s' % (to_address(start).ljust(l, '    '), to_address(end).ljust(l, '    '), perm, name)), color)
    else:
        warning_msg('not    found    or    cannot    access    procfs')
    return
