Minor stuff

This commit is contained in:
Aurora Wright 2017-04-23 19:20:45 +02:00
parent 8d102256a2
commit a5ddc38477

View File

@ -307,7 +307,8 @@ static inline bool findLayeredFsSymbols(u8* code, u32 size, u32 *fsMountArchive,
}
}
if(addr <= size - 12 && *fsRegisterArchive == 0xFFFFFFFF && *(u32 *)(code + addr) == 0xE3500008 && (*(u32 *)(code + addr + 4) & 0xFFF00FF0) == 0xE1800400 && (*(u32 *)(code + addr + 8) & 0xFFF00FF0) == 0xE1800FC0)
if(addr <= size - 12 && *fsRegisterArchive == 0xFFFFFFFF && *(u32 *)(code + addr) == 0xE3500008 &&
(*(u32 *)(code + addr + 4) & 0xFFF00FF0) == 0xE1800400 && (*(u32 *)(code + addr + 8) & 0xFFF00FF0) == 0xE1800FC0)
*fsRegisterArchive = findFunctionStart(code, addr);
if(addr <= size - 0x40 && *fsTryOpenFile == 0xFFFFFFFF && *(u32 *)(code + addr + 4) == 0x1AFFFFFC && *(u32 *)(code + addr) == 0xE351003A &&
@ -326,9 +327,10 @@ static inline bool findLayeredFsSymbols(u8* code, u32 size, u32 *fsMountArchive,
static inline bool findLayeredFsPayloadOffset(u8* code, u32 size, u32 *payloadOffset)
{
//First check for sufficient padding at the end of the .text segment
if(((size + 4095) & 0xfffff000) - size >= romfsredir_bin_size)
if(((size + 4095) & 0xFFFFF000) - size >= romfsredir_bin_size)
{
*payloadOffset = size;
return true;
}
@ -358,6 +360,7 @@ static inline bool findLayeredFsPayloadOffset(u8* code, u32 size, u32 *payloadOf
if(func != 0xFFFFFFFF)
{
*payloadOffset = func;
return true;
}
}