summaryrefslogtreecommitdiff
path: root/python/languagerepresentation.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2025-05-21 15:40:40 -0400
committerGlenn Smith <glenn@vector35.com>2025-05-21 15:55:33 -0400
commit7034625749757855498719688163172210395379 (patch)
tree1fd2b9b814eaa8ed81dcad7b386aeb0239e3f3e6 /python/languagerepresentation.py
parent397b5693c4b354349ade15eab09baa5dde744f1c (diff)
Fix HLIL_LABEL rendering
Diffstat (limited to 'python/languagerepresentation.py')
-rw-r--r--python/languagerepresentation.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/languagerepresentation.py b/python/languagerepresentation.py
index 44c34bf2..a8241b30 100644
--- a/python/languagerepresentation.py
+++ b/python/languagerepresentation.py
@@ -53,6 +53,10 @@ class HighLevelILTokenEmitter:
if core is not None:
core.BNFreeHighLevelILTokenEmitter(self.handle)
+ def init_line(self):
+ """Initialize a new line, creating indentation tokens at the start."""
+ core.BNHighLevelILTokenEmitterInitLine(self.handle)
+
def new_line(self):
"""Starts a new line in the output."""
core.BNHighLevelILTokenEmitterNewLine(self.handle)
@@ -240,7 +244,7 @@ class HighLevelILTokenEmitter:
@property
def current_tokens(self) -> List['function.InstructionTextToken']:
- """The list of tokens on the current line (read-only)."""
+ """The list of tokens on the current line."""
count = ctypes.c_ulonglong()
tokens = core.BNHighLevelILTokenEmitterGetCurrentTokens(self.handle, count)
result = []
@@ -249,6 +253,11 @@ class HighLevelILTokenEmitter:
core.BNFreeInstructionText(tokens, count.value)
return result
+ @current_tokens.setter
+ def current_tokens(self, tokens: List['function.InstructionTextToken']):
+ buf = function.InstructionTextToken._get_core_struct(tokens)
+ core.BNHighLevelILTokenEmitterSetCurrentTokens(self.handle, buf, len(tokens))
+
@property
def lines(self) -> List['function.DisassemblyTextLine']:
"""The list of lines in the output (read-only)."""