I want to search some memory range for a specific byte pattern. Therefore, my approach is to build a function
void * FindPattern (std::vector<byte> pattern, byte wildcard,
void * startAddress, void * endAddress);
using the Boyer-Moore-Horspool algorithm to find the pattern in the memory range.
The wildcard
byte stays for some specific byte which should be treated as a wildcard.
So - for example - if wildcard
is 0xCC
, every 0xCC
in pattern
will be a wildcard.
The function should return the start of the memory range, where the pattern was found the first time.
My question is now: is there some similar function already done in the most common libraries or do I have to implement this for my own?