News for hackers. Stuff that matters.
Re:Creating a modifiable gzipped disk image by mungoman2 on Sunday December 04, 2022 @03:06AM (#33851617)
Updating the checksum is possible by calculating the CRC of the modified bytes at the proper byte offset before and after modification. Then applying:

checksum ^= crc_of_removed_bytes

checksum ^= crc_of_added_bytes

Re:Creating a modifiable gzipped disk image by rwmj on Sunday December 04, 2022 @05:17AM (#33852278)
Thanks! I thought there would be a way something like this.

To be honest the tool as posted is just a hack to demonstrate the point that it is possible. I have an idea for a somewhat more refined tool which would let you mark small stretches of data (not whole partitions) for modification, and provide additional tooling to do the mods and update the checksums.

As well as implementing the whole thing again for xz & zstd, which is another large chunk of work.