mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Take over title version when building CIA from NCSD
This commit is contained in:
parent
182f1ebe43
commit
2793daa55f
@ -1619,6 +1619,16 @@ u32 BuildCiaFromNcsdFile(const char* path_ncsd, const char* path_cia) {
|
||||
cia->header.size_meta = CIA_META_SIZE;
|
||||
if (meta) free(meta);
|
||||
|
||||
// update title version from cart header (yeah, that's a bit hacky)
|
||||
u16 title_version;
|
||||
if (fvx_qread(path_ncsd, &title_version, 0x310, 2, NULL) == FR_OK) {
|
||||
u8 title_version_le[2];
|
||||
title_version_le[0] = (title_version >> 8) & 0xFF;
|
||||
title_version_le[1] = title_version & 0xFF;
|
||||
memcpy((cia->tmd).title_version, title_version_le, 2);
|
||||
memcpy((cia->ticket).ticket_version, title_version_le, 2);
|
||||
}
|
||||
|
||||
// write the CIA stub (take #2)
|
||||
FindTitleKey((Ticket*)&(cia->ticket), title_id);
|
||||
if ((FixTmdHashes(&(cia->tmd)) != 0) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user