def unpack_pointer(elf, data, offset):
    endian_code = ('<' if elf.little_endian else '>')
    if (elf.elfclass == 32):
        size_code = 'I'
        size = 4
    else:
        size_code = 'Q'
        size = 8
    return struct.unpack((endian_code + size_code), data[offset:(offset + size)])[0]
def unpack_pointer(elf, data, offset):
    endian_code = ('<' if elf.little_endian else '>')
    if (elf.elfclass == 32):
        size_code = 'I'
        size = 4
    else:
        size_code = 'Q'
        size = 8
    return struct.unpack((endian_code + size_code), data[offset:(offset + size)])[0]