Commit 2ed0a9b673af308371e5c59192305fb5ee9ab398

Authored by decalage2
1 parent 3247071f

olevba: fixed issue #122 Chr() with negative numbers

Showing 1 changed file with 3 additions and 2 deletions
oletools/olevba.py
... ... @@ -194,8 +194,9 @@ from __future__ import print_function
194 194 # 2017-03-16 PL: - fixed issues #148 and #149 for option --reveal
195 195 # 2017-05-19 PL: - added enable_logging to fix issue #154
196 196 # 2017-05-31 c1fe: - PR #135 fixing issue #132 for some Mac files
  197 +# 2017-06-08 PL: - fixed issue #122 Chr() with negative numbers
197 198  
198   -__version__ = '0.51dev9'
  199 +__version__ = '0.51dev10'
199 200  
200 201 #------------------------------------------------------------------------------
201 202 # TODO:
... ... @@ -769,7 +770,7 @@ class VbaExpressionString(str):
769 770 # NOTE: here Combine() is required to avoid spaces between elements
770 771 # NOTE: here WordStart is necessary to avoid matching a number preceded by
771 772 # letters or underscore (e.g. "VBT1" or "ABC_34"), when using scanString
772   -decimal_literal = Combine(WordStart(vba_identifier_chars) + Optional('-') + Word(nums)
  773 +decimal_literal = Combine(Optional('-') + WordStart(vba_identifier_chars) + Word(nums)
773 774 + Suppress(Optional(Word('%&^', exact=1))))
774 775 decimal_literal.setParseAction(lambda t: int(t[0]))
775 776  
... ...