From b971891f28a76bece4572318e32e10eb98f1127f Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 18 Nov 2019 11:36:27 +0100 Subject: [PATCH] Fix intended crash when now hook_payload.elf was found on the sd card. Update the error message --- source/elf_loading.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/elf_loading.c b/source/elf_loading.c index b7e25cf..138f890 100644 --- a/source/elf_loading.c +++ b/source/elf_loading.c @@ -26,7 +26,7 @@ int32_t LoadFileToMem(const char *relativefilepath, char **fileOut, uint32_t * s WHBLogPrintf("Loading file %s.",path); *fileOut = WHBReadWholeFile(path, sizeOut); - if (!fileOut) { + if (!(*fileOut)) { result = -2; WHBLogPrintf("WHBReadWholeFile(%s) returned NULL", path); goto exit; @@ -41,7 +41,7 @@ uint32_t load_loader_elf(unsigned char* baseAddress, const char* relativePath) { char * elf_data = NULL; uint32_t fileSize = 0; if(LoadFileToMem(relativePath, &elf_data, &fileSize) != 0) { - OSFatal("Failed to load hook elf from SD."); + OSFatal("Failed to load hook_payload.elf from the SD Card."); } Elf32_Ehdr *ehdr;