Fixed possible issue with the injector
This commit is contained in:
parent
d4d281bb9c
commit
7479bf8092
@ -44,16 +44,15 @@ static u32 patchMemory(u8 *start, u32 size, const void *pattern, u32 patSize, in
|
|||||||
{
|
{
|
||||||
u8 *found = memsearch(start, pattern, size, patSize);
|
u8 *found = memsearch(start, pattern, size, patSize);
|
||||||
|
|
||||||
if(found == NULL)
|
if(found == NULL) break;
|
||||||
break;
|
|
||||||
|
|
||||||
memcpy(found + offset, replace, repSize);
|
memcpy(found + offset, replace, repSize);
|
||||||
|
|
||||||
u32 at = (u32)(found - start);
|
u32 at = (u32)(found - start);
|
||||||
|
|
||||||
if(at + patSize > size) size = 0;
|
if(at + patSize > size) break;
|
||||||
else size = size - (at + patSize);
|
|
||||||
|
|
||||||
|
size -= at + patSize;
|
||||||
start = found + patSize;
|
start = found + patSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user