I'm writing a program that searches for particular sequences of bytes in a USB stick. The problem is that I don't know how to search effectively. ReadFile() allows me to buffer 512 bytes each time. If my sequence is fully present in that block, then there is no problem. But what if the first byte of my sequence starts at the end of that block, and the rest in the next block?
Visualization:
target="GIF"
block1
000000000000000000
000000000000000000
000000000000000000
00000000000000000G
block2
IF0000000000000000
000000000000000000
000000000000000000
000000000000000000