From 9d2795aa1a3b3af0d7255da9b63e7171e65af843 Mon Sep 17 00:00:00 2001 From: Vincent Brillault Date: Wed, 23 May 2018 00:04:49 +0200 Subject: [PATCH] WIP: oleform: implement other types of stored controls --- oletools/oleform.py | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 158 insertions(+), 3 deletions(-) diff --git a/oletools/oleform.py b/oletools/oleform.py index 775543e..e368a20 100644 --- a/oletools/oleform.py +++ b/oletools/oleform.py @@ -52,6 +52,52 @@ class MorphDataPropMask(Mask): 'fBorderColor', 'fSpecialEffect', 'fMouseIcon', 'fPicture', 'fAccelerator', 'UnusedBits2', 'Reserved', 'fGroupName'] +class ImagePropMask(Mask): + """ImagePropMask: [MS-OFORMS] 2.2.3.2""" + _size = 15 + _names = ['UnusedBits1_1', 'UnusedBits1_2', 'fAutoSize', 'fBorderColor', 'fBackColor', + 'fBorderStyle', 'fMousePointer', 'fPictureSizeMode', 'fSpecialEffect', 'fSize', + 'fPicture', 'fPictureAlignment', 'fPictureTiling', 'fVariousPropertyBits', + 'fMouseIcon'] + +class CommandButtonPropMask(Mask): + """CommandButtonPropMask: [MS-OFORMS] 2.2.1.2""" + _size = 11 + _names = ['fForeColor', 'fBackColor', 'fVariousPropertyBits', 'fCaption', 'fPicturePosition', + 'fSize', 'fMousePointer', 'fPicture', 'fAccelerator', 'fTakeFocusOnClick', + 'fMouseIcon'] + +class SpinButtonPropMask(Mask): + """SpinButtonPropMask: [MS-OFORMS] 2.2.8.2""" + _size = 15 + _names = ['fForeColor', 'fBackColor', 'fVariousPropertyBits', 'fSize', 'UnusedBits1', + 'fMin', 'fMax', 'fPosition', 'fPrevEnabled', 'fNextEnabled', 'fSmallChange', + 'fOrientation', 'fDelay', 'fMouseIcon', 'fMousePointer'] + +class TabStripPropMask(Mask): + """TabStripPropMask: [MS-OFORMS] 2.2.9.2""" + _size = 25 + _names = ['fListIndex', 'fBackColor', 'fForeColor', 'Unused1', 'fSize', 'fItems', + 'fMousePointer', 'Unused2', 'fTabOrientation', 'fTabStyle', 'fMultiRow', + 'fTabFixedWidth', 'fTabFixedHeight', 'fTooltips', 'Unused3', 'fTipStrings', + 'Unused4', 'fNames', 'fVariousPropertyBits', 'fNewVersion', 'fTabsAllocated', + 'fTags', 'fTabData', 'fAccelerator', 'fMouseIcon'] + +class LabelPropMask(Mask): + """LabelPropMask: [MS-OFORMS] 2.2.4.2""" + _size = 13 + _names = ['fForeColor', 'fBackColor', 'fVariousPropertyBits', 'fCaption', + 'fPicturePosition', 'fSize', 'fMousePointer', 'fBorderColor', 'fBorderStyle', + 'fSpecialEffect', 'fPicture', 'fAccelerator', 'fMouseIcon'] + +class ScrollBarPropMask(Mask): + """ScrollBarPropMask: [MS-OFORMS] 2.2.7.2""" + _size = 17 + _names = ['fForeColor', 'fBackColor', 'fVariousPropertyBits', 'fSize', 'fMousePointer', + 'fMin', 'fMax', 'fPosition', 'UnusedBits1', 'fPrevEnabled', 'fNextEnabled', + 'fSmallChange', 'fLargeChange', 'fOrientation', 'fProportionalThumb', + 'fDelay', 'fMouseIcon'] + class ExtendedStream(object): def __init__(self, stream, path): self._pos = 0 @@ -287,16 +333,125 @@ def consume_MorphDataControl(stream): consume_TextProps(stream) return value +def consume_ImageControl(stream): + # ImageControl: [MS-OFORMS] 2.2.3.1 + stream.check_values('ImageControl (versions)', '