diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-03-16 19:54:07 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2023-03-30 18:05:12 -0400 |
| commit | d811fffd69ffba789b960edd4fa31cc3d3f5905e (patch) | |
| tree | 09d036bc3cedc4b93f9fc45b77ebf86659ee0aec /python/typeprinter.py | |
| parent | 1113603311856740654617341767562218182618 (diff) | |
Add support for deriving structures from other structures
Diffstat (limited to 'python/typeprinter.py')
| -rw-r--r-- | python/typeprinter.py | 11 |
1 files changed, 9 insertions, 2 deletions
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 |
