summaryrefslogtreecommitdiff
path: root/msodumper/xlsrecord.py
diff options
context:
space:
mode:
authorJean-Francois Dockes <jf@dockes.org>2014-01-09 08:20:21 +0100
committerKohei Yoshida <kohei.yoshida@gmail.com>2014-01-09 13:30:41 -0500
commit595542f5865f13aee61b161f468c4ee8b25cf6ad (patch)
tree88222a3928c9e91cfa2e1337302fbc3c21fa1a48 /msodumper/xlsrecord.py
parent2d4f7cf511275a7a6103bce1d75963354e7e14fa (diff)
Accept shorter BOF record
Diffstat (limited to 'msodumper/xlsrecord.py')
-rw-r--r--msodumper/xlsrecord.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/msodumper/xlsrecord.py b/msodumper/xlsrecord.py
index 0c55b60..ac070f4 100644
--- a/msodumper/xlsrecord.py
+++ b/msodumper/xlsrecord.py
@@ -627,16 +627,27 @@ class BOF(BaseRecordHandler):
self.buildYear = self.readUnsignedInt(2)
# file history flags
- self.flags = self.readUnsignedInt(4)
- self.win = (self.flags & 0x00000001)
- self.risc = (self.flags & 0x00000002)
- self.beta = (self.flags & 0x00000004)
- self.winAny = (self.flags & 0x00000008)
- self.macAny = (self.flags & 0x00000010)
- self.betaAny = (self.flags & 0x00000020)
- self.riscAny = (self.flags & 0x00000100)
- self.lowestExcelVer = self.readSignedInt(4)
-
+ try:
+ self.flags = self.readUnsignedInt(4)
+ self.win = (self.flags & 0x00000001)
+ self.risc = (self.flags & 0x00000002)
+ self.beta = (self.flags & 0x00000004)
+ self.winAny = (self.flags & 0x00000008)
+ self.macAny = (self.flags & 0x00000010)
+ self.betaAny = (self.flags & 0x00000020)
+ self.riscAny = (self.flags & 0x00000100)
+ self.lowestExcelVer = self.readSignedInt(4)
+ except:
+ self.flags = 0
+ self.win = 0
+ self.risc = 0
+ self.beta = 0
+ self.winAny = 0
+ self.macAny = 0
+ self.betaAny = 0
+ self.riscAny = 0
+ self.lowestExcelVer = 0
+
def parseBytes (self):
self.__parseBytes()
# BIFF version