Support already decrypted N3DS firmware.bins in dev
This commit is contained in:
parent
5a30b2b298
commit
92f3a736a7
@ -387,6 +387,11 @@ void decryptExeFs(u8 *inbuf)
|
|||||||
//ARM9Loader replacement
|
//ARM9Loader replacement
|
||||||
void arm9Loader(u8 *arm9Section)
|
void arm9Loader(u8 *arm9Section)
|
||||||
{
|
{
|
||||||
|
#ifdef DEV
|
||||||
|
//Check if FIRM is already decrypted
|
||||||
|
if(*(u32 *)(arm9Section + 0x800) == 0x47704770) return;
|
||||||
|
#endif
|
||||||
|
|
||||||
//Determine the arm9loader version
|
//Determine the arm9loader version
|
||||||
u32 a9lVersion;
|
u32 a9lVersion;
|
||||||
switch(arm9Section[0x53])
|
switch(arm9Section[0x53])
|
||||||
|
@ -584,11 +584,11 @@ static inline void launchFirm(FirmwareType firmType)
|
|||||||
|
|
||||||
//Determine the ARM11 entry to use
|
//Determine the ARM11 entry to use
|
||||||
vu32 *arm11;
|
vu32 *arm11;
|
||||||
if(isFirmlaunch) arm11 = (u32 *)0x1FFFFFFC;
|
if(isFirmlaunch) arm11 = (vu32 *)0x1FFFFFFC;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
deinitScreens();
|
deinitScreens();
|
||||||
arm11 = (u32 *)0x1FFFFFF8;
|
arm11 = (vu32 *)BRAHMA_ARM11_ENTRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set ARM11 kernel entrypoint
|
//Set ARM11 kernel entrypoint
|
||||||
|
@ -121,7 +121,7 @@ void loadPayload(u32 pressed)
|
|||||||
|
|
||||||
f_closedir(&dir);
|
f_closedir(&dir);
|
||||||
|
|
||||||
if(result == FR_OK && info.fname[0])
|
if(result == FR_OK && info.fname[0] != 0)
|
||||||
{
|
{
|
||||||
u32 *loaderAddress = (u32 *)0x24FFFF00;
|
u32 *loaderAddress = (u32 *)0x24FFFF00;
|
||||||
u8 *payloadAddress = (u8 *)0x24F00000;
|
u8 *payloadAddress = (u8 *)0x24F00000;
|
||||||
@ -166,7 +166,7 @@ u32 firmRead(void *dest, u32 firmType)
|
|||||||
u32 firmVersion = 0xFFFFFFFF;
|
u32 firmVersion = 0xFFFFFFFF;
|
||||||
|
|
||||||
//Parse the target directory
|
//Parse the target directory
|
||||||
while(f_readdir(&dir, &info) == FR_OK && info.fname[0])
|
while(f_readdir(&dir, &info) == FR_OK && info.fname[0] != 0)
|
||||||
{
|
{
|
||||||
//Not a cxi
|
//Not a cxi
|
||||||
if(info.fname[9] != 'a') continue;
|
if(info.fname[9] != 'a') continue;
|
||||||
@ -203,7 +203,7 @@ void findDumpFile(const char *path, char *fileName)
|
|||||||
FILINFO info;
|
FILINFO info;
|
||||||
u32 n = 0;
|
u32 n = 0;
|
||||||
|
|
||||||
while(f_findfirst(&dir, &info, path, fileName) == FR_OK && info.fname[0])
|
while(f_findfirst(&dir, &info, path, fileName) == FR_OK && info.fname[0] != 0)
|
||||||
{
|
{
|
||||||
u32 i = 18,
|
u32 i = 18,
|
||||||
tmp = ++n;
|
tmp = ++n;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
|
||||||
vu32 *const arm11Entry = (vu32 *)0x1FFFFFF8;
|
vu32 *const arm11Entry = (vu32 *)BRAHMA_ARM11_ENTRY;
|
||||||
static const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};
|
static const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};
|
||||||
|
|
||||||
void __attribute__((naked)) arm11Stub(void)
|
void __attribute__((naked)) arm11Stub(void)
|
||||||
|
@ -37,6 +37,8 @@ typedef volatile u32 vu32;
|
|||||||
typedef volatile u64 vu64;
|
typedef volatile u64 vu64;
|
||||||
|
|
||||||
//Used by multiple files
|
//Used by multiple files
|
||||||
|
#define BRAHMA_ARM11_ENTRY 0x1FFFFFF8
|
||||||
|
|
||||||
typedef enum FirmwareSource
|
typedef enum FirmwareSource
|
||||||
{
|
{
|
||||||
FIRMWARE_SYSNAND = 0,
|
FIRMWARE_SYSNAND = 0,
|
||||||
|
Reference in New Issue
Block a user