#include "../wumsloader/src/defines.h" #include "kernel.h" #include "utils/logger.h" #include #include #include extern "C" void __fini(); int main(int argc, char **argv) { initLogging(); std::string basePath = "fs:/vol/external01/wiiu"; if (argc >= 1) { basePath = argv[0]; } if (argc < 4 || std::string_view("EnvironmentLoader") != argv[1] || (uint32_t) argv[2] < 2 || (uint32_t) argv[3] == 0) { OSFatal("WUMSLoader:\n" "Failed to parse arguments! Make sure to use the latest\n" "version of the EnvironmentLoader.\n" "\n\n" "See https://wiiu.hacks.guide/ for instructions on how to update!"); } memcpy(reinterpret_cast(MEMORY_REGION_USABLE_MEM_REGION_END_VALUE_PTR), &argv[3], sizeof(uint32_t)); auto envBuffer = getEnvironmentStringBuffer(); snprintf(envBuffer.data(), envBuffer.size(), "%s", basePath.c_str()); DEBUG_FUNCTION_LINE("Setup wumsloader"); SetupWUMSLoader(); deinitLogging(); __fini(); return 0; }