示例#1
0
 def unpackBundle(self, path):
     bundle = ab.Crypt(path, self.outDir)
     header = self.getHeader(path)
     if not ab.isBundleDecrypted(header) and ab.isBundleEncrypted(header):
         self.logWarning("Bundle is not decrypted, decrypting...")
         # bundle.decrypt()
     elif not ab.isBundleEncrypted(header) and not ab.isBundleDecrypted(
             header):
         self.logWarning("Skipping because it has an unknown header")
         return
     bundle.unpack()
示例#2
0
 def encryptBundle(self, path):
     bundle = ab.Crypt(path, self.outDir)
     header = self.getHeader(path)
     if not ab.isBundleDecrypted(header):
         self.logWarning("Skipping", bundle.path,
                         "because it's already encrypted")
         return
     elif not ab.isBundleEncrypted(header) and not ab.isBundleDecrypted(
             header):
         self.logWarning("Skipping", bundle.path,
                         "because it has an unknown header")
         return
     bundle.encrypt()
示例#3
0
 def determineFileType(self, reader):
     header = self.getHeader(reader)
     fileType = _UNKNOWN
     if luacrypt.isLuaEncrypted(header) or luacrypt.isLuaDecrypted(header):
         fileType = _LUA
     elif ab.isBundleEncrypted(header) or ab.isBundleDecrypted(header):
         fileType = _BUNDLE
     return fileType