From 8137a76d207223b1d96b154ee66de747b4e3c71d Mon Sep 17 00:00:00 2001 From: Pk11 Date: Tue, 11 Oct 2022 23:22:24 -0500 Subject: [PATCH] Fix app versions over 000000ff it's actually a big endian u32, and dev consoles use that --- arm9/src/titlemenu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arm9/src/titlemenu.c b/arm9/src/titlemenu.c index 0967d90..e844511 100644 --- a/arm9/src/titlemenu.c +++ b/arm9/src/titlemenu.c @@ -354,16 +354,16 @@ static void backup(Menu* m) FILE *tmd = fopen(path, "rb"); if (tmd) { - u8 appVersion; - fseek(tmd, 0x1E7, SEEK_SET); - fread(&appVersion, sizeof(appVersion), 1, tmd); + u8 appVersion[4]; + fseek(tmd, 0x1E4, SEEK_SET); + fread(&appVersion, 1, 4, tmd); fclose(tmd); iprintf("%s -> \n%s...\n", path, dstpath); copyFile(path, dstpath); //app - sprintf(path, "%s/content/000000%02x.app", srcpath, appVersion); + sprintf(path, "%s/content/%02x%02x%02x%02x.app", srcpath, appVersion[0], appVersion[1], appVersion[2], appVersion[3]); sprintf(dstpath, "%s/%s.nds", BACKUP_PATH, backname); if (access(path, F_OK) == 0) {