From 7034625749757855498719688163172210395379 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Wed, 21 May 2025 15:40:40 -0400 Subject: Fix HLIL_LABEL rendering --- python/languagerepresentation.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'python/languagerepresentation.py') 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).""" -- cgit v1.3.1