Commit a50362300614164b935c4d1df674d77a041935c2

Authored by Christian Herdtweck
1 parent ea58877a

oleobj: use ZipSubFile to allow OleFileIO to seek()

Showing 1 changed file with 2 additions and 1 deletions
oletools/oleobj.py
... ... @@ -69,6 +69,7 @@ except ImportError:
69 69 from oletools.thirdparty import xglob
70 70 from oletools.ppt_record_parser import (is_ppt, PptFile,
71 71 PptRecordExOleVbaActiveXAtom)
  72 +from oletools.ooxml import ZipSubFile
72 73  
73 74 # -----------------------------------------------------------------------------
74 75 # CHANGELOG:
... ... @@ -545,7 +546,7 @@ def find_ole(filename, data):
545 546  
546 547 if head == olefile.MAGIC:
547 548 log.info(' unzipping ole: ' + subfile)
548   - with zipper.open(subfile) as file_handle:
  549 + with ZipSubFile(zipper, subfile) as file_handle:
549 550 ole = olefile.OleFileIO(file_handle)
550 551 yield ole
551 552 ole.close()
... ...