From 375a0b3fa81b4874ec1c1574ff86ba1ad05c3805 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 11 Apr 2018 22:10:02 -0600 Subject: [PATCH] Fusee: Actually write SD path in stratosphere_merge_inis --- fusee/fusee-secondary/src/lib/vsprintf.h | 1 + fusee/fusee-secondary/src/stratosphere.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/fusee/fusee-secondary/src/lib/vsprintf.h b/fusee/fusee-secondary/src/lib/vsprintf.h index 9399969bd..8a7085dca 100644 --- a/fusee/fusee-secondary/src/lib/vsprintf.h +++ b/fusee/fusee-secondary/src/lib/vsprintf.h @@ -20,6 +20,7 @@ struct va_format { unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base); int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); +int snprintf(char *buf, size_t size, const char *fmt, ...); int sscanf(const char *buf, const char *fmt, ...); #endif /* VSPRINTF_H */ diff --git a/fusee/fusee-secondary/src/stratosphere.c b/fusee/fusee-secondary/src/stratosphere.c index cb0544241..25a2f2f43 100644 --- a/fusee/fusee-secondary/src/stratosphere.c +++ b/fusee/fusee-secondary/src/stratosphere.c @@ -3,6 +3,7 @@ #include "stratosphere.h" #include "sd_utils.h" #include "lib/printk.h" +#include "lib/vsprintf.h" unsigned char g_stratosphere_ini1[PACKAGE2_SIZE_MAX]; static bool g_initialized_stratosphere_ini1 = false; @@ -69,6 +70,9 @@ void stratosphere_merge_inis(void *dst, ini1_header_t **inis, unsigned int num_i continue; } + /* TODO: What folder should these be read out of? */ + snprintf(sd_path, sizeof(sd_path), "atmosph\xe8re/titles/%016llx/%016llx.kip", current_kip->title_id, current_kip->title_id); + /* Try to load an override KIP from SD, if possible. */ if (read_sd_file(current_dst_kip, remaining_size, sd_path)) { kip1_header_t *sd_kip = (kip1_header_t *)(current_dst_kip);