Assert the iosu binaries fit in memory

This commit is contained in:
Maschell 2022-07-25 15:12:05 +02:00
parent ab360aabe8
commit 224a68531e

View File

@ -308,14 +308,20 @@ static void uhs_exploit_init(int dev_uhs_0_handle) {
ayylmao[5] = 1;
ayylmao[8] = 0x500000;
static_assert(sizeof(second_chain) < 0xF4130000 - 0xF4120000, "second_chain is too big");
memcpy((char *) (0xF4120000), second_chain, sizeof(second_chain));
static_assert(sizeof(final_chain) < 0xF4140000 - 0xF4130000, "second_chain is too big");
memcpy((char *) (0xF4130000), final_chain, sizeof(final_chain));
static_assert(sizeof(final_chain) < 0xF4148000 - 0xF4140000, "ios_kernel is too big");
memcpy((char *) (0xF4140000), ios_kernel, sizeof(ios_kernel));
static_assert(sizeof(ios_usb) < 0xF4160000 - 0xF4148000, "IOS_USB is too big");
payload_info_t *payloads = (payload_info_t *) 0xF4148000;
payloads->size = sizeof(ios_usb);
memcpy(payloads->data, ios_usb, payloads->size);
static_assert(sizeof(ios_mcp) < 0xF4170000 - 0xF4160000, "IOS_MCP is too big");
payloads = (payload_info_t *) 0xF4160000;
payloads->size = sizeof(ios_mcp);
memcpy(payloads->data, ios_mcp, payloads->size);