Commit 9f71892c2534848e7dc693b61a4d03bae3e0fe34
1 parent
95f68f0b
msodde: fixed issue #202 (handling empty xml tags)
Showing
2 changed files
with
6 additions
and
4 deletions
oletools/msodde.py
| @@ -45,8 +45,9 @@ from __future__ import print_function | @@ -45,8 +45,9 @@ from __future__ import print_function | ||
| 45 | #------------------------------------------------------------------------------ | 45 | #------------------------------------------------------------------------------ |
| 46 | # CHANGELOG: | 46 | # CHANGELOG: |
| 47 | # 2017-10-18 v0.52 PL: - first version | 47 | # 2017-10-18 v0.52 PL: - first version |
| 48 | +# 2017-10-20 PL: - fixed issue #202 (handling empty xml tags) | ||
| 48 | 49 | ||
| 49 | -__version__ = '0.52dev1' | 50 | +__version__ = '0.52dev2' |
| 50 | 51 | ||
| 51 | #------------------------------------------------------------------------------ | 52 | #------------------------------------------------------------------------------ |
| 52 | # TODO: detect beginning/end of fields, to separate each field | 53 | # TODO: detect beginning/end of fields, to separate each field |
| @@ -107,8 +108,9 @@ def process_file(filepath): | @@ -107,8 +108,9 @@ def process_file(filepath): | ||
| 107 | # find all the tags 'w:instrText': | 108 | # find all the tags 'w:instrText': |
| 108 | # (each is a chunk of a DDE link) | 109 | # (each is a chunk of a DDE link) |
| 109 | for elem in root.iter(TAG_W_INSTRTEXT): | 110 | for elem in root.iter(TAG_W_INSTRTEXT): |
| 110 | - # concatenate the text of the field: | ||
| 111 | - text += elem.text | 111 | + # concatenate the text of the field, if present: |
| 112 | + if elem.text is not None: | ||
| 113 | + text += elem.text | ||
| 112 | return text | 114 | return text |
| 113 | 115 | ||
| 114 | 116 |
setup.py
| @@ -42,7 +42,7 @@ import os, fnmatch | @@ -42,7 +42,7 @@ import os, fnmatch | ||
| 42 | #--- METADATA ----------------------------------------------------------------- | 42 | #--- METADATA ----------------------------------------------------------------- |
| 43 | 43 | ||
| 44 | name = "oletools" | 44 | name = "oletools" |
| 45 | -version = '0.52dev1' | 45 | +version = '0.52dev2' |
| 46 | desc = "Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response #DFIR" | 46 | desc = "Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response #DFIR" |
| 47 | long_desc = open('oletools/README.rst').read() | 47 | long_desc = open('oletools/README.rst').read() |
| 48 | author = "Philippe Lagadec" | 48 | author = "Philippe Lagadec" |