samplemem allows checking whether a large range of memory contains the same byte over and over by sampling a given number of blocks.
The samples are spaced equidistantly over the whole file.
samplemem <block_device> <block_size> <value_to_check> <n_samples>
Where:
block_device: file to check by samplingblock_size: size of a blockvalue_to_check: byte containing the value that has to be the same for the whole blockn_samples: number of samples to check
Output:
block_numberof each checked block that failed the check
E.g.: To check if the drive at /dev/sdd only contains the value 0x55 by checking the memory using 1024 samples and a block size of 4096:
Example:
sudo ./samplemem /dev/sdd 4096 0x55 1024