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()
评论列表
文章目录