Spaces and stuff
Makes things more uniform
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user