Commit d57401a88787cb6bab309f569ddf8fa2783abb0b

Authored by Vincent Brillault
1 parent 20ca1d2c

oleform: add support for Form, Frame & MultiPage

From tests, these controls are in fact possible to see in the f stream.
Their childs will be part of sub stream, with a path containing the
id of the object
Showing 1 changed file with 3 additions and 3 deletions
oletools/oleform.py
... ... @@ -443,11 +443,11 @@ def extract_OleFormVariables(ole_file, stream_dir):
443 443 for var in variables:
444 444 # See FormEmbeddedActiveXControlCached for type definition: [MS-OFORMS] 2.4.5
445 445 if var['ClsidCacheIndex'] == 7:
446   - raise OleFormParsingError('Malformed document: Forms should be stored in the f stream')
  446 + consume_FormControl(data)
447 447 elif var['ClsidCacheIndex'] == 12:
448 448 consume_ImageControl(data)
449 449 elif var['ClsidCacheIndex'] == 14:
450   - raise OleFormParsingError('Malformed document: Frames should be stored in the f stream')
  450 + consume_FormControl(data)
451 451 elif var['ClsidCacheIndex'] in [15, 23, 24, 25, 26, 27, 28]:
452 452 var['value'] = consume_MorphDataControl(data)
453 453 elif var['ClsidCacheIndex'] == 16:
... ... @@ -461,7 +461,7 @@ def extract_OleFormVariables(ole_file, stream_dir):
461 461 elif var['ClsidCacheIndex'] == 47:
462 462 consume_ScrollBarControl(data)
463 463 elif var['ClsidCacheIndex'] == 57:
464   - raise OleFormParsingError('Malformed document: MultiPages should be stored in a x stream')
  464 + consume_FormControl(data)
465 465 else:
466 466 # TODO: use logging instead of print
467 467 print('ERROR: Unsupported stored type in user form: {0}'.format(str(var['ClsidCacheIndex'])))
... ...