summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2023-02-20 21:58:55 -0500
committerGlenn Smith <glenn@vector35.com>2023-11-06 16:10:47 -0500
commit4108964609171327618627477163339656037111 (patch)
tree79f4c6da6394b973cee05cc42b6edd7e2e20909d /python/binaryview.py
parentb270d7ebe1e2a406e1f7f14807987d24b0c4a846 (diff)
Type Containers
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index cd7a0cdf..d7d2a2a8 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -71,6 +71,7 @@ from . import function as _function
from . import types as _types
from . import platform as _platform
from . import deprecation
+from . import typecontainer
PathType = Union[str, os.PathLike]
InstructionsType = Generator[Tuple[List['_function.InstructionTextToken'], int], None, None]
@@ -1745,7 +1746,7 @@ class TypeMapping(collections.abc.Mapping): # type: ignore
def __del__(self):
if core is not None and self._type_list is not None:
- core.BNFreeTypeList(self._type_list, len(self))
+ core.BNFreeTypeAndNameList(self._type_list, len(self))
def __getitem__(self, key):
if self._type_cache is None:
@@ -6958,6 +6959,21 @@ class BinaryView:
raise ValueError(error_str)
return variable.PossibleValueSet(self.arch, result)
+ @property
+ def type_container(self) -> 'typecontainer.TypeContainer':
+ container = core.BNGetAnalysisTypeContainer(self.handle)
+ return typecontainer.TypeContainer(handle=container)
+
+ @property
+ def auto_type_container(self) -> 'typecontainer.TypeContainer':
+ container = core.BNGetAnalysisAutoTypeContainer(self.handle)
+ return typecontainer.TypeContainer(handle=container)
+
+ @property
+ def user_type_container(self) -> 'typecontainer.TypeContainer':
+ container = core.BNGetAnalysisUserTypeContainer(self.handle)
+ return typecontainer.TypeContainer(handle=container)
+
def get_type_by_name(self, name: '_types.QualifiedNameType') -> Optional['_types.Type']:
"""
``get_type_by_name`` returns the defined type whose name corresponds with the provided ``name``