From a50362300614164b935c4d1df674d77a041935c2 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Fri, 12 Jan 2018 17:59:32 +0100 Subject: [PATCH] oleobj: use ZipSubFile to allow OleFileIO to seek() --- oletools/oleobj.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oletools/oleobj.py b/oletools/oleobj.py index b91bbc7..a83ce9d 100644 --- a/oletools/oleobj.py +++ b/oletools/oleobj.py @@ -69,6 +69,7 @@ except ImportError: from oletools.thirdparty import xglob from oletools.ppt_record_parser import (is_ppt, PptFile, PptRecordExOleVbaActiveXAtom) +from oletools.ooxml import ZipSubFile # ----------------------------------------------------------------------------- # CHANGELOG: @@ -545,7 +546,7 @@ def find_ole(filename, data): if head == olefile.MAGIC: log.info(' unzipping ole: ' + subfile) - with zipper.open(subfile) as file_handle: + with ZipSubFile(zipper, subfile) as file_handle: ole = olefile.OleFileIO(file_handle) yield ole ole.close() -- libgit2 0.21.4