<gh_stars>1-10
def parse_section_header_64(bytes):
    sh_name = bytes[0:4]
    sh_type = bytes[4:8]
    sh_flags = bytes[8:16]
    sh_addr = bytes[16:24]
    sh_offset = bytes[24:32]
    sh_size = bytes[32:40]
    sh_link = bytes[40:44]
    sh_info = bytes[44:48]
    sh_addralign = bytes[48:56]
    sh_entsize = bytes[56:64]
    return {'sh_name': sh_name,
            'sh_type': sh_type,
            'sh_flags': sh_flags,
            'sh_addr': sh_addr,
            'sh_offset': sh_offset,
            'sh_size': sh_size,
            'sh_link': sh_link,
            'sh_info': sh_info,
            'sh_addralign': sh_addralign,
            'sh_ent_size': sh_entsize,
            }


def parse_section_header(bytes, byte_size):
    """Parse the section header, based on byte_size. Either 32 or 64."""
    if byte_size == 64:
        return parse_section_header_64(bytes)
    elif byte_size == 32:
        raise NotImplementedError
    else:
        raise ValueError


def get_sh_type(sh_type):
    """Get the section header type."""
    if sh_type == 0:
        return 'SHT_NULL'
    elif sh_type == 1:
        return 'SHT_PROGBITS'
    elif sh_type == 2:
        return 'SHT_SYMTAB'
    elif sh_type == 3:
        return 'SHT_STRTAB'
    elif sh_type == 4:
        return 'SHT_RELA'
    elif sh_type == 5:
        return 'SHT_HASH'
    elif sh_type == 6:
        return 'SHT_DYNAMIC'
    elif sh_type == 7:
        return 'SHT_NOTE'
    elif sh_type == 8:
        return 'SHT_NOBITS'
    elif sh_type == 9:
        return 'SHT_REL'
    elif sh_type == 10:
        return 'SHT_SHLIB'
    elif sh_type == 11:
        return 'SHT_DYNSYM'
    elif sh_type == 14:
        return 'SHT_INIT_ARRAY'
    elif sh_type == 15:
        return 'SHT_FINI_ARRAY'
    elif sh_type == 16:
        return 'SHT_PREINIT_ARRAY'
    elif sh_type == 17:
        return 'SHT_GROUP'
    elif sh_type == 18:
        return 'SHT_SYMTAB_SHNDX'
    elif sh_type == 19:
        return 'SHT_NUM'
    elif sh_type == 1610612736:
        return 'SHT_LOOS'
    else:
        print('Unable to match {} to a sh_type.'.format(sh_type))
        raise ValueError
