MD5 module

The logic of this part doesn't seems to be right, "block_pos" is incremented but never used, and if "offset" lies in the middle of a block, the data from "offset" to the end of the block is not taken into account.

Additionally, you must take into account the value of block->base. The base for a block is the offset within the file where the block starts. The first block always have block->base == 0, the second block will have block->base >= prev_block->size. For example:

Block 1
[base: 0, size: 1000]

Block 2 
[base: 1000: size: 1000]

Block 3
[base: 2000: size: 1000]

Here we have three contiguous blocks, each one 1000 bytes long. But blocks not always are contiguous, like in:

Block 1
[base: 0, size: 1000]

Block 2 
[base: 2000: size: 1000]

Here first block ends at 1000 and the second one starts at 2000, the gap between 1000 and 2000 doesn't contain any data. This doesn't make sense for a file, but it's used while scanning processes.

So, you should be comparing "offset" with block->base.