Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boot1 payload loading #53

Merged
merged 7 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ios_mcp/imports.sym
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ IOS_RestartTimer = 0x0505688c;
IOS_StopTimer = 0x05056894;
IOS_DestroyTimer = 0x0505689c;

IOS_GetAbsTime64 = 0x050568d4;

IOS_CheckDebugMode = 0x050568ec;
IOS_ReadOTP = 0x050568fc;

Expand Down Expand Up @@ -72,3 +74,4 @@ IOSC_ImportSecretKey = 0x05053504;
IOSC_ImportPublicKey = 0x050532c8;

setDefaultTitleId = 0x0510d984|1;
encryptPrsh = 0x0500a610|1;
7 changes: 5 additions & 2 deletions ios_mcp/source/imports.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef struct __attribute__((__packed__)) {
} UCSysConfig_t;

int LONG_CALL setDefaultTitleId(uint64_t tid);
int LONG_CALL encryptPrsh(uint32_t addr, uint32_t size, void* ivBuf, uint32_t ivSize);

typedef enum BSPHardwareVersions {
BSP_HARDWARE_VERSION_UNKNOWN = 0x00000000,
Expand Down Expand Up @@ -105,6 +106,8 @@ int IOS_RestartTimer(int timerid, uint32_t delay, uint32_t period);
int IOS_StopTimer(int timerid);
int IOS_DestroyTimer(int timerid);

int IOS_GetAbsTime64(uint64_t* time);

int IOS_CheckDebugMode(void);
int IOS_ReadOTP(int index, void* buffer, uint32_t size);

Expand Down Expand Up @@ -147,8 +150,8 @@ int IOSC_DeleteObject(int keyHandle);
int IOSC_GenerateRand(uint8_t* randBytes, uint32_t numBytes);
int IOSC_ImportSecretKey(IOSCSecretKeyHandle importedHandle, IOSCSecretKeyHandle verifyHandle, IOSCSecretKeyHandle decryptHandle, IOSCSecretKeySecurity flag, uint8_t* signbuffer, uint32_t signbufferSize, uint8_t* ivData, uint32_t ivSize, uint8_t* keybuffer, uint32_t keybufferSize);
int IOSC_ImportPublicKey(uint8_t* publicKeyData, uint32_t dataSize, uint8_t* exponent, uint32_t exponentSize, IOSCPublicKeyHandle publicKeyHandle);
int IOSC_Decrypt(IOSCSecretKeyHandle decryptHandle, uint8_t* ivData, uint32_t ivSize, uint8_t* inputData, uint32_t inputSize, uint8_t* outputData, uint32_t outputSize);
int IOSC_Encrypt(IOSCSecretKeyHandle encryptHandle, uint8_t* ivData, uint32_t ivSize, uint8_t* inputData, uint32_t inputSize, uint8_t* outputData, uint32_t outputSize);
int IOSC_Decrypt(IOSCSecretKeyHandle decryptHandle, void* ivData, uint32_t ivSize, void* inputData, uint32_t inputSize, void* outputData, uint32_t outputSize);
int IOSC_Encrypt(IOSCSecretKeyHandle encryptHandle, void* ivData, uint32_t ivSize, void* inputData, uint32_t inputSize, void* outputData, uint32_t outputSize);

#define WUP_CERT_SIGTYPE_ECC_SHA1 0x00010002 /* ECC with SHA-1 */
#define WUP_CERT_SIGTYPE_ECC_SHA256 0x00010005 /* ECC with SHA-256 */
Expand Down
4 changes: 4 additions & 0 deletions ios_mcp/source/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static const Menu mainMenuOptions[] = {
{"Debug System Region", {.callback = option_DebugSystemRegion}},
{"System Information", {.callback = option_SystemInformation}},
{"Submit System Data", {.callback = option_SubmitSystemData}},
{"Load BOOT1 payload", {.callback = option_LoadBoot1Payload}},
{"Shutdown", {.callback = option_Shutdown}},
};

Expand Down Expand Up @@ -406,6 +407,9 @@ int menuThread(void* arg)
// set LED to purple
setNotificationLED(NOTIF_LED_PURPLE, 0);

// Check to see if we should autoboot
handleBoot1Autoboot();

int selected = 0;
while (1) {
selected = drawMenu("Wii U Recovery Menu v" VERSION_STRING " by GaryOderNichts",
Expand Down
Loading