Skeleton out framework for patching package2.

This commit is contained in:
Michael Scire 2018-04-11 18:19:01 -06:00
parent 3c24bfdb79
commit a0d2642bb1
3 changed files with 88 additions and 0 deletions

View file

@ -1,6 +1,7 @@
#include "utils.h"
#include "nxboot.h"
#include "key_derivation.h"
#include "package2.h"
#include "loader.h"
#include "splash_screen.h"
#include "exocfg.h"
@ -58,6 +59,9 @@ void nxboot_main(void) {
/* Derive keydata. */
derive_nx_keydata(MAILBOX_EXOSPHERE_CONFIGURATION->target_firmware);
/* Patch package2, adding thermosphere + custom KIPs. */
package2_patch((void *)loader_ctx->package2_loadfile.load_address);
/* Boot up Exosphere. */
MAILBOX_NX_BOOTLOADER_IS_SECMON_AWAKE = 0;
if (MAILBOX_EXOSPHERE_CONFIGURATION->target_firmware <= EXOSPHERE_TARGET_FIRMWARE_400) {