Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions oletools/olevba.py
Original file line number Diff line number Diff line change
Expand Up @@ -4112,6 +4112,11 @@ def colorize_keywords(self, vba_code):
for kw_type, keyword, description in results:
color_type = COLOR_TYPE.get(kw_type, None)
if color_type:

# Prevent malicious actors from performing anti-analysis by replacing
# character 27 (ESC) with \e.
# See more: https://www.youtube.com/watch?v=3T2Al3jdY38
vba_code = vba_code.replace("\x1b", "\\e")
vba_code = vba_code.replace(keyword, '{auto%s}%s{/%s}' % (color_type, keyword, color_type))
return vba_code

Expand Down