From 98408f401097d8ba9e4d25adc931b538dbd537f0 Mon Sep 17 00:00:00 2001 From: TheElementalOfDestruction Date: Fri, 1 Jan 2021 00:18:29 -0800 Subject: [PATCH] v0.27.11 --- CHANGELOG.md | 3 +++ README.rst | 4 ++-- extract_msg/__init__.py | 4 ++-- extract_msg/utils.py | 22 ++++++++++++---------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e94bed..30e78544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +**v0.27.11** +* [[TeamMsgExtractor #173](https://github.com/TeamMsgExtractor/msg-extractor/issues/173)] Tentatively implemented type 0x1014 (PtypMultipleInteger64). Apparently I forgot to do it earlier. + **v0.27.10** * [[TeamMsgExtractor #162](https://github.com/TeamMsgExtractor/msg-extractor/issues/162)] Fixed line endings in the wrapper script to be UNIX line endings rather than Windows line endings. Attempted to add the execution flag to the runnable script. diff --git a/README.rst b/README.rst index 0040ff5a..23f870b0 100644 --- a/README.rst +++ b/README.rst @@ -180,8 +180,8 @@ Credits .. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg :target: LICENSE.txt -.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.27.10-blue.svg - :target: https://pypi.org/project/extract-msg/0.27.10/ +.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.27.11-blue.svg + :target: https://pypi.org/project/extract-msg/0.27.11/ .. |PyPI1| image:: https://img.shields.io/badge/python-2.7+-brightgreen.svg :target: https://www.python.org/downloads/release/python-2715/ diff --git a/extract_msg/__init__.py b/extract_msg/__init__.py index 1d134cc0..28685e73 100644 --- a/extract_msg/__init__.py +++ b/extract_msg/__init__.py @@ -27,8 +27,8 @@ # along with this program. If not, see . __author__ = 'The Elemental of Destruction & Matthew Walker' -__date__ = '2020-12-22' -__version__ = '0.27.10' +__date__ = '2021-01-01' +__version__ = '0.27.11' import logging diff --git a/extract_msg/utils.py b/extract_msg/utils.py index d4d25bcb..fe88db2b 100644 --- a/extract_msg/utils.py +++ b/extract_msg/utils.py @@ -455,7 +455,7 @@ def parseType(_type, stream, encoding, extras): return ret elif _type == 0x1102: ret = copy.deepcopy(extras) - lengths = [struct.unpack(' length_extras: logger.warning('Error while parsing multiple type. Expected {} stream{}, got {}. Ignoring.'.format(length_lengths, 's' if length_lengths > 1 or length_lengths == 0 else '', length_extras)) @@ -463,24 +463,26 @@ def parseType(_type, stream, encoding, extras): if lengths[x] != len(y): logger.warning('Error while parsing multiple type. Expected length {}, got {}. Ignoring.'.format(lengths[x], len(y))) return ret - elif _type in (0x1002, 0x1003, 0x1004, 0x1005, 0x1007, 0x1040, 0x1048): + elif _type in (0x1002, 0x1003, 0x1004, 0x1005, 0x1007, 0x1014, 0x1040, 0x1048): if stream != len(extras): logger.warning('Error while parsing multiple type. Expected {} entr{}, got {}. Ignoring.'.format(stream, ('y' if stream == 1 else 'ies'), len(extras))) if _type == 0x1002: - return [constants.STMI16.unpack(x)[0] for x in extras] + return tuple(constants.STMI16.unpack(x)[0] for x in extras) if _type == 0x1003: - return [constants.STMI32.unpack(x)[0] for x in extras] + return tuple(constants.STMI32.unpack(x)[0] for x in extras) if _type == 0x1004: - return [constants.STMF32.unpack(x)[0] for x in extras] + return tuple(constants.STMF32.unpack(x)[0] for x in extras) if _type == 0x1005: - return [constants.STMF64.unpack(x)[0] for x in extras] + return tuple(constants.STMF64.unpack(x)[0] for x in extras) if _type == 0x1007: - values = [constants.STMF64.unpack(x)[0] for x in extras] - raise NotImplementedError('Parsing for type 0x1007 has not yet been implmented. If you need this type, please create a new issue labeled "NotImplementedError: parseType 0x1007"') + values = tuple(constants.STMF64.unpack(x)[0] for x in extras) + raise NotImplementedError('Parsing for type 0x1007 has not yet een implmented. If you need this type, please create a new issue labeled "NotImplementedError: parseType 0x1007"') + if _type == 0x1014: + return tuple(constants.STMI64.unpack(x)[0] for x in extras) if _type == 0x1040: - return [msgEpoch(constants.ST3.unpack(x)[0]) for x in extras] + return tuple(msgEpoch(constants.ST3.unpack(x)[0]) for x in extras) if _type == 0x1048: - return [bytesToGuid(x) for x in extras] + return tuple(bytesToGuid(x) for x in extras) else: raise NotImplementedError('Parsing for type {} has not yet been implmented. If you need this type, please create a new issue labeled "NotImplementedError: parseType {}"'.format(_type, _type)) return value