-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I have been working on a freecam for Fallen Order and took some inspiration from your project (it’s been very helpful!), but in the process I noticed this piece of code, which doesn’t really make sense to me:
How can this ever work? It seems like a classic instance of the “finding a substring in a string” problem:
consider the following signature:
[34 56 78
and this piece of memory:
34 56 34 56 78
as I understand it, your algorithm goes through bytes 0 and 1, stops at the third (2), says “this one doesn’t check out”, but instead of going back to byte 1 and then 2, it continues with byte 3, therefore never detecting the pattern and returning a null pointer.
I do apologize if I’m missing something. It just seems strange that a linear algorithm could find a sequence of bytes in memory (without any sort of alignment tricks going on).