Commit 9914890588fe7ab9ffdc28648cc6684150860b4f
1 parent
62940506
rtfobj: fixed issue #280, OLE Package detection did not work on Python 3. Also a…
…dded python version to banner.
Showing
2 changed files
with
7 additions
and
4 deletions
oletools/rtfobj.py
| @@ -79,8 +79,9 @@ http://www.decalage.info/python/oletools | @@ -79,8 +79,9 @@ http://www.decalage.info/python/oletools | ||
| 79 | # 2017-09-06 PL: - fixed issue #196: \pxe is not a destination | 79 | # 2017-09-06 PL: - fixed issue #196: \pxe is not a destination |
| 80 | # 2018-01-11 CH: - speedup RTF parsing (PR #244) | 80 | # 2018-01-11 CH: - speedup RTF parsing (PR #244) |
| 81 | # 2018-02-01 JRM: - fixed issue #251: \bin without argument | 81 | # 2018-02-01 JRM: - fixed issue #251: \bin without argument |
| 82 | +# 2018-04-09 PL: - fixed issue #280: OLE Package were not detected on Python 3 | ||
| 82 | 83 | ||
| 83 | -__version__ = '0.52' | 84 | +__version__ = '0.52.5' |
| 84 | 85 | ||
| 85 | # ------------------------------------------------------------------------------ | 86 | # ------------------------------------------------------------------------------ |
| 86 | # TODO: | 87 | # TODO: |
| @@ -664,7 +665,7 @@ class RtfObjParser(RtfParser): | @@ -664,7 +665,7 @@ class RtfObjParser(RtfParser): | ||
| 664 | rtfobj.oledata_size = obj.data_size | 665 | rtfobj.oledata_size = obj.data_size |
| 665 | rtfobj.oledata = obj.data | 666 | rtfobj.oledata = obj.data |
| 666 | rtfobj.is_ole = True | 667 | rtfobj.is_ole = True |
| 667 | - if obj.class_name.lower() == 'package': | 668 | + if obj.class_name.lower() == b'package': |
| 668 | opkg = oleobj.OleNativeStream(bindata=obj.data, | 669 | opkg = oleobj.OleNativeStream(bindata=obj.data, |
| 669 | package=True) | 670 | package=True) |
| 670 | rtfobj.filename = opkg.filename | 671 | rtfobj.filename = opkg.filename |
| @@ -904,7 +905,9 @@ def process_file(container, filename, data, output_dir=None, save_object=False): | @@ -904,7 +905,9 @@ def process_file(container, filename, data, output_dir=None, save_object=False): | ||
| 904 | 905 | ||
| 905 | def main(): | 906 | def main(): |
| 906 | # print banner with version | 907 | # print banner with version |
| 907 | - print ('rtfobj %s - http://decalage.info/python/oletools' % __version__) | 908 | + python_version = '%d.%d.%d' % sys.version_info[0:3] |
| 909 | + print ('rtfobj %s on Python %s - http://decalage.info/python/oletools' % | ||
| 910 | + (__version__, python_version)) | ||
| 908 | print ('THIS IS WORK IN PROGRESS - Check updates regularly!') | 911 | print ('THIS IS WORK IN PROGRESS - Check updates regularly!') |
| 909 | print ('Please report any issue at https://github.com/decalage2/oletools/issues') | 912 | print ('Please report any issue at https://github.com/decalage2/oletools/issues') |
| 910 | print ('') | 913 | print ('') |
setup.py
| @@ -43,7 +43,7 @@ import os, fnmatch | @@ -43,7 +43,7 @@ import os, fnmatch | ||
| 43 | #--- METADATA ----------------------------------------------------------------- | 43 | #--- METADATA ----------------------------------------------------------------- |
| 44 | 44 | ||
| 45 | name = "oletools" | 45 | name = "oletools" |
| 46 | -version = '0.52.4' | 46 | +version = '0.52.5' |
| 47 | 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 | 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" |
| 48 | long_desc = open('oletools/README.rst').read() | 48 | long_desc = open('oletools/README.rst').read() |
| 49 | author = "Philippe Lagadec" | 49 | author = "Philippe Lagadec" |