about summary refs log tree commit diff stats
path: root/miasm/core/utils.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2025-01-23 21:56:03 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2025-01-24 08:36:24 +0100
commite46b1fc2551d112f2f7c2849a780d102d84b8f7b (patch)
treed32a0a96849f16012013bbb245ded833558b1741 /miasm/core/utils.py
parentcbc722eed8dc807955bd46f84886ae74d161dd0c (diff)
downloadfocaccia-miasm-e46b1fc2551d112f2f7c2849a780d102d84b8f7b.tar.gz
focaccia-miasm-e46b1fc2551d112f2f7c2849a780d102d84b8f7b.zip
Fix xdot output
Signed-off-by: Fabrice Desclaux <fabrice.desclaux@cea.fr>
Diffstat (limited to 'miasm/core/utils.py')
-rw-r--r--miasm/core/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/miasm/core/utils.py b/miasm/core/utils.py
index eb170576..291c5f4d 100644
--- a/miasm/core/utils.py
+++ b/miasm/core/utils.py
@@ -26,7 +26,9 @@ COLOR_OP = "black"
 
 COLOR_MNEMO = "blue1"
 
-ESCAPE_CHARS = re.compile(r'[\{\}&|<>]')
+ESCAPE_CHARS = re.compile('[' + re.escape('{}[]') + '&|<>' + ']')
+
+
 
 def set_html_text_color(text, color):
     return '<font color="%s">%s</font>' % (color, text)
@@ -39,6 +41,9 @@ def _fix_chars(token):
 def fix_html_chars(text):
     return ESCAPE_CHARS.sub(_fix_chars, str(text))
 
+BRACKET_O = fix_html_chars('[')
+BRACKET_C = fix_html_chars(']')
+
 upck8 = lambda x: struct.unpack('B', x)[0]
 upck16 = lambda x: struct.unpack('H', x)[0]
 upck32 = lambda x: struct.unpack('I', x)[0]