diff --git a/wumsloader/src/entry.cpp b/wumsloader/src/entry.cpp index 7b36a2c..a6e10a9 100644 --- a/wumsloader/src/entry.cpp +++ b/wumsloader/src/entry.cpp @@ -11,6 +11,7 @@ #include "utils/utils.h" #include "version.h" #include +#include #include #include #include @@ -43,6 +44,14 @@ extern "C" int _start(int argc, char **argv) { doStart(argc, argv); } + KernelInfo0 kernelInfo0; + __KernelGetInfo0(&kernelInfo0, 0); + asm( + "mr 13,%0\n" + "mr 2,%1\n" ::"r"(kernelInfo0.sdaBase), + "r"(kernelInfo0.sda2Base) + :); + return ((int (*)(int, char **))(*(unsigned int *) 0x1005E040))(argc, argv); } diff --git a/wumsloader/src/utils/imports.h b/wumsloader/src/utils/imports.h index db0f9cd..8087c91 100644 --- a/wumsloader/src/utils/imports.h +++ b/wumsloader/src/utils/imports.h @@ -34,6 +34,7 @@ IMPORT(OSSignalCond); IMPORT(OSSwapAtomic); IMPORT(OSDynLoad_GetAllocator); IMPORT(OSDynLoad_SetAllocator); +IMPORT(__KernelGetInfo); IMPORT(FSTimeToCalendarTime); IMPORT(FSInit);