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:
https://github.com/coltonon/OpenGameCamera/blob/afadceb5a877ca841c246ae58ca9440e372d888a/OpenGameCamera/SigScan/SigScan.cpp#L112
How can this ever work? It seems like a classic instance of the “finding a substring in a string” problem:
consider the following signature:
and this piece of memory:
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).
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:
https://github.com/coltonon/OpenGameCamera/blob/afadceb5a877ca841c246ae58ca9440e372d888a/OpenGameCamera/SigScan/SigScan.cpp#L112
How can this ever work? It seems like a classic instance of the “finding a substring in a string” problem:
consider the following signature:
and this piece of memory:
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).