diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-02-20 21:58:55 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-11-06 16:10:47 -0500 |
| commit | 4108964609171327618627477163339656037111 (patch) | |
| tree | 79f4c6da6394b973cee05cc42b6edd7e2e20909d /python/platform.py | |
| parent | b270d7ebe1e2a406e1f7f14807987d24b0c4a846 (diff) | |
Type Containers
Diffstat (limited to 'python/platform.py')
| -rw-r--r-- | python/platform.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/python/platform.py b/python/platform.py index e60f9a8f..2c4a26f6 100644 --- a/python/platform.py +++ b/python/platform.py @@ -30,6 +30,7 @@ from . import typeparser from . import callingconvention from . import typelibrary from . import architecture +from . import typecontainer class _PlatformMetaClass(type): @@ -262,7 +263,7 @@ class Platform(metaclass=_PlatformMetaClass): for i in range(0, count.value): name = types.QualifiedName._from_core_struct(type_list[i].name) result[name] = types.Type.create(core.BNNewTypeReference(type_list[i].type), platform=self) - core.BNFreeTypeList(type_list, count.value) + core.BNFreeTypeAndNameList(type_list, count.value) return result @property @@ -275,7 +276,7 @@ class Platform(metaclass=_PlatformMetaClass): for i in range(0, count.value): name = types.QualifiedName._from_core_struct(type_list[i].name) result[name] = types.Type.create(core.BNNewTypeReference(type_list[i].type), platform=self) - core.BNFreeTypeList(type_list, count.value) + core.BNFreeTypeAndNameList(type_list, count.value) return result @property @@ -288,7 +289,7 @@ class Platform(metaclass=_PlatformMetaClass): for i in range(0, count.value): name = types.QualifiedName._from_core_struct(type_list[i].name) result[name] = types.Type.create(core.BNNewTypeReference(type_list[i].type), platform=self) - core.BNFreeTypeList(type_list, count.value) + core.BNFreeTypeAndNameList(type_list, count.value) return result @property @@ -359,6 +360,10 @@ class Platform(metaclass=_PlatformMetaClass): result = core.BNGetAssociatedPlatformByAddress(self.handle, new_addr) return Platform(handle=result), new_addr.value + @property + def type_container(self) -> 'typecontainer.TypeContainer': + return typecontainer.TypeContainer(core.BNGetPlatformTypeContainer(self.handle)) + def get_type_by_name(self, name): name = types.QualifiedName(name)._to_core_struct() obj = core.BNGetPlatformTypeByName(self.handle, name) |
