From 4c278a57b59c4b8e913d17b47bc4828659b32659 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Tue, 12 May 2026 21:19:28 -0400 Subject: Changes related to display as/type toggling. --- python/function.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index b2c3ef4c..9f5e89bb 100644 --- a/python/function.py +++ b/python/function.py @@ -4181,6 +4181,17 @@ class DisassemblyTextRenderer: def is_integer_token(token: 'InstructionTextToken') -> bool: return core.BNIsIntegerToken(token.type) + @staticmethod + def get_display_string_for_integer( + binary_view: Optional['binaryview.BinaryView'], display_type: IntegerDisplayType, value: int, input_width: int, + is_signed: bool = True + ) -> str: + if isinstance(display_type, str): + display_type = IntegerDisplayType[display_type] + return core.BNGetDisplayStringForInteger( + binary_view.handle if binary_view is not None else None, display_type, value, input_width, is_signed + ) + def add_integer_token( self, tokens: List['InstructionTextToken'], int_token: 'InstructionTextToken', addr: int, arch: Optional['architecture.Architecture'] = None -- cgit v1.3.1