示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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
示例#4
0
 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