Fix mounting incomplete DLC CIAs

This commit is contained in:
d0k3 2018-10-16 01:00:03 +02:00
parent f58bb6e61b
commit 762edd5432

View File

@ -434,12 +434,16 @@ bool BuildVGameCiaDir(void) {
TmdContentChunk* content_list = cia->content_list;
u32 content_count = getbe16(cia->tmd.content_count);
u64 next_offset = info.offset_content;
u8* cnt_index = cia->header.content_index;
for (u32 i = 0; (i < content_count) && (i < TMD_MAX_CONTENTS); i++) {
const u16 index = getbe16(content_list[i].index);
const u32 id = getbe32(content_list[i].id);
const u64 size = getbe64(content_list[i].size);
const u32 keyslot = (getbe16(content_list[i].type) & 0x1) ? index : (u32) -1;
if (!(cnt_index[index/8] & (1 << (7-(index%8)))))
continue; // skip missing contents
u32 cnt_type = 0;
if (size >= 0x200) {
u8 header[0x200];