def inspectXattr(self, k, v): if getString(k) == "com.apple.system.cprotect" and k.fileID != kHFSRootParentID: c = cprotect_xattr.parse(v.data) if c.persistent_class != NSProtectionNone: #desc = "%d %s" % (k.fileID, self.getFullPath(k.fileID)) desc = "%s" % self.getFullPath(k.fileID) self.protected_dict.setdefault(PROTECTION_CLASSES.get(c.persistent_class),[]).append(desc)
def inspectXattr(self, k, v): if getString( k ) == "com.apple.system.cprotect" and k.fileID != kHFSRootParentID: c = cprotect_xattr.parse(v.data) if c.persistent_class != NSProtectionNone: #desc = "%d %s" % (k.fileID, self.getFullPath(k.fileID)) desc = "%s" % self.getFullPath(k.fileID) self.protected_dict.setdefault( PROTECTION_CLASSES.get(c.persistent_class), []).append(desc)
def decryptFile(self, k,v): if v.recordType == kHFSPlusFileRecord: filename = getString(k).encode("utf-8") cprotect = self.getXattr(v.data.fileID, "com.apple.system.cprotect") if not cprotect: self.notEncrypted.append(filename) return fk = self.getFileKeyForCprotect(cprotect) if not fk: self.failedToGetKey.append(filename) return print "Decrypting", filename f = EMFFile(self, v.data.dataFork, v.data.fileID, fk) f.decryptFile() self.decryptedCount += 1
def decryptFile(self, k,v): if v.recordType == kHFSPlusFileRecord: filename = getString(k) cprotect = self.getXattr(v.data.fileID, "com.apple.system.cprotect") if not cprotect: self.notEncrypted.append(filename) return fk = self.getFileKeyForCprotect(cprotect) if not fk: self.failedToGetKey.append(filename) return print "Decrypting", filename f = EMFFile(self, v.data.dataFork, v.data.fileID, fk) f.decryptFile() self.decryptedCount += 1