Fix derp (3)

This commit is contained in:
Aurora 2016-11-15 20:18:28 +01:00
parent 0306556032
commit 1fcab825bf
5 changed files with 8 additions and 12 deletions

View File

@ -172,7 +172,7 @@ static inline bool loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageI
IFile file; IFile file;
if(R_FAILED(openLumaFile(&file, path))) return 0; if(R_FAILED(openLumaFile(&file, path))) return true;
bool ret; bool ret;
u64 fileSize; u64 fileSize;

View File

@ -425,7 +425,7 @@ bool decryptNusFirm(const Ticket *ticket, Cxi *cxi, u32 ncchSize)
__attribute__((aligned(4))) const u8 keyY0x3D[AES_BLOCK_SIZE] = {0x0C, 0x76, 0x72, 0x30, 0xF0, 0x99, 0x8F, 0x1C, 0x46, 0x82, 0x82, 0x02, 0xFA, 0xAC, 0xBE, 0x4C}; __attribute__((aligned(4))) const u8 keyY0x3D[AES_BLOCK_SIZE] = {0x0C, 0x76, 0x72, 0x30, 0xF0, 0x99, 0x8F, 0x1C, 0x46, 0x82, 0x82, 0x02, 0xFA, 0xAC, 0xBE, 0x4C};
__attribute__((aligned(4))) u8 titleKey[AES_BLOCK_SIZE], __attribute__((aligned(4))) u8 titleKey[AES_BLOCK_SIZE],
cetkIv[AES_BLOCK_SIZE] = {0}; cetkIv[AES_BLOCK_SIZE] = {0};
memcpy(titleKey, ticket->titleKey, sizeof(titleKey)); memcpy(titleKey, ticket->titleKey, sizeof(titleKey));
memcpy(cetkIv, ticket->titleId, sizeof(ticket->titleId)); memcpy(cetkIv, ticket->titleId, sizeof(ticket->titleId));

View File

@ -164,6 +164,7 @@ static inline u32 patchMpu(u8 *pos, u32 size)
u32 patchEmuNand(u8 *arm9Section, u32 kernel9Size, u8 *process9Offset, u32 process9Size, u32 emuHeader, u8 *kernel9Address) u32 patchEmuNand(u8 *arm9Section, u32 kernel9Size, u8 *process9Offset, u32 process9Size, u32 emuHeader, u8 *kernel9Address)
{ {
u8 *freeK9Space; u8 *freeK9Space;
if(!getFreeK9Space(arm9Section, kernel9Size, &freeK9Space)) return 1; if(!getFreeK9Space(arm9Section, kernel9Size, &freeK9Space)) return 1;
u32 ret = 0; u32 ret = 0;

View File

@ -89,7 +89,7 @@ void detectAndProcessExceptionDumps(void)
{ {
volatile ExceptionDumpHeader *dumpHeader = (volatile ExceptionDumpHeader *)0x25000000; volatile ExceptionDumpHeader *dumpHeader = (volatile ExceptionDumpHeader *)0x25000000;
if(dumpHeader->magic[0] != 0xDEADC0DE || dumpHeader->magic[1] == 0xDEADCAFE || (dumpHeader->processor != 9 && dumpHeader->processor != 11)) return; if(dumpHeader->magic[0] != 0xDEADC0DE || dumpHeader->magic[1] != 0xDEADCAFE || (dumpHeader->processor != 9 && dumpHeader->processor != 11)) return;
const vu32 *regs = (vu32 *)((vu8 *)dumpHeader + sizeof(ExceptionDumpHeader)); const vu32 *regs = (vu32 *)((vu8 *)dumpHeader + sizeof(ExceptionDumpHeader));
const vu8 *stackDump = (vu8 *)regs + dumpHeader->registerDumpSize + dumpHeader->codeDumpSize; const vu8 *stackDump = (vu8 *)regs + dumpHeader->registerDumpSize + dumpHeader->codeDumpSize;

View File

@ -38,23 +38,17 @@ static FATFS sdFs,
static bool switchToMainDir(bool isSd) static bool switchToMainDir(bool isSd)
{ {
const char *mainDir = isSd ? "/luma" : "/rw/luma"; const char *mainDir = isSd ? "/luma" : "/rw/luma";
bool ret;
switch(f_chdir(mainDir)) switch(f_chdir(mainDir))
{ {
case FR_OK: case FR_OK:
ret = true; return true;
break;
case FR_NO_PATH: case FR_NO_PATH:
f_mkdir(mainDir); f_mkdir(mainDir);
ret = switchToMainDir(isSd); return switchToMainDir(isSd);
break;
default: default:
ret = false; return false;
break;
} }
return ret;
} }
bool mountFs(bool isSd, bool switchToCtrNand) bool mountFs(bool isSd, bool switchToCtrNand)
@ -191,6 +185,7 @@ void payloadMenu(void)
while(f_readdir(&dir, &info) == FR_OK && info.fname[0] != 0 && payloadNum < 20) while(f_readdir(&dir, &info) == FR_OK && info.fname[0] != 0 && payloadNum < 20)
{ {
if(info.fname[0] == '.' || memcmp(info.altname + 8, ".BIN", 4) != 0) continue; if(info.fname[0] == '.' || memcmp(info.altname + 8, ".BIN", 4) != 0) continue;
u32 nameLength = strlen(info.fname) - 4; u32 nameLength = strlen(info.fname) - 4;
if(nameLength > 48) continue; if(nameLength > 48) continue;