'Get headers information of debugged ELF file
Args:
- name: specific header name (String)
Returns:
- dictionary of headers {name(String): (start(Int), end(Int), type(String))}'

@memoized
def elfheader(self, name=None):

    elfinfo = {}
    elfbase = 0
    if self.getpid():
        binmap = self.get_vmmap('binary')
        elfbase = (binmap[0][0] if binmap else 0)
    out = self.execute_redirect('maintenance    info    sections')
    if (not out):
        return {}
    p = re.compile('\\s*(0x[^-]*)->(0x[^    ]*)    at    (0x[^:]*):\\s*([^    ]*)\\s*(.*)')
    matches = p.findall(out)
    for (start, end, offset, hname, attr) in matches:
        (start, end, offset) = (to_int(start), to_int(end), to_int(offset))
        if (start < offset):
            continue
        if (start < elfbase):
            start += elfbase
            end += elfbase
        if ('CODE' in attr):
            htype = 'code'
        elif ('READONLY' in attr):
            htype = 'rodata'
        else:
            htype = 'data'
        elfinfo[hname.strip()] = (start, end, htype)
    result = {}
    if (name is None):
        result = elfinfo
    elif (name in elfinfo):
        result[name] = elfinfo[name]
    else:
        for (k, v) in elfinfo.items():
            if (name in k):
                result[k] = v
    return result
