I need something between strstr and memcmp for checking if an array exists in a range of memory.
Example what I want to achieve:
BYTE a[] = { 0x01, 0x02, 0x03, 0x04 };
BYTE b[] = { 0x02, 0x03 };
if (mem_in_mem(a, b, 4 * sizeof(BYTE)) == 0) {
printf("b is in memory range of a\n");
}
Any ideas how I can something like that? (Should work with windows)
memcmpand advance a character each time until you've checked the whole buffer?mem_in_memfunction is not told the length of the (Sub)Array it is supposed to match.memcmp.