mirror of
https://github.com/wiiu-env/MochaPayload.git
synced 2025-02-16 16:19:12 +01:00
Formatting
This commit is contained in:
parent
35f046172e
commit
f1b866f1ce
@ -133,7 +133,7 @@ typedef struct __attribute__((packed)) {
|
||||
uint32_t groupId;
|
||||
uint32_t cmdFlags;
|
||||
char argstr[4096];
|
||||
char* argv[64];
|
||||
char *argv[64];
|
||||
uint32_t max_size;
|
||||
uint32_t avail_size;
|
||||
uint32_t codegen_size;
|
||||
|
14
source/crt.c
14
source/crt.c
@ -1,18 +1,25 @@
|
||||
void __init_wut_malloc();
|
||||
|
||||
void __init_wut_newlib();
|
||||
|
||||
void __init_wut_stdcpp();
|
||||
|
||||
void __init_wut_devoptab();
|
||||
|
||||
void __attribute__((weak)) __init_wut_socket();
|
||||
|
||||
void __fini_wut_malloc();
|
||||
|
||||
void __fini_wut_newlib();
|
||||
|
||||
void __fini_wut_stdcpp();
|
||||
|
||||
void __fini_wut_devoptab();
|
||||
|
||||
void __attribute__((weak)) __fini_wut_socket();
|
||||
|
||||
void __attribute__((weak))
|
||||
__init_wut_()
|
||||
{
|
||||
__init_wut_() {
|
||||
__init_wut_malloc();
|
||||
__init_wut_newlib();
|
||||
__init_wut_stdcpp();
|
||||
@ -21,8 +28,7 @@ __init_wut_()
|
||||
}
|
||||
|
||||
void __attribute__((weak))
|
||||
__fini_wut_()
|
||||
{
|
||||
__fini_wut_() {
|
||||
__fini_wut_devoptab();
|
||||
__fini_wut_stdcpp();
|
||||
__fini_wut_newlib();
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <coreinit/cache.h>
|
||||
#include <coreinit/thread.h>
|
||||
#include <coreinit/ios.h>
|
||||
@ -349,11 +348,11 @@ int ExecuteIOSExploit() {
|
||||
int dummy[2];
|
||||
|
||||
dummy[0] = 0x050B817C;
|
||||
dummy[1] = *((uint32_t*) 0xF417FFF0);
|
||||
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);
|
||||
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
|
||||
|
@ -57,12 +57,12 @@ int FSA_Unmount(int fd, char *path, u32 flags) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int FSA_FlushVolume(int fd, char* volume_path) {
|
||||
u8* iobuf = allocIobuf();
|
||||
u32* inbuf = (u32*)iobuf;
|
||||
u32* outbuf = (u32*)&iobuf[0x520];
|
||||
int FSA_FlushVolume(int fd, char *volume_path) {
|
||||
u8 *iobuf = allocIobuf();
|
||||
u32 *inbuf = (u32 *) iobuf;
|
||||
u32 *outbuf = (u32 *) &iobuf[0x520];
|
||||
|
||||
strncpy((char*)&inbuf[0x01], volume_path, 0x27F);
|
||||
strncpy((char *) &inbuf[0x01], volume_path, 0x27F);
|
||||
|
||||
int ret = svcIoctl(fd, 0x1B, inbuf, 0x520, outbuf, 0x293);
|
||||
|
||||
|
@ -31,7 +31,7 @@ int FSA_Mount(int fd, char *device_path, char *volume_path, u32 flags, char *arg
|
||||
|
||||
int FSA_Unmount(int fd, char *path, u32 flags);
|
||||
|
||||
int FSA_FlushVolume(int fd, char* volume_path);
|
||||
int FSA_FlushVolume(int fd, char *volume_path);
|
||||
|
||||
int FSA_GetDeviceInfo(int fd, char *device_path, int type, u32 *out_data);
|
||||
|
||||
|
@ -110,8 +110,8 @@ static int ipc_ioctl(ipcmessage *message) {
|
||||
memcpy(arguments, message->ioctl.buffer_in + 1, (size_arguments < 8 * 4) ? size_arguments : (8 * 4));
|
||||
|
||||
// return error code as data
|
||||
message->ioctl.buffer_io[0] = ((int (*const)(u32, u32, u32, u32, u32, u32, u32, u32)) (MCP_SVC_BASE + svc_id * 8))(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6],
|
||||
arguments[7]);
|
||||
message->ioctl.buffer_io[0] = ((int (*const)(u32, u32, u32, u32, u32, u32, u32, u32)) (MCP_SVC_BASE + svc_id * 8))(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4],
|
||||
arguments[5], arguments[6], arguments[7]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -364,7 +364,7 @@ static int ipc_ioctl(ipcmessage *message) {
|
||||
}
|
||||
case IOCTL_FSA_FLUSHVOLUME: {
|
||||
int fd = message->ioctl.buffer_in[0];
|
||||
char *path = ((char *)message->ioctl.buffer_in) + message->ioctl.buffer_in[1];
|
||||
char *path = ((char *) message->ioctl.buffer_in) + message->ioctl.buffer_in[1];
|
||||
|
||||
message->ioctl.buffer_io[0] = FSA_FlushVolume(fd, path);
|
||||
break;
|
||||
|
@ -1,11 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wupserver.h"
|
||||
#include "ipc.h"
|
||||
#include "svc.h"
|
||||
#include "text.h"
|
||||
#include "../../common/kernel_commands.h"
|
||||
|
||||
static int threadsStarted = 0;
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "../../common/ipc_defs.h"
|
||||
#include "fsa.h"
|
||||
#include "svc.h"
|
||||
#include "utils.h"
|
||||
#include <string.h>
|
||||
|
||||
int (*const real_MCP_LoadFile)(ipcmessage *msg) = (void *) 0x0501CAA8 + 1; //+1 for thumb
|
||||
@ -62,12 +61,12 @@ int _MCP_LoadFile_patch(ipcmessage *msg) {
|
||||
int replace_fileoffset = rep_fileoffset;
|
||||
char *replace_path = rpxpath;
|
||||
|
||||
if(strlen(request->name) > 1 && request->name[strlen(request->name)-1] == 'x'){
|
||||
if (strlen(request->name) > 1 && request->name[strlen(request->name) - 1] == 'x') {
|
||||
if (strncmp(request->name, "safe.rpx", strlen("safe.rpx")) != 0) {
|
||||
//DEBUG_FUNCTION_LINE("set replace_valid to false\n");
|
||||
replace_valid = false;
|
||||
}else if(request->pos == 0){
|
||||
if(replace_valid){
|
||||
} else if (request->pos == 0) {
|
||||
if (replace_valid) {
|
||||
//DEBUG_FUNCTION_LINE("set doWantReplaceRPX to true\n");
|
||||
doWantReplaceRPX = true;
|
||||
}
|
||||
@ -95,7 +94,7 @@ int _MCP_LoadFile_patch(ipcmessage *msg) {
|
||||
replace_filesize = 0; // unknown
|
||||
replace_fileoffset = 0;
|
||||
}
|
||||
}else if(!doWantReplaceRPX){
|
||||
} else if (!doWantReplaceRPX) {
|
||||
doWantReplaceRPX = false; // Only replace it once.
|
||||
replace_path = NULL;
|
||||
return real_MCP_LoadFile(msg);
|
||||
@ -108,7 +107,7 @@ int _MCP_LoadFile_patch(ipcmessage *msg) {
|
||||
if (result >= 0) {
|
||||
return result;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE("replace_path was NULL\n");
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,8 @@ static int serverCommandHandler(u32 *command_buffer, u32 length) {
|
||||
|
||||
// return error code as data
|
||||
out_length = 8;
|
||||
command_buffer[1] = ((int (*const)(u32, u32, u32, u32, u32, u32, u32, u32)) (MCP_SVC_BASE + svc_id * 8))(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7]);
|
||||
command_buffer[1] = ((int (*const)(u32, u32, u32, u32, u32, u32, u32, u32)) (MCP_SVC_BASE + svc_id * 8))(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5],
|
||||
arguments[6], arguments[7]);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
@ -1,6 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#include <coreinit/cache.h>
|
||||
#include <coreinit/ios.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user