summaryrefslogtreecommitdiff
path: root/python/highlevelil.py
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2024-01-29 16:04:43 -0500
committerKyle Martin <krm504@nyu.edu>2024-02-01 10:28:43 -0500
commit572344ae58da98d4fc8e2e210ccc61b258c765c0 (patch)
tree89364ebcebea1e4b85ca3b4fe4bbd5284bd3a107 /python/highlevelil.py
parentd527d6f7d3cdc7c938a6f20fdab7e9cc1b59c920 (diff)
Adds `BinaryView.check_for_string_annotation_type`; Adds ergonomic way of retrieving string from ConstPtr IL instructions; Resolves #4144
Diffstat (limited to 'python/highlevelil.py')
-rw-r--r--python/highlevelil.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py
index e2922b46..da1d9346 100644
--- a/python/highlevelil.py
+++ b/python/highlevelil.py
@@ -26,7 +26,7 @@ from enum import Enum
# Binary Ninja components
from . import _binaryninjacore as core
-from .enums import HighLevelILOperation, DataFlowQueryOption, FunctionGraphType, ILInstructionAttribute
+from .enums import HighLevelILOperation, DataFlowQueryOption, FunctionGraphType, ILInstructionAttribute, StringType
from . import function
from . import binaryview
from . import architecture
@@ -1691,6 +1691,10 @@ class HighLevelILConstPtr(HighLevelILInstruction, Constant):
("constant", self.constant, "int"),
]
+ @property
+ def string(self) -> Optional[Tuple[str, StringType]]:
+ return self.function.view.check_for_string_annotation_type(self.constant, True, True, 0)
+
@dataclass(frozen=True, repr=False, eq=False)
class HighLevelILExternPtr(HighLevelILInstruction, Constant):