From a51513585117fedab6bc8c37a58a674ec26ae0a5 Mon Sep 17 00:00:00 2001 From: Vincent Brillault Date: Wed, 23 May 2018 20:38:50 +0200 Subject: [PATCH] FormSiteData: jump to the end of the object in any case --- oletools/oleform.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/oletools/oleform.py b/oletools/oleform.py index 5b83750..20c4847 100644 --- a/oletools/oleform.py +++ b/oletools/oleform.py @@ -277,11 +277,12 @@ def consume_FormControl(stream): consume_SiteClassInfo(stream) (CountOfSites, CountOfBytes) = stream.unpacks(' 0: - remaining_SiteDepthsAndTypes -= consume_FormObjectDepthTypeCount(stream) - for i in range(CountOfSites): - yield consume_OleSiteConcreteControl(stream) + with stream.will_jump_to(CountOfBytes): + with stream.will_pad(): + while remaining_SiteDepthsAndTypes > 0: + remaining_SiteDepthsAndTypes -= consume_FormObjectDepthTypeCount(stream) + for i in range(CountOfSites): + yield consume_OleSiteConcreteControl(stream) def consume_MorphDataControl(stream): # MorphDataControl: [MS-OFORMS] 2.2.5.1 -- libgit2 0.21.4