Skip to content

Commit

Permalink
v0.27.11
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElementalOfDestruction committed Jan 1, 2021
1 parent 1218aa0 commit 98408f4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions extract_msg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__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

Expand Down
22 changes: 12 additions & 10 deletions extract_msg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,32 +455,34 @@ def parseType(_type, stream, encoding, extras):
return ret
elif _type == 0x1102:
ret = copy.deepcopy(extras)
lengths = [struct.unpack('<i', stream[pos*8:(pos+1)*8]) for pos in range(len(stream) // 8)]
lengths = tuple(struct.unpack('<i', stream[pos*8:(pos+1)*8]) for pos in range(len(stream) // 8))
length_lengths = len(lengths)
if length_lengths > 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))
for x, y in enumerate(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
Expand Down

0 comments on commit 98408f4

Please sign in to comment.