Minor stuff

This commit is contained in:
Aurora Wright 2017-04-15 22:36:34 +02:00
parent 93c8c90804
commit c9456055ea
2 changed files with 14 additions and 12 deletions

View File

@ -291,9 +291,10 @@ static u32 findFunctionStart(u8* code, u32 pos)
static bool findLayeredFsSymbols(u8* code, u32 size, u32 *fsMountArchive, u32 *fsRegisterArchive, u32 *fsTryOpenFile, u32 *fsOpenFileDirectly, u32 *throwFatalError)
{
bool found = false;
u32 svcConnectToPort = 0xFFFFFFFF;
for(u32 addr = 0; addr <= size - 4; addr += 4)
for(u32 addr = 0; !found && addr <= size - 4; addr += 4)
{
if(*fsMountArchive == 0xFFFFFFFF)
{
@ -322,9 +323,11 @@ static bool findLayeredFsSymbols(u8* code, u32 size, u32 *fsMountArchive, u32 *f
if(addr >= 4 && svcConnectToPort == 0xFFFFFFFF && *(u32 *)(code + addr) == 0xEF00002D)
svcConnectToPort = addr - 4;
if(svcConnectToPort != 0xFFFFFFFF && *fsMountArchive != 0xFFFFFFFF && *fsRegisterArchive != 0xFFFFFFFF && *fsTryOpenFile != 0xFFFFFFFF && *fsOpenFileDirectly != 0xFFFFFFFF) found = true;
}
if(svcConnectToPort != 0xFFFFFFFF && *fsMountArchive != 0xFFFFFFFF && *fsRegisterArchive != 0xFFFFFFFF && *fsTryOpenFile != 0xFFFFFFFF && *fsOpenFileDirectly != 0xFFFFFFFF)
if(found)
{
u32 func = 0xFFFFFFFF;

View File

@ -564,17 +564,16 @@ void kernel9Loader(Arm9Bin *arm9Section)
aes_setkey(slot, decKey, AES_KEYX, AES_INPUT_BE | AES_INPUT_NORMAL);
}
if(ISSIGHAX)
{
twlConsoleInfoInit();
if(!ISSIGHAX) return;
if(k9lVersion == 2)
{
aes_setkey(0x11, key1s[ISDEVUNIT ? 1 : 0], AES_KEYNORMAL, AES_INPUT_BE | AES_INPUT_NORMAL);
aes_use_keyslot(0x11);
aes(decKey, keyBlocks[0], 1, NULL, AES_ECB_DECRYPT_MODE, 0);
aes_setkey(0x18, decKey, AES_KEYX, AES_INPUT_BE | AES_INPUT_NORMAL);
}
twlConsoleInfoInit();
if(k9lVersion == 2)
{
aes_setkey(0x11, key1s[ISDEVUNIT ? 1 : 0], AES_KEYNORMAL, AES_INPUT_BE | AES_INPUT_NORMAL);
aes_use_keyslot(0x11);
aes(decKey, keyBlocks[0], 1, NULL, AES_ECB_DECRYPT_MODE, 0);
aes_setkey(0x18, decKey, AES_KEYX, AES_INPUT_BE | AES_INPUT_NORMAL);
}
}