diff --git a/loader/source/main.c b/loader/source/main.c index 4a88190..143c8bf 100644 --- a/loader/source/main.c +++ b/loader/source/main.c @@ -23,9 +23,7 @@ #include "memory.h" #include "cache.h" -extern u32 payloadSize; //Defined in start.s - -void main(void) +void main(u32 payloadSize) { void *payloadAddress = (void *)0x23F00000; diff --git a/source/fs.c b/source/fs.c index 23d625b..df7973e 100644 --- a/source/fs.c +++ b/source/fs.c @@ -162,7 +162,6 @@ void loadPayload(u32 pressed, const char *payloadPath) writeConfig(true); memcpy(loaderAddress, loader_bin, loader_bin_size); - loaderAddress[1] = payloadSize; backupAndRestoreShaHash(true); initScreens(); @@ -170,7 +169,7 @@ void loadPayload(u32 pressed, const char *payloadPath) flushDCacheRange(loaderAddress, loader_bin_size); flushICacheRange(loaderAddress, loader_bin_size); - ((void (*)())loaderAddress)(); + ((void (*)(u32))loaderAddress)(payloadSize); } void payloadMenu(void)