mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 05:32:47 +00:00
Allow building "pirate legit" CIAs (TMD & encryption intact)
This commit is contained in:
parent
73dc54a754
commit
a7ce125d7f
@ -1360,21 +1360,32 @@ u32 BuildCiaFromTmdFileBuffered(const char* path_tmd, const char* path_cia, bool
|
|||||||
bool src_emunand = ((*path_tmd == 'B') || (*path_tmd == '4'));
|
bool src_emunand = ((*path_tmd == 'B') || (*path_tmd == '4'));
|
||||||
if (force_legit) {
|
if (force_legit) {
|
||||||
Ticket* ticket_tmp = NULL;
|
Ticket* ticket_tmp = NULL;
|
||||||
|
bool copy = true;
|
||||||
if ((cdn && (LoadCdnTicketFile(&ticket_tmp, path_tmd) != 0)) ||
|
if ((cdn && (LoadCdnTicketFile(&ticket_tmp, path_tmd) != 0)) ||
|
||||||
(!cdn && (FindTicket(&ticket_tmp, title_id, true, src_emunand) != 0))) {
|
(!cdn && (FindTicket(&ticket_tmp, title_id, true, src_emunand) != 0))) {
|
||||||
ShowPrompt(false, "ID %016llX\nLegit ticket not found.", getbe64(title_id));
|
static bool use_generic = false;
|
||||||
free(ticket_tmp);
|
if (!use_generic) {
|
||||||
return 1;
|
use_generic = ShowPrompt(true, "ID %016llX\nLegit ticket not found.\n \nFallback to generic as default?", getbe64(title_id));
|
||||||
|
if (!use_generic) {
|
||||||
|
free(ticket_tmp);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
ShowProgress(0, 0, path_tmd);
|
||||||
|
}
|
||||||
|
if (use_generic) {
|
||||||
|
FindTitleKey(ticket, title_id);
|
||||||
|
copy = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// either, it's a ticket without ways to check ownership data, smaller sized
|
// either, it's a ticket without ways to check ownership data, smaller sized
|
||||||
// or, it's title ticket with > 1024 contents, of which can't make it work with current CiaStub
|
// or, it's title ticket with > 1024 contents, of which can't make it work with current CiaStub
|
||||||
if (GetTicketSize(ticket_tmp) != TICKET_COMMON_SIZE) {
|
if (copy && GetTicketSize(ticket_tmp) != TICKET_COMMON_SIZE) {
|
||||||
ShowPrompt(false, "ID %016llX\nLegit ticket of unsupported size.", getbe64(title_id));
|
ShowPrompt(false, "ID %016llX\nLegit ticket of unsupported size.", getbe64(title_id));
|
||||||
free(ticket_tmp);
|
free(ticket_tmp);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
bool copy = true;
|
// check the tickets' console id, warn if it isn't zero
|
||||||
if (getbe32(ticket_tmp->console_id)) {
|
if (copy && getbe32(ticket_tmp->console_id)) {
|
||||||
static u32 default_action = 0;
|
static u32 default_action = 0;
|
||||||
const char* optionstr[2] =
|
const char* optionstr[2] =
|
||||||
{"Use personalized ticket (legit)", "Use generic ticket (not legit)"};
|
{"Use personalized ticket (legit)", "Use generic ticket (not legit)"};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user