mirror of
https://github.com/wiiu-env/MochaPayload.git
synced 2024-11-25 17:26:53 +01:00
Fix reloading IOSU (for example after exiting the system settings), override the default title id with Wii U Menu if IOSU is already patched
This commit is contained in:
parent
009086ed52
commit
48c093162b
@ -3,6 +3,7 @@
|
|||||||
#include <coreinit/cache.h>
|
#include <coreinit/cache.h>
|
||||||
#include <coreinit/thread.h>
|
#include <coreinit/thread.h>
|
||||||
#include <coreinit/ios.h>
|
#include <coreinit/ios.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include "ios_exploit.h"
|
#include "ios_exploit.h"
|
||||||
|
|
||||||
#define ALIGN4(x) (((x) + 3) & ~3)
|
#define ALIGN4(x) (((x) + 3) & ~3)
|
||||||
@ -343,9 +344,17 @@ static int uhs_write32(int dev_uhs_0_handle, int arm_addr, int val) {
|
|||||||
int ExecuteIOSExploit() {
|
int ExecuteIOSExploit() {
|
||||||
int iosuhaxFd = IOS_Open("/dev/iosuhax", 0);
|
int iosuhaxFd = IOS_Open("/dev/iosuhax", 0);
|
||||||
if (iosuhaxFd >= 0) {
|
if (iosuhaxFd >= 0) {
|
||||||
int dummy = 0;
|
|
||||||
|
|
||||||
//IOS_Ioctl(iosuhaxFd, 0x03, &dummy, sizeof(dummy), &dummy, sizeof(dummy));
|
// Write default title id.
|
||||||
|
int dummy[2];
|
||||||
|
|
||||||
|
dummy[0] = 0x050B817C;
|
||||||
|
dummy[1] = *((uint32_t*) 0xF417FFF0);
|
||||||
|
IOS_Ioctl(iosuhaxFd, 0x07, &dummy, sizeof(dummy), &dummy, sizeof(dummy)); // IOCTL_KERN_WRITE32
|
||||||
|
|
||||||
|
dummy[0] = 0x050B8180;
|
||||||
|
dummy[1] = *((uint32_t*) 0xF417FFF4);
|
||||||
|
IOS_Ioctl(iosuhaxFd, 0x07, &dummy, sizeof(dummy), &dummy, sizeof(dummy)); // IOCTL_KERN_WRITE32
|
||||||
|
|
||||||
//! do not run patches again as that will most likely crash
|
//! do not run patches again as that will most likely crash
|
||||||
//! because the wupserver and the iosuhax dev node are still running
|
//! because the wupserver and the iosuhax dev node are still running
|
||||||
|
Loading…
Reference in New Issue
Block a user