summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2026-05-12 21:19:28 -0400
committerAlexander Taylor <alex@vector35.com>2026-05-13 13:32:22 -0400
commit4c278a57b59c4b8e913d17b47bc4828659b32659 (patch)
treed179792a704c615a3838ecfbfe636bc537d82216 /python/function.py
parent6a1c332697cbe12d6b2b7857bf21bc440706c0be (diff)
Changes related to display as/type toggling.
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py11
1 files changed, 11 insertions, 0 deletions
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