Commit a50362300614164b935c4d1df674d77a041935c2
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,6 +69,7 @@ except ImportError: | ||
| 69 | from oletools.thirdparty import xglob | 69 | from oletools.thirdparty import xglob |
| 70 | from oletools.ppt_record_parser import (is_ppt, PptFile, | 70 | from oletools.ppt_record_parser import (is_ppt, PptFile, |
| 71 | PptRecordExOleVbaActiveXAtom) | 71 | PptRecordExOleVbaActiveXAtom) |
| 72 | +from oletools.ooxml import ZipSubFile | ||
| 72 | 73 | ||
| 73 | # ----------------------------------------------------------------------------- | 74 | # ----------------------------------------------------------------------------- |
| 74 | # CHANGELOG: | 75 | # CHANGELOG: |
| @@ -545,7 +546,7 @@ def find_ole(filename, data): | @@ -545,7 +546,7 @@ def find_ole(filename, data): | ||
| 545 | 546 | ||
| 546 | if head == olefile.MAGIC: | 547 | if head == olefile.MAGIC: |
| 547 | log.info(' unzipping ole: ' + subfile) | 548 | log.info(' unzipping ole: ' + subfile) |
| 548 | - with zipper.open(subfile) as file_handle: | 549 | + with ZipSubFile(zipper, subfile) as file_handle: |
| 549 | ole = olefile.OleFileIO(file_handle) | 550 | ole = olefile.OleFileIO(file_handle) |
| 550 | yield ole | 551 | yield ole |
| 551 | ole.close() | 552 | ole.close() |