From ed127ca84dd876d7ef808b24248b623d123af3b7 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 16 Jan 2021 23:03:33 +0100 Subject: [PATCH] Try to save to .wuhb to temp2.wuhb if temp.wuhb is currently mounted --- src/utils/TcpReceiver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/TcpReceiver.cpp b/src/utils/TcpReceiver.cpp index 6f250e5..ec0f918 100644 --- a/src/utils/TcpReceiver.cpp +++ b/src/utils/TcpReceiver.cpp @@ -22,8 +22,10 @@ #define RPX_TEMP_PATH "fs:/vol/external01/wiiu/apps/" #define RPX_TEMP_FILE "fs:/vol/external01/wiiu/apps/temp.rpx" #define WUHB_TEMP_FILE "fs:/vol/external01/wiiu/apps/temp.wuhb" +#define WUHB_TEMP_FILE_2 "fs:/vol/external01/wiiu/apps/temp2.wuhb" #define RPX_TEMP_FILE_EX "wiiu/apps/temp.rpx" #define WUHB_TEMP_FILE_EX "wiiu/apps/temp.wuhb" +#define WUHB_TEMP_FILE_2_EX "wiiu/apps/temp2.wuhb" extern "C" { uint64_t _SYSGetSystemApplicationTitleId(int32_t); @@ -230,6 +232,12 @@ int32_t TcpReceiver::loadToMemory(int32_t clientSocket, uint32_t ipAddress) { FSUtils::CreateSubfolder(RPX_TEMP_PATH); res = FSUtils::saveBufferToFile(WUHB_TEMP_FILE, inflatedData, fileSize); file_path = WUHB_TEMP_FILE_EX; + if(!res){ + // temp.wuhb might be mounted, let's try temp2.wuhb + res = FSUtils::saveBufferToFile(WUHB_TEMP_FILE_2, inflatedData, fileSize); + file_path = WUHB_TEMP_FILE_2_EX; + } + loadedRPX = true; } else if (inflatedData[0x7] == 0xCA && inflatedData[0x8] == 0xFE && inflatedData[0x9] != 0x50 && inflatedData[0xA] != 0x4C) { DEBUG_FUNCTION_LINE("Try to load a .rpx");