前面的文章提到了ExFAT boot checksum出错时的错误提醒,这里如果需要确认boot checksum是否正确,需要将boot checusum的算法实现一遍.
这里采用了python来实现.
boot checksum算法参考下面:
exFAT Boot Checksum
This sector contains a repeating 32-bit checksum of the previous 11 sectors. The checksum calculation excludes VolumeFlags and PercentInUse fields in Boot Sector (bytes 106, 107, 112). The checksum is repeated until the end of the sector. The number of repetitions depends on the size of the sector.
UNIT32 BootChecksum(constunsignedchardata[],