mirror of
https://github.com/wiiu-env/PayloadFromRPX.git
synced 2024-11-24 06:29:15 +01:00
Formatting
This commit is contained in:
parent
235642bab3
commit
73c8cfed10
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <cstdint>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include <coreinit/memorymap.h>
|
#include <coreinit/memorymap.h>
|
||||||
#include <whb/log.h>
|
#include <whb/log.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
#include <utils/logger.h>
|
#include <utils/logger.h>
|
||||||
#include "ElfUtils.h"
|
#include "ElfUtils.h"
|
||||||
#include "gx2sploit.h"
|
#include "gx2sploit.h"
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
extern void __KERNEL_CODE_START(void);
|
extern void __KERNEL_CODE_START(void);
|
||||||
|
|
||||||
extern void __KERNEL_CODE_END(void);
|
extern void __KERNEL_CODE_END(void);
|
||||||
|
|
||||||
void kernel_launch_ios(u32 launch_address, u32 L, u32 C, u32 H) {
|
void kernel_launch_ios(u32 launch_address, u32 L, u32 C, u32 H) {
|
||||||
|
@ -33,23 +33,20 @@
|
|||||||
#define enable_interrupts ((int(*)(int))0x0812E78C)
|
#define enable_interrupts ((int(*)(int))0x0812E78C)
|
||||||
#define kernel_bsp_command_5 ((int (*)(const char*, int offset, const char*, int size, void *buffer))0x0812EC40)
|
#define kernel_bsp_command_5 ((int (*)(const char*, int offset, const char*, int size, void *buffer))0x0812EC40)
|
||||||
|
|
||||||
void reverse_memcpy(void* dest, const void* src, unsigned int size);
|
void reverse_memcpy(void *dest, const void *src, unsigned int size);
|
||||||
|
|
||||||
static inline unsigned int disable_mmu(void)
|
static inline unsigned int disable_mmu(void) {
|
||||||
{
|
|
||||||
unsigned int control_register = 0;
|
unsigned int control_register = 0;
|
||||||
asm volatile("MRC p15, 0, %0, c1, c0, 0" : "=r" (control_register));
|
asm volatile("MRC p15, 0, %0, c1, c0, 0" : "=r" (control_register));
|
||||||
asm volatile("MCR p15, 0, %0, c1, c0, 0" : : "r" (control_register & 0xFFFFEFFA));
|
asm volatile("MCR p15, 0, %0, c1, c0, 0" : : "r" (control_register & 0xFFFFEFFA));
|
||||||
return control_register;
|
return control_register;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void restore_mmu(unsigned int control_register)
|
static inline void restore_mmu(unsigned int control_register) {
|
||||||
{
|
|
||||||
asm volatile("MCR p15, 0, %0, c1, c0, 0" : : "r" (control_register));
|
asm volatile("MCR p15, 0, %0, c1, c0, 0" : : "r" (control_register));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void set_domain_register(unsigned int domain_register)
|
static inline void set_domain_register(unsigned int domain_register) {
|
||||||
{
|
|
||||||
asm volatile("MCR p15, 0, %0, c3, c0, 0" : : "r" (domain_register));
|
asm volatile("MCR p15, 0, %0, c3, c0, 0" : : "r" (domain_register));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
#include <coreinit/time.h>
|
#include <coreinit/time.h>
|
||||||
|
|
||||||
#include <coreinit/foreground.h>
|
#include <coreinit/foreground.h>
|
||||||
@ -48,7 +48,7 @@ bool CheckRunning() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void _SYSLaunchMenuWithCheckingAccount(nn::act::SlotNo slot);
|
extern "C" void _SYSLaunchMenuWithCheckingAccount(nn::act::SlotNo slot);
|
||||||
extern "C" void SYSLaunchMiiStudio(void * SysMiiStudioArgs);
|
extern "C" void SYSLaunchMiiStudio(void *SysMiiStudioArgs);
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
WHBLogUdpInit();
|
WHBLogUdpInit();
|
||||||
@ -60,7 +60,7 @@ int main(int argc, char **argv) {
|
|||||||
VPADRead(VPAD_CHAN_0, &vpad_data, 1, &err);
|
VPADRead(VPAD_CHAN_0, &vpad_data, 1, &err);
|
||||||
|
|
||||||
uint32_t btn = 0;
|
uint32_t btn = 0;
|
||||||
if(err == VPAD_READ_SUCCESS){
|
if (err == VPAD_READ_SUCCESS) {
|
||||||
btn = vpad_data.hold | vpad_data.trigger;
|
btn = vpad_data.hold | vpad_data.trigger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,10 +94,10 @@ int main(int argc, char **argv) {
|
|||||||
if (entryPoint != 0) {
|
if (entryPoint != 0) {
|
||||||
DEBUG_FUNCTION_LINE("New entrypoint at %08X", entryPoint);
|
DEBUG_FUNCTION_LINE("New entrypoint at %08X", entryPoint);
|
||||||
|
|
||||||
char* arr[3];
|
char *arr[3];
|
||||||
arr[0] = argv[0];
|
arr[0] = argv[0];
|
||||||
arr[1] = (char*) "void forceDefaultTitleIDToWiiUMenu(void)";
|
arr[1] = (char *) "void forceDefaultTitleIDToWiiUMenu(void)";
|
||||||
arr[2] = (char*)&forceDefaultTitleIDToWiiUMenu;
|
arr[2] = (char *) &forceDefaultTitleIDToWiiUMenu;
|
||||||
|
|
||||||
int res = ((int (*)(int, char **)) entryPoint)(3, arr);
|
int res = ((int (*)(int, char **)) entryPoint)(3, arr);
|
||||||
if (res >= 0) {
|
if (res >= 0) {
|
||||||
@ -155,7 +155,7 @@ void forceDefaultTitleIDToWiiUMenu() {// Restore the default title id to the nor
|
|||||||
|
|
||||||
|
|
||||||
void SplashScreen(int32_t durationInMs) {
|
void SplashScreen(int32_t durationInMs) {
|
||||||
int32_t screen_buf0_size = 0;
|
uint32_t screen_buf0_size;
|
||||||
|
|
||||||
// Init screen and screen buffers
|
// Init screen and screen buffers
|
||||||
OSScreenInit();
|
OSScreenInit();
|
||||||
|
Loading…
Reference in New Issue
Block a user