docs: def extract(self, name):
          """Get the contents of an entry.
  
             NAME is an entry name.
             Return the tuple (ispkg, contents).
             For non-Python resoures, ispkg is meaningless (and 0).
             Used by the import mechanism."""
          if type(name) == type(''):
              ndx = self.toc.find(name)
              if ndx == -1:
                  return None
          else:
              ndx = name
          (dpos, dlen, ulen, flag, typcd, nm) = self.toc.get(ndx)
          self.lib.seek(self.pkgstart+dpos)
          rslt = self.lib.read(dlen)
          if flag == 2:
              global AES
              import AES
              key = rslt[:32]
              # Note: keep this in sync with bootloader's code
              rslt = AES.new(key, AES.MODE_CFB, "\0"*AES.block_size).decrypt(rslt[32:])
          if flag == 1 or flag == 2:
              rslt = zlib.decompress(rslt)
          if typcd == 'M':
              return (1, rslt)
          return (0, rslt)