diff --git a/ctrtool/exefs.c b/ctrtool/exefs.c index a4dce90..d6d6c59 100644 --- a/ctrtool/exefs.c +++ b/ctrtool/exefs.c @@ -129,7 +129,7 @@ void exefs_save(exefs_context* ctx, u32 index, u32 flags) ctr_init_counter(&ctx->aes, ctx->key, ctx->counter); ctr_add_counter(&ctx->aes, offset / 0x10); - if (index == 0 && ctx->compressedflag && ((flags & RawFlag) == 0)) + if (strncmp(name,".code",5) == 0 && ctx->compressedflag && ((flags & RawFlag) == 0)) { fprintf(stdout, "Decompressing section %s to %s...\n", name, outfname); diff --git a/ctrtool/ncch.c b/ctrtool/ncch.c index 1a0f974..1e6c60a 100644 --- a/ctrtool/ncch.c +++ b/ctrtool/ncch.c @@ -366,7 +366,7 @@ void ncch_process(ncch_context* ctx, u32 actions) result = exheader_process(&ctx->exheader, actions); } - if (result && ncch_get_exheader_size(ctx)) + if (result && ncch_get_exefs_size(ctx)) { exefs_set_compressedflag(&ctx->exefs, exheader_get_compressedflag(&ctx->exheader)); exefs_process(&ctx->exefs, actions);