From 3e59d15bc42861378973de75588c17797ef0793e Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sat, 10 Oct 2020 06:10:50 -0400 Subject: [PATCH] Minor template tweaks + LegalInfo fix. --- Makefile | 4 ++++ build.sh | 4 ++-- code_templates/system_title_dumper.c | 11 +++++++++-- .../{threaded_usb_gc_dumper.c => usb_gc_dumper.c} | 0 ...threaded_usb_romfs_dumper.c => usb_romfs_dumper.c} | 3 ++- code_templates/xml_generator.c | 3 ++- source/legal_info.c | 3 +++ 7 files changed, 22 insertions(+), 6 deletions(-) rename code_templates/{threaded_usb_gc_dumper.c => usb_gc_dumper.c} (100%) rename code_templates/{threaded_usb_romfs_dumper.c => usb_romfs_dumper.c} (99%) diff --git a/Makefile b/Makefile index 4f78bd5..3b8f277 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,10 @@ APP_TITLE := nxdumptool-rewrite APP_AUTHOR := DarkMatterCore APP_VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO} +ifneq ($(origin BUILD_TYPE),undefined) +APP_VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}-${BUILD_TYPE} +endif + TARGET := ${APP_TITLE} BUILD := build SOURCES := source source/fatfs diff --git a/build.sh b/build.sh index 8a3ac09..adff5e4 100644 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")" tar_filename="nxdumptool-rewrite_poc_$(shell git rev-parse --short HEAD).tar.bz2" -rm -f $tar_filename +rm -f ./*.tar.bz2 rm -rf ./code_templates/tmp mkdir ./code_templates/tmp @@ -23,7 +23,7 @@ for f in ./code_templates/*.c; do { make clean - make -j 12 + make -j 12 BUILD_TYPE="$filename" } mkdir ./code_templates/tmp/$filename diff --git a/code_templates/system_title_dumper.c b/code_templates/system_title_dumper.c index e76fc58..0153844 100644 --- a/code_templates/system_title_dumper.c +++ b/code_templates/system_title_dumper.c @@ -284,8 +284,14 @@ int main(int argc, char *argv[]) printf("select a %s.", menu == 0 ? "system title to view its contents" : (menu == 1 ? "content" : "fs section")); printf("\npress b to %s.\n\n", menu == 0 ? "exit" : "go back"); - if (menu == 0) printf("title: %u / %u\n\n", selected_idx + 1, app_count); + if (menu == 0) + { + printf("title: %u / %u\n", selected_idx + 1, app_count); + printf("selected title: %016lX - %s\n\n", app_metadata[selected_idx]->title_id, app_metadata[selected_idx]->lang_entry.name); + } + if (menu >= 1) printf("selected title: %016lX - %s\n\n", app_metadata[title_idx]->title_id, app_metadata[title_idx]->lang_entry.name); + if (menu == 2) printf("selected content: %s (%s)\n\n", nca_id_str, titleGetNcmContentTypeName(cur_title_info->content_infos[nca_idx].content_type)); u32 max_val = (menu == 0 ? app_count : (menu == 1 ? cur_title_info->content_count : NCA_FS_HEADER_COUNT)); @@ -366,7 +372,8 @@ int main(int argc, char *argv[]) if (error || menu >= 3) { - utilsSleep(3); + consolePrint("press any button to continue\n"); + utilsWaitForButtonPress(KEY_NONE); menu--; } else { selected_idx = scroll = 0; diff --git a/code_templates/threaded_usb_gc_dumper.c b/code_templates/usb_gc_dumper.c similarity index 100% rename from code_templates/threaded_usb_gc_dumper.c rename to code_templates/usb_gc_dumper.c diff --git a/code_templates/threaded_usb_romfs_dumper.c b/code_templates/usb_romfs_dumper.c similarity index 99% rename from code_templates/threaded_usb_romfs_dumper.c rename to code_templates/usb_romfs_dumper.c index e353ad6..9728777 100644 --- a/code_templates/threaded_usb_romfs_dumper.c +++ b/code_templates/usb_romfs_dumper.c @@ -378,7 +378,8 @@ int main(int argc, char *argv[]) { consoleClear(); printf("select an user application to dump its romfs.\nif an update is available, patch romfs data will be dumped instead.\ndata will be transferred via usb.\npress b to exit.\n\n"); - printf("title: %u / %u\n\n", selected_idx + 1, app_count); + printf("title: %u / %u\n", selected_idx + 1, app_count); + printf("selected title: %016lX - %s\n\n", app_metadata[selected_idx]->title_id, app_metadata[selected_idx]->lang_entry.name); for(u32 i = scroll; i < app_count; i++) { diff --git a/code_templates/xml_generator.c b/code_templates/xml_generator.c index 18f05f5..b7183f5 100644 --- a/code_templates/xml_generator.c +++ b/code_templates/xml_generator.c @@ -85,7 +85,8 @@ int main(int argc, char *argv[]) { consoleClear(); printf("select an user application to generate a cnmt xml for.\npress b to exit.\n\n"); - printf("title: %u / %u\n\n", selected_idx + 1, app_count); + printf("title: %u / %u\n", selected_idx + 1, app_count); + printf("selected title: %016lX - %s\n\n", app_metadata[selected_idx]->title_id, app_metadata[selected_idx]->lang_entry.name); for(u32 i = scroll; i < app_count; i++) { diff --git a/source/legal_info.c b/source/legal_info.c index f7863fa..df205a4 100644 --- a/source/legal_info.c +++ b/source/legal_info.c @@ -78,6 +78,9 @@ bool legalInfoInitializeContext(LegalInfoContext *out, NcaContext *nca_ctx) goto end; } + /* Update NCA context pointer in output context. */ + out->nca_ctx = nca_ctx; + success = true; end: