Commit 433f234ff872a59fb6af5c10f9c4876a8c7002d0

Authored by decalage2
1 parent 3681c317

olefile: ignore incorrect ByteOrder (issue #182)

oletools/thirdparty/olefile/olefile.py
@@ -198,9 +198,10 @@ from __future__ import print_function # This version of olefile requires Pytho @@ -198,9 +198,10 @@ from __future__ import print_function # This version of olefile requires Pytho
198 # 2017-05-31 v0.45 BS: - PR #114 from oletools to handle excessive number of 198 # 2017-05-31 v0.45 BS: - PR #114 from oletools to handle excessive number of
199 # properties: 199 # properties:
200 # https://github.com/decalage2/oletools/pull/114 200 # https://github.com/decalage2/oletools/pull/114
  201 +# 2017-07-11 PL: - ignore incorrect ByteOrder (issue #70)
201 202
202 -__date__ = "2017-05-31"  
203 -__version__ = '0.45dev1' 203 +__date__ = "2017-07-11"
  204 +__version__ = '0.45dev2'
204 __author__ = "Philippe Lagadec" 205 __author__ = "Philippe Lagadec"
205 206
206 #----------------------------------------------------------------------------- 207 #-----------------------------------------------------------------------------
@@ -277,7 +278,7 @@ __author__ = "Philippe Lagadec" @@ -277,7 +278,7 @@ __author__ = "Philippe Lagadec"
277 __all__ = ['isOleFile', 'OleFileIO', 'OleMetadata', 'enable_logging', 278 __all__ = ['isOleFile', 'OleFileIO', 'OleMetadata', 'enable_logging',
278 'MAGIC', 'STGTY_EMPTY', 279 'MAGIC', 'STGTY_EMPTY',
279 'STGTY_STREAM', 'STGTY_STORAGE', 'STGTY_ROOT', 'STGTY_PROPERTY', 280 'STGTY_STREAM', 'STGTY_STORAGE', 'STGTY_ROOT', 'STGTY_PROPERTY',
280 - 'STGTY_LOCKBYTES', 'MINIMAL_OLEFILE_SIZE',] 281 + 'STGTY_LOCKBYTES', 'MINIMAL_OLEFILE_SIZE', 'NOSTREAM']
281 282
282 import io 283 import io
283 import sys 284 import sys
@@ -1395,7 +1396,7 @@ class OleFileIO: @@ -1395,7 +1396,7 @@ class OleFileIO:
1395 log.debug( "Byte Order = %X (expected: FFFE)" % self.byte_order ) 1396 log.debug( "Byte Order = %X (expected: FFFE)" % self.byte_order )
1396 if self.byte_order != 0xFFFE: 1397 if self.byte_order != 0xFFFE:
1397 # For now only common little-endian documents are handled correctly 1398 # For now only common little-endian documents are handled correctly
1398 - self._raise_defect(DEFECT_FATAL, "incorrect ByteOrder in OLE header") 1399 + self._raise_defect(DEFECT_INCORRECT, "incorrect ByteOrder in OLE header")
1399 # TODO: add big-endian support for documents created on Mac ? 1400 # TODO: add big-endian support for documents created on Mac ?
1400 # But according to [MS-CFB] ? v20140502, ByteOrder MUST be 0xFFFE. 1401 # But according to [MS-CFB] ? v20140502, ByteOrder MUST be 0xFFFE.
1401 self.sector_size = 2**self.sector_shift 1402 self.sector_size = 2**self.sector_shift