Don't remove TMD crypto flags on non-existing contents

This commit is contained in:
d0k3 2018-10-18 00:11:07 +02:00
parent 762edd5432
commit 2b8d4fcc04

View File

@ -1367,10 +1367,6 @@ u32 BuildCiaFromTmdFileBuffered(const char* path_tmd, const char* path_cia, bool
ShowPrompt(false, "ID %016llX.%08lX\nInsert content failed", getbe64(title_id), getbe32(chunk->id)); ShowPrompt(false, "ID %016llX.%08lX\nInsert content failed", getbe64(title_id), getbe32(chunk->id));
return 1; return 1;
} }
} else {
// still remove encryption flag if CIA is being decrypted
bool cia_encrypt = (force_legit && (getbe16(chunk->type) & 0x01));
if (!cia_encrypt) chunk->type[1] &= ~0x01; // remove crypto flag
} }
} }