index-pack: factor out unpack core from get_data_from_pack