engine bugfix

This commit is contained in:
Akash Mozumdar 2018-08-07 01:03:41 -04:00
parent 0d3597a91d
commit cda2914a27

View File

@ -49,8 +49,11 @@ DWORD SearchPattern(DWORD base, DWORD base_length, LPCVOID search, DWORD search_
{
// Artikash 7/14/2018: not sure, but I think this could throw read access violation if I dont subtract search_length
for (int i = 0; i < base_length - search_length; ++i)
if (memcmp((void*)(base + i), search, search_length) == 0)
return i;
for (int j = 0; j <= search_length; ++j)
if (j == search_length) return i; // not sure about this algorithm...
else if (*((BYTE*)base + i + j) != *((BYTE*)search + j) && *((BYTE*)search + j) != 0x11) break; // 0x11 = wildcard
//if (memcmp((void*)(base + i), search, search_length) == 0)
//return i;
return 0;
}