From 342c9b4b3b135c71d280d3d400b6901932bb24b5 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Sun, 9 Jan 2022 21:35:48 -0600 Subject: [PATCH] Add warning if Unlaunch isn't installed --- arm9/src/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arm9/src/main.c b/arm9/src/main.c index 4392a7e..1eade61 100644 --- a/arm9/src/main.c +++ b/arm9/src/main.c @@ -2,6 +2,7 @@ #include "menu.h" #include "message.h" #include "nand/nandio.h" +#include "storage.h" #include "version.h" #include @@ -123,6 +124,19 @@ int main(int argc, char **argv) return 0; } + for (char region = 'A'; region <= 'Z'; region++) + { + char path[64]; + sprintf(path, "nand:/title/00030017/484e41%02x/content/title.tmd", region); + unsigned long long tmdSize = getFileSizePath(path); + if (tmdSize != 0) + { + if (tmdSize <= 520) + messageBox("Unlaunch not found, please\ninstall it.\n\n\x1B[46mhttps://dsi.cfw.guide/\x1B[47m"); + break; + } + } + messageBox("\x1B[41mWARNING:\x1B[47m This tool can write to\nyour internal NAND!\n\nThis always has a risk, albeit\nlow, of \x1B[41mbricking\x1B[47m your system\nand should be done with caution!"); messageBox("Do not exit by holding POWER,\ntap it or choose \"Shut Down\".");