Beispiel #1
0
 def read (self):
     byteorder = self.strm.readUnsignedInt(2)
     if byteorder != 0xFFFE:
         raise PropertySetStreamError()
     ver = self.strm.readUnsignedInt(2)
     globals.outputln("version: 0x%4.4X"%ver)
     sID = self.strm.readUnsignedInt(4)
     globals.outputln("system identifier: 0x%4.4X"%sID)
     clsID = self.strm.readBytes(16)
     globals.outputln("CLS ID: %s"%globals.getRawBytes(clsID, True, False))
     sets = self.strm.readUnsignedInt(4)
     globals.outputln("number of property sets: 0x%4.4X"%sets)
     fmtID0 = self.strm.readBytes(16)
     globals.outputln("FMT ID 0: %s"%globals.getRawBytes(fmtID0, True, False))
     offset0 = self.strm.readUnsignedInt(4)
     globals.outputln("offset 0: 0x%4.4X"%offset0)
     if sets > 1:
         fmtID1 = self.strm.readBytes(16)
         globals.outputln("FMT ID 1: %s"%globals.getRawBytes(fmtID0, True, False))
         offset1 = self.strm.readUnsignedInt(4)
         globals.outputln("offset 1: 0x%4.4X\n"%offset1)
     self.readSet(offset0)
     if sets > 1:
         self.strm.setCurrentPos(offset1);
         self.readSet(offset1)
Beispiel #2
0
 def read(self):
     byteorder = self.strm.readUnsignedInt(2)
     if byteorder != 0xFFFE:
         raise PropertySetStreamError()
     ver = self.strm.readUnsignedInt(2)
     globals.outputln("version: 0x%4.4X" % ver)
     sID = self.strm.readUnsignedInt(4)
     globals.outputln("system identifier: 0x%4.4X" % sID)
     clsID = self.strm.readBytes(16)
     globals.outputln("CLS ID: %s" %
                      globals.getRawBytes(clsID, True, False))
     sets = self.strm.readUnsignedInt(4)
     globals.outputln("number of property sets: 0x%4.4X" % sets)
     fmtID0 = self.strm.readBytes(16)
     globals.outputln("FMT ID 0: %s" %
                      globals.getRawBytes(fmtID0, True, False))
     offset0 = self.strm.readUnsignedInt(4)
     globals.outputln("offset 0: 0x%4.4X" % offset0)
     if sets > 1:
         fmtID1 = self.strm.readBytes(16)
         globals.outputln("FMT ID 1: %s" %
                          globals.getRawBytes(fmtID0, True, False))
         offset1 = self.strm.readUnsignedInt(4)
         globals.outputln("offset 1: 0x%4.4X\n" % offset1)
     self.readSet(offset0)
     if sets > 1:
         self.strm.setCurrentPos(offset1)
         self.readSet(offset1)
Beispiel #3
0
    def read(self):
        ver = self.strm.readUnsignedInt(4)
        globals.outputln("version: 0x%8.8X" % ver)
        flags = self.strm.readUnsignedInt(4)
        globals.outputln("flags: %d" % flags)
        linkUpdateOption = self.strm.readUnsignedInt(4)
        globals.outputln("link update option: %d" % linkUpdateOption)
        reserved = self.strm.readUnsignedInt(4)
        globals.outputln("")

        # Reserved moniker (must be ignored)
        monikerSize = self.strm.readUnsignedInt(4)
        if monikerSize > 0:
            strm = MonikerStream(self.strm.readBytes(monikerSize + 16))
            strm.read()

        # Relative source moniker (relative path to the linked object)
        monikerSize = self.strm.readUnsignedInt(4)
        if monikerSize > 0:
            strm = MonikerStream(self.strm.readBytes(monikerSize + 16))
            strm.read()

        # Absolute source moniker (absolute path to the linked object)
        monikerSize = self.strm.readUnsignedInt(4)
        if monikerSize > 0:
            strm = MonikerStream(self.strm.readBytes(monikerSize + 16))
            strm.read()

        clsIDIndicator = self.strm.readSignedInt(4)
        globals.outputln("cls ID indicator: %d" % clsIDIndicator)
        clsID = self.strm.readBytes(16)
        globals.outputln("CLS ID: %s" %
                         globals.getRawBytes(clsID, True, False))
Beispiel #4
0
    def read (self):
        ver = self.strm.readUnsignedInt(4)
        globals.outputln("version: 0x%8.8X"%ver)
        flags = self.strm.readUnsignedInt(4)
        globals.outputln("flags: %d"%flags)
        linkUpdateOption = self.strm.readUnsignedInt(4)
        globals.outputln("link update option: %d"%linkUpdateOption)
        reserved = self.strm.readUnsignedInt(4)
        globals.outputln("")

        # Reserved moniker (must be ignored)
        monikerSize = self.strm.readUnsignedInt(4)
        if monikerSize > 0:
            strm = MonikerStream(self.strm.readBytes(monikerSize+16))
            strm.read()

        # Relative source moniker (relative path to the linked object)
        monikerSize = self.strm.readUnsignedInt(4)
        if monikerSize > 0:
            strm = MonikerStream(self.strm.readBytes(monikerSize+16))
            strm.read()

        # Absolute source moniker (absolute path to the linked object)
        monikerSize = self.strm.readUnsignedInt(4)
        if monikerSize > 0:
            strm = MonikerStream(self.strm.readBytes(monikerSize+16))
            strm.read()

        clsIDIndicator = self.strm.readSignedInt(4)
        globals.outputln("cls ID indicator: %d"%clsIDIndicator)
        clsID = self.strm.readBytes(16)
        globals.outputln("CLS ID: %s"%globals.getRawBytes(clsID, True, False))
Beispiel #5
0
 def read (self):
     globals.outputln("moniker size: %d"%(len(self.strm.bytes)-16))
     clsID = self.strm.readBytes(16)
     globals.outputln("CLS ID: %s"%globals.getRawBytes(clsID, True, False))
     globals.outputln("stream data (implemention specific):")
     globals.dumpBytes(self.strm.readRemainingBytes())
     globals.outputln("")
Beispiel #6
0
 def read (self):
     print ("moniker size: %d"%(len(self.strm.bytes)-16))
     clsID = self.strm.readBytes(16)
     print ("CLS ID: %s"%globals.getRawBytes(clsID, True, False))
     print ("stream data (implemention specific):")
     globals.dumpBytes(self.strm.readRemainingBytes())
     print ("")
Beispiel #7
0
    def createDOM(self, wb):
        nd = node.Element('formula-cell')
        if self.tokens != None:
            parser = formula.FormulaParser(None, self.tokens)
            parser.parse()
            nd.setAttr('formula', parser.getText())
            s = globals.getRawBytes(self.tokens, True, False)
            nd.setAttr('token-bytes', s)
            if self.cachedResult != None:
                nd.setAttr('formula-result', self.cachedResult)

        return nd
Beispiel #8
0
    def createDOM (self, wb):
        nd = node.Element('formula-cell')
        if self.tokens != None:
            parser = formula.FormulaParser(None, self.tokens)
            parser.parse()
            nd.setAttr('formula', parser.getText())
            s = globals.getRawBytes(self.tokens, True, False)
            nd.setAttr('token-bytes', s)
            if self.cachedResult != None:
                nd.setAttr('formula-result', self.cachedResult)

        return nd
Beispiel #9
0
    def createDOM (self, wb):
        nd = node.Element('formula-cell')
        if self.tokens != None:
            parser = formula.FormulaParser(None, self.tokens)
            try:
                parser.parse()
                nd.setAttr('formula', parser.getText())
            except:
                if not globals.params.catchExceptions:
                    raise
                pass
            s = globals.getRawBytes(self.tokens, True, False)
            nd.setAttr('token-bytes', s)
            if self.cachedResult != None:
                nd.setAttr('formula-result', self.cachedResult)

        return nd
Beispiel #10
0
    def createDOM(self, wb):
        nd = node.Element('formula-cell')
        if self.tokens != None:
            parser = formula.FormulaParser(None, self.tokens)
            try:
                parser.parse()
                nd.setAttr('formula', parser.getText())
            except:
                if not globals.params.catchExceptions:
                    raise
                pass
            s = globals.getRawBytes(self.tokens, True, False)
            nd.setAttr('token-bytes', s)
            if self.cachedResult != None:
                nd.setAttr('formula-result', self.cachedResult)

        return nd