From d811fffd69ffba789b960edd4fa31cc3d3f5905e Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 16 Mar 2023 19:54:07 -0400 Subject: Add support for deriving structures from other structures --- python/typeprinter.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'python/typeprinter.py') diff --git a/python/typeprinter.py b/python/typeprinter.py index 3ad1e9f2..2177ba40 100644 --- a/python/typeprinter.py +++ b/python/typeprinter.py @@ -504,8 +504,15 @@ class CoreTypePrinter(TypePrinter): type_ = types.Type.create(handle=core.BNNewTypeReference(core_lines[i].type), platform=data.platform) root_type = types.Type.create(handle=core.BNNewTypeReference(core_lines[i].rootType), platform=data.platform) root_type_name = core.pyNativeStr(core_lines[i].rootTypeName) - line = types.TypeDefinitionLine(core_lines[i].lineType, tokens, type_, root_type, root_type_name, - core_lines[i].offset, core_lines[i].fieldIndex) + if core_lines[i].baseType: + const_conf = types.BoolWithConfidence.get_core_struct(False, 0) + volatile_conf = types.BoolWithConfidence.get_core_struct(False, 0) + handle = core.BNCreateNamedTypeReference(core_lines[i].baseType, 0, 1, const_conf, volatile_conf) + base_type = types.NamedTypeReferenceType(handle, data.platform) + else: + base_type = None + line = types.TypeDefinitionLine(core_lines[i].lineType, tokens, type_, root_type, root_type_name, base_type, + core_lines[i].baseOffset, core_lines[i].offset, core_lines[i].fieldIndex) lines.append(line) core.BNFreeTypeDefinitionLineList(core_lines, count.value) return lines -- cgit v1.3.1