Commit 9f149ddb207e093361ac0e9e15789698875426ea

Authored by Christian Herdtweck
1 parent f5da9315

warn at logging.WARNING level if loading of vba module failed

Showing 1 changed file with 6 additions and 3 deletions
oletools/olevba.py
... ... @@ -1533,6 +1533,9 @@ def _extract_vba(ole, vba_root, project_path, dir_path):
1533 1533 .format(uni_out(stream_name), ioe))
1534 1534  
1535 1535 if code_data is None:
  1536 + log.warning("Could not find module {}!"
  1537 + .format('/'.join(uni_out(stream_name)
  1538 + for stream_name in try_names)))
1536 1539 continue
1537 1540  
1538 1541 log.debug("length of code_data = {0}".format(len(code_data)))
... ... @@ -1554,9 +1557,9 @@ def _extract_vba(ole, vba_root, project_path, dir_path):
1554 1557 else:
1555 1558 log.warning("module stream {0} has code data length 0".format(modulestreamname_streamname))
1556 1559 except Exception as exc:
1557   - log.info('Error parsing module {} of {} in _extract_vba:'
1558   - .format(projectmodule_index, projectmodules_count),
1559   - exc_info=True)
  1560 + log.warning('Error parsing module {} of {} in _extract_vba:'
  1561 + .format(projectmodule_index, projectmodules_count),
  1562 + exc_info=True)
1560 1563 _ = unused # make pylint happy: now variable "unused" is being used ;-)
1561 1564 return
1562 1565  
... ...