diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-04 17:04:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-04 17:04:32 +0100 |
commit | 3d44b9bd4d980508cac74bcb36eb4bf2d2f24b31 (patch) | |
tree | 07dd0eaf6215634dbd1edf36a976f85cfd8f2a58 | |
parent | f1c33abd03aa5bbc9098ebe9c62248ef5e77ae69 (diff) |
docrecord: dump PropertyBag
-rw-r--r-- | msodumper/docrecord.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/msodumper/docrecord.py b/msodumper/docrecord.py index 6468346..bf315e1 100644 --- a/msodumper/docrecord.py +++ b/msodumper/docrecord.py @@ -4209,6 +4209,42 @@ class PropertyBagStore(DOCDirStream): self.stringTable.append(string) print '</stringTable>' print '</propBagStore>' + self.parent.pos = self.pos + + +class Property(DOCDirStream): + """Specified by [MS-OSHARED] 2.3.4.4, specifies the indexes into the string + table entries of the stringTable field.""" + def __init__(self, parent, index): + DOCDirStream.__init__(self, parent.bytes) + self.parent = parent + self.pos = parent.pos + self.index = index + + def dump(self): + print '<property type="Property" offset="%s" index="%s">' % (self.pos, self.index) + self.printAndSet("keyIndex", self.readuInt32(), hexdump=False) + self.printAndSet("valueIndex", self.readuInt32(), hexdump=False) + print '</property>' + self.parent.pos = self.pos + + +class PropertyBag(DOCDirStream): + """Specified by [MS-OSHARED] 2.3.4.3, specifies the smart tag data.""" + def __init__(self, parent): + DOCDirStream.__init__(self, parent.bytes) + self.parent = parent + self.pos = parent.pos + + def dump(self): + print '<propBag type="PropertyBag" offset="%s">' % self.pos + self.printAndSet("id", self.readuInt16()) + self.printAndSet("cProp", self.readuInt16()) + self.printAndSet("cbUnknown", self.readuInt16()) + for i in range(self.cProp): + Property(self, i).dump() + print '</propBag>' + self.parent.pos = self.pos class SmartTagData(DOCDirStream): @@ -4223,6 +4259,9 @@ class SmartTagData(DOCDirStream): print '<smartTagData type="SmartTagData" offset="%d" size="%d bytes">' % (self.pos, self.size) self.propBagStore = PropertyBagStore(self) self.propBagStore.dump() + # TODO this is an array in fact + self.propBag = PropertyBag(self) + self.propBag.dump() print '</smartTagData>' |