'Get headers information from an ELF file
Usage:
MYNAME mapname [header_name]
MYNAME filename [header_name]'

def readelf(self, *arg):

    (filename, hname) = normalize_argv(arg, 2)
    result = {}
    maps = peda.get_vmmap()
    if (filename is None):
        result = peda.elfheader()
    else:
        result = peda.elfheader_solib(filename, hname)
    if (not result):
        result = peda.readelf_header(filename, hname)
    if (len(result) == 0):
        warning_msg(('%s    or    %s    not    found' % (filename, hname)))
    elif (len(result) == 1):
        (k, (start, end, type)) = list(result.items())[0]
        msg(('%s:    0x%x    -    0x%x    (%s)' % (k, start, end, type)))
    else:
        for (k, (start, end, type)) in sorted(result.items(), key=(lambda x: x[1])):
            msg(('%s    =    0x%x' % (k, start)))
    return
