In short, I need to read in my file, block by block, but have the re.finditer regular expression report the offsets relative to the beginning of the overall file, rather than relative to each freas 4096 byte block as it is read in.
for each in wp_head:
print "Word Perfect header %s found @ offset %d" % (
each.group(), total_data_read + each.start())
Another issue to consider is that a match could occur between 2 blocks, for example \xFF\x57 at the end of a 4096 bytes block and \x50\x43 at the beginning of the next block. Currently, your code won't find the match.
As usual, I had started looking at this long after my bedtime and had noted the total_data_read angle as my next line of attack to provide an accumalitive offset.I shall retire now otherwise I may well get my second wind and be up until the early hours!!