From cd8afd2cd831fa12f94e8fc1728de603dbfdd789 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Thu, 30 Jul 2020 16:01:26 -0400 Subject: [PATCH] Fixed gamecard key area template. --- code_templates/gc_key_area.c | 2 +- source/tik.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code_templates/gc_key_area.c b/code_templates/gc_key_area.c index 21e135f..55a0ed0 100644 --- a/code_templates/gc_key_area.c +++ b/code_templates/gc_key_area.c @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) consolePrint("get gamecard key area ok\n"); - sprintf(path, "sdmc:/card_key_area_%016lX.bin", gc_key_area.initial_data.package_id); + sprintf(path, "sdmc:/card_key_area_%016lX.bin", gc_key_area.initial_data.key_source.package_id); FILE *kafd = fopen(path, "wb"); if (!kafd) diff --git a/source/tik.c b/source/tik.c index 40fb415..fed43c1 100644 --- a/source/tik.c +++ b/source/tik.c @@ -90,6 +90,9 @@ bool tikRetrieveTicketByRightsId(Ticket *dst, const FsRightsId *id, bool use_gam if (tik_common_block && !memcmp(tik_common_block->rights_id.c, id->c, 0x10)) return true; } + /* Clear output ticket. */ + memset(dst, 0, sizeof(Ticket)); + bool tik_retrieved = (use_gamecard ? tikRetrieveTicketFromGameCardByRightsId(dst, id) : tikRetrieveTicketFromEsSaveDataByRightsId(dst, id)); if (!tik_retrieved) {