Skip to content

Commit

Permalink
apply fix for decalage2#422
Browse files Browse the repository at this point in the history
  • Loading branch information
decalage2 authored and bitsikas committed May 17, 2019
1 parent 02464ca commit 24763ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions oletools/olevba.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@
# 2019-01-01 PL: - removed support for Python 2.6
# 2019-03-18 PL: - added XLM/XLF macros detection for Excel OLE files
# 2019-03-25 CH: - added decryption of password-protected files
# 2019-04-09 PL: - decompress_stream accepts bytes (issue #422)

__version__ = '0.54'
__version__ = '0.54.1'

#------------------------------------------------------------------------------
# TODO:
Expand Down Expand Up @@ -1245,8 +1246,8 @@ def decompress_stream(compressed_container):
"""
Decompress a stream according to MS-OVBA section 2.4.1
compressed_container: string compressed according to the MS-OVBA 2.4.1.3.6 Compression algorithm
return the decompressed container as a string (bytes)
compressed_container: bytearray or bytes compressed according to the MS-OVBA 2.4.1.3.6 Compression algorithm
return the decompressed container as a bytes string
"""
# 2.4.1.2 State Variables

Expand All @@ -1268,9 +1269,10 @@ def decompress_stream(compressed_container):
# DecompressedChunkStart: The location of the first byte of the DecompressedChunk (section 2.4.1.1.3) within the
# DecompressedBuffer (section 2.4.1.1.2).

# Check the input is a bytearray:
# Check the input is a bytearray, otherwise convert it (assuming it's bytes):
if not isinstance(compressed_container, bytearray):
raise TypeError('decompress_stream requires a bytearray as input')
compressed_container = bytearray(compressed_container)
# raise TypeError('decompress_stream requires a bytearray as input')
decompressed_container = bytearray() # result
compressed_current = 0

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#--- METADATA -----------------------------------------------------------------

name = "oletools"
version = '0.54.0+001'
version = '0.54.1'
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"
long_desc = open('oletools/README.rst').read()
author = "Philippe Lagadec"
Expand Down

0 comments on commit 24763ac

Please sign in to comment.