Commit 518dae05402502523dd4ef523781f67142893669

Authored by Philippe Lagadec
1 parent ebdb4e2d

olevba: fix for issue #3 (exception when module name="text")

Showing 1 changed file with 3 additions and 2 deletions
oletools/olevba.py
... ... @@ -99,8 +99,9 @@ https://github.com/unixfreak0037/officeparser
99 99 # - fixed issue #2, decoding VBA stream names using
100 100 # specified codepage and unicode stream names
101 101 # 2015-01-11 v0.15 PL: - added new triage mode, options -t and -d
  102 +# 2015-01-16 v0.16 PL: - fix for issue #3 (exception when module name="text")
102 103  
103   -__version__ = '0.15'
  104 +__version__ = '0.16'
104 105  
105 106 #------------------------------------------------------------------------------
106 107 # TODO:
... ... @@ -758,7 +759,7 @@ def _extract_vba (ole, vba_root, project_path, dir_path):
758 759 code_data = code_data[MODULEOFFSET_TextOffset:]
759 760 if len(code_data) > 0:
760 761 code_data = decompress_stream(code_data)
761   - filext = code_modules[MODULENAME_ModuleName]
  762 + filext = code_modules.get(MODULENAME_ModuleName, 'bin')
762 763 filename = '{0}.{1}'.format(MODULENAME_ModuleName, filext)
763 764 yield (code_path, filename, code_data)
764 765 # print '-'*79
... ...