Spaces and stuff

Makes things more uniform
This commit is contained in:
Aurora
2016-03-25 18:17:12 +01:00
parent 9b1df43687
commit 1861d556a6
5 changed files with 15 additions and 16 deletions

View File

@@ -36,8 +36,7 @@ int memcmp(const void *buf1, const void *buf2, u32 size){
} }
void *memsearch(void *start_pos, const void *search, u32 size, u32 size_search){ void *memsearch(void *start_pos, const void *search, u32 size, u32 size_search){
for(void *pos = start_pos + size - size_search; pos >= start_pos; pos--){ for(void *pos = start_pos + size - size_search; pos >= start_pos; pos--)
if(memcmp(pos, search, size_search) == 0) return pos; if(memcmp(pos, search, size_search) == 0) return pos;
}
return NULL; return NULL;
} }

View File

@@ -63,8 +63,8 @@ u32 getfOpen(void *pos, u32 size, u8 *proc9Offset){
void *getFirmWrite(void *pos, u32 size){ void *getFirmWrite(void *pos, u32 size){
//Look for FIRM writing code //Look for FIRM writing code
u8 *firmwrite = (u8 *)memsearch(pos, "exe:", size, 4); u8 *const off = (u8 *)memsearch(pos, "exe:", size, 4);
const unsigned char pattern[] = {0x00, 0x28, 0x01, 0xDA}; const unsigned char pattern[] = {0x00, 0x28, 0x01, 0xDA};
return memsearch(firmwrite - 0x100, pattern, 0x100, 4); return memsearch(off - 0x100, pattern, 0x100, 4);
} }