__main__.py 文件源码

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

项目:firmtool 作者: TuxSH 项目源码 文件源码
def check(self):
        from cryptography.hazmat.backends import default_backend
        from cryptography.hazmat.primitives import hashes

        off = self.offset
        if self.copyMethod == 0 and (1 << 20) > self.size >= 0x800+0xA00 and self.address == 0x08006000:
            if self.sectionData[0x50 : 0x53] == b"K9L":
                self.guessedType = self.sectionData[0x50 : 0x54].decode("ascii")
            elif self.sectionData[0x50 : 0x54] == b"\xFF\xFF\xFF\xFF":
                self.guessedType = "K9L0"
        elif self.copyMethod == 0 and (1 << 20) > self.size >= 0xA00 and self.address == 0x08006800:
            self.guessedType = "Kernel9"
        elif self.copyMethod == 1 and self.size >= 0xA00:
            if self.sectionData[0x100 : 0x104] == b"NCCH":
                self.guessedType = "Kernel11 modules"

        H = hashes.Hash(hashes.SHA256(), backend=default_backend())
        H.update(self.sectionData)
        self.hashIsValid = self.hash == H.finalize()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号