mirror of
https://github.com/wiiu-env/PayloadFromRPX.git
synced 2024-11-27 23:54:13 +01:00
Formatting
This commit is contained in:
parent
235642bab3
commit
73c8cfed10
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <coreinit/memorymap.h>
|
||||
#include <whb/log.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <utils/logger.h>
|
||||
#include "ElfUtils.h"
|
||||
#include "gx2sploit.h"
|
||||
|
@ -41,7 +41,7 @@ void instant_patches_setup(void) {
|
||||
*(volatile u32 *) (0xe22830e0 - 0xe2280000 + 0x13140000) = 0x00000000;
|
||||
*(volatile u32 *) (0xe22b2a78 - 0xe2280000 + 0x13140000) = 0x00000000;
|
||||
*(volatile u32 *) (0xe204fb68 - 0xe2000000 + 0x12EC0000) = 0xe3a00000;
|
||||
|
||||
|
||||
// Keep update patches
|
||||
*(volatile u32 *) 0x0812A120 = ARM_BL(0x0812A120, kernel_launch_ios);
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "utils.h"
|
||||
|
||||
extern void __KERNEL_CODE_START(void);
|
||||
|
||||
extern void __KERNEL_CODE_END(void);
|
||||
|
||||
void kernel_launch_ios(u32 launch_address, u32 L, u32 C, u32 H) {
|
||||
@ -51,7 +52,7 @@ void kernel_launch_ios(u32 launch_address, u32 L, u32 C, u32 H) {
|
||||
void kernel_run_patches(u32 ios_elf_start) {
|
||||
section_write(ios_elf_start, (u32) __KERNEL_CODE_START, __KERNEL_CODE_START, __KERNEL_CODE_END - __KERNEL_CODE_START);
|
||||
section_write_word(ios_elf_start, 0x0812A120, ARM_BL(0x0812A120, kernel_launch_ios));
|
||||
|
||||
|
||||
// update check
|
||||
section_write_word(ios_elf_start, 0xe22830e0, 0x00000000);
|
||||
section_write_word(ios_elf_start, 0xe22b2a78, 0x00000000);
|
||||
|
@ -33,24 +33,21 @@
|
||||
#define enable_interrupts ((int(*)(int))0x0812E78C)
|
||||
#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)
|
||||
{
|
||||
unsigned int control_register = 0;
|
||||
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));
|
||||
return control_register;
|
||||
static inline unsigned int disable_mmu(void) {
|
||||
unsigned int control_register = 0;
|
||||
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));
|
||||
return control_register;
|
||||
}
|
||||
|
||||
static inline void restore_mmu(unsigned int control_register)
|
||||
{
|
||||
asm volatile("MCR p15, 0, %0, c1, c0, 0" : : "r" (control_register));
|
||||
static inline void restore_mmu(unsigned int control_register) {
|
||||
asm volatile("MCR p15, 0, %0, c1, c0, 0" : : "r" (control_register));
|
||||
}
|
||||
|
||||
static inline void set_domain_register(unsigned int domain_register)
|
||||
{
|
||||
asm volatile("MCR p15, 0, %0, c3, c0, 0" : : "r" (domain_register));
|
||||
static inline void set_domain_register(unsigned int domain_register) {
|
||||
asm volatile("MCR p15, 0, %0, c3, c0, 0" : : "r" (domain_register));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <coreinit/time.h>
|
||||
|
||||
#include <coreinit/foreground.h>
|
||||
@ -48,7 +48,7 @@ bool CheckRunning() {
|
||||
}
|
||||
|
||||
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) {
|
||||
WHBLogUdpInit();
|
||||
@ -60,10 +60,10 @@ int main(int argc, char **argv) {
|
||||
VPADRead(VPAD_CHAN_0, &vpad_data, 1, &err);
|
||||
|
||||
uint32_t btn = 0;
|
||||
if(err == VPAD_READ_SUCCESS){
|
||||
if (err == VPAD_READ_SUCCESS) {
|
||||
btn = vpad_data.hold | vpad_data.trigger;
|
||||
}
|
||||
|
||||
|
||||
bool loadWithoutHacks = false;
|
||||
bool kernelDone = false;
|
||||
bool skipKernel = false;
|
||||
@ -94,10 +94,10 @@ int main(int argc, char **argv) {
|
||||
if (entryPoint != 0) {
|
||||
DEBUG_FUNCTION_LINE("New entrypoint at %08X", entryPoint);
|
||||
|
||||
char* arr[3];
|
||||
char *arr[3];
|
||||
arr[0] = argv[0];
|
||||
arr[1] = (char*) "void forceDefaultTitleIDToWiiUMenu(void)";
|
||||
arr[2] = (char*)&forceDefaultTitleIDToWiiUMenu;
|
||||
arr[1] = (char *) "void forceDefaultTitleIDToWiiUMenu(void)";
|
||||
arr[2] = (char *) &forceDefaultTitleIDToWiiUMenu;
|
||||
|
||||
int res = ((int (*)(int, char **)) entryPoint)(3, arr);
|
||||
if (res >= 0) {
|
||||
@ -155,7 +155,7 @@ void forceDefaultTitleIDToWiiUMenu() {// Restore the default title id to the nor
|
||||
|
||||
|
||||
void SplashScreen(int32_t durationInMs) {
|
||||
int32_t screen_buf0_size = 0;
|
||||
uint32_t screen_buf0_size;
|
||||
|
||||
// Init screen and screen buffers
|
||||
OSScreenInit();
|
||||
|
Loading…
Reference in New Issue
Block a user