I have a very large file (999,952,379,904 bytes to be precise), which is a partial disk image. Looking at it in a hex editor I have found that the structure is as follows:
0-2073 byte offsets contains some header information added by the tool which created the file. I can ignore them.
2074 bytes onward are blocks of 1048580 bytes comprising 1048576 of data followed by a 4 byte CRC value.
I'm looking for an efficient way to start from an offset of 2074 bytes and copy the 1048580 byte blocks excluding the 4 byte CRC values up to the end of the input file. It looks like the file doesn't end with a complete block, so I would either exclude the last block or pad it with zeroes.
dd can clearly accommodate starting from an offset, but is there any way to exclude the last 4 bytes in every block when copying?