comparebinaries.py 文件源码

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

项目:binaryanalysis 作者: armijnhemel 项目源码 文件源码
def gethash(path, filename):
    scanfile = open("%s/%s" % (path, filename), 'r')
    h = hashlib.new('sha256')
    scanfile.seek(0)
    hashdata = scanfile.read(10000000)
    while hashdata != '':
        h.update(hashdata)
        hashdata = scanfile.read(10000000)
    scanfile.close()
    return h.hexdigest()

## method to compare binaries. Returns the amount of bytes that differ
## according to bsdiff, or 0 if the files are identical
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号