FirmwarePatch.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:MS-fitnessband-jailbreak 作者: b0n0n 项目源码 文件源码
def ChkMainCrc(filename):
        '''
        check main CRC
        '''
        data = open(filename,'rb').read()

        for i in range(0, len(data)-4):
            # these 4 bytes are the CRC embedded in the FirmwareUpdate.bin
            block = data[i:i+4]

            # calculate CRC for the rest of the data (replace the 4 bytes with 0's)
            c = (crc32(data[:i] + "\0"*4 + data[i+4:],0xFFFFFFFF)^0xFFFFFFFF) & 0xffffffff

            if pack("<I", c) in block:
                print "Found at offset dec=%d hex=%08X" % (i,i)
                print "CRC=%08X" % c
                break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号