Ejemplo n.º 1
0
 def __printDirHeader (self, direntry, byteLen):
     dirname = direntry.Name
     dirname = globals.encodeName(dirname)
     globals.outputln("")
     globals.outputln("="*globals.OutputWidth)
     if direntry.isStorage():
         globals.outputln("%s (storage)"%dirname)
     else:
         globals.outputln("%s (stream, size: %d bytes)"%(dirname, byteLen))
     globals.outputln("-"*globals.OutputWidth)
Ejemplo n.º 2
0
 def __printDirHeader (self, direntry, byteLen):
     dirname = direntry.Name
     dirname = globals.encodeName(dirname)
     globals.outputln("")
     globals.outputln("="*globals.OutputWidth)
     if direntry.isStorage():
         globals.outputln("%s (storage)"%dirname)
     else:
         globals.outputln("%s (stream, size: %d bytes)"%(dirname, byteLen))
     globals.outputln("-"*globals.OutputWidth)
Ejemplo n.º 3
0
    def dump (self):
        self.__parseFile()
        self.strm.printStreamInfo()
        self.strm.printHeader()
        self.strm.printMSAT()
        self.strm.printSAT()
        self.strm.printSSAT()
        self.strm.printDirectory()
        dirEntries = self.strm.getDirectoryEntries()
        for entry in dirEntries:
            dirname = entry.Name
            if len(dirname) == 0:
                continue

            dirstrm = self.strm.getDirectoryStream(entry)
            self.__printDirHeader(entry, len(dirstrm.bytes))
            if entry.isStorage():
                continue

            elif dirname == b"Workbook":
                success = True
                while success:
                    success = self.__readSubStream(dirstrm)

            elif dirname == b"Revision Log":
                dirstrm.type = xlsstream.DirType.RevisionLog
                self.__readSubStream(dirstrm)

            elif dirname == b"EncryptionInfo":
                globals.dumpBytes(dirstrm.bytes, 512)
                globals.outputln("-"*globals.OutputWidth)
                info = msocrypto.EncryptionInfo(dirstrm.bytes)
                info.read()
                info.output()

            elif self.strmData.isPivotCacheStream(dirname):
                dirstrm.type = xlsstream.DirType.PivotTableCache
                self.__readSubStream(dirstrm)
            elif isOleStream(dirname):
                self.__readOleStream(dirstrm)
            elif isCompObjStream(dirname):
                self.__readCompObjStream(dirstrm)
            else:
                globals.dumpBytes(dirstrm.bytes, 512)
Ejemplo n.º 4
0
    def dump (self):
        self.__parseFile()
        self.strm.printStreamInfo()
        self.strm.printHeader()
        self.strm.printMSAT()
        self.strm.printSAT()
        self.strm.printSSAT()
        self.strm.printDirectory()
        dirEntries = self.strm.getDirectoryEntries()
        for entry in dirEntries:
            dirname = entry.Name
            if len(dirname) == 0:
                continue

            dirstrm = self.strm.getDirectoryStream(entry)
            self.__printDirHeader(entry, len(dirstrm.bytes))
            if entry.isStorage():
                continue

            elif dirname == b"Workbook":
                success = True
                while success:
                    success = self.__readSubStream(dirstrm)

            elif dirname == b"Revision Log":
                dirstrm.type = xlsstream.DirType.RevisionLog
                self.__readSubStream(dirstrm)

            elif dirname == b"EncryptionInfo":
                globals.dumpBytes(dirstrm.bytes, 512)
                globals.outputln("-"*globals.OutputWidth)
                info = msocrypto.EncryptionInfo(dirstrm.bytes)
                info.read()
                info.output()

            elif self.strmData.isPivotCacheStream(dirname):
                dirstrm.type = xlsstream.DirType.PivotTableCache
                self.__readSubStream(dirstrm)
            elif isOleStream(dirname):
                self.__readOleStream(dirstrm)
            elif isCompObjStream(dirname):
                self.__readCompObjStream(dirstrm)
            else:
                globals.dumpBytes(dirstrm.bytes, 512)
Ejemplo n.º 5
0
 def __printDirHeader(self, dirname, byteLen):
     dirname = globals.encodeName(dirname)
     globals.outputln("")
     globals.outputln("=" * 68)
     globals.outputln("%s (size: %d bytes)" % (dirname, byteLen))
     globals.outputln("-" * 68)
Ejemplo n.º 6
0
 def __printDirHeader (self, dirname, byteLen):
     dirname = globals.encodeName(dirname)
     globals.outputln("")
     globals.outputln("="*68)
     globals.outputln("%s (size: %d bytes)"%(dirname, byteLen))
     globals.outputln("-"*68)