Skip to content

Add Deletion Callback on Struct/Enum Renaming #48

@Flipout50

Description

@Flipout50

When a struct is renamed in Ghidra, it needs to be handled as if the old struct was deleted, and a new one is created with the new name. When the ProgramChangeRecord for this gets caught in the following code snippet, there isn't an obvious way to figure out what struct was renamed. We need to figure out how to access this value so that we can call self._interface.struct_changed() with deleted=True and pass it the old struct.

elif changeType in typeEvents:
try:
struct = self._interface.structs['/'+newValue.name]
# TODO: access old name indicate deletion
#self._interface.struct_changed(Struct(None, None, None), deleted=True)
self._interface.struct_changed(struct)
except KeyError:
pass
try:
enum = self._interface.enums['/'+newValue.name]
#self._interface.enum_changed(Enum(None, None), deleted=True)
self._interface.enum_changed(enum)
except KeyError:
pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions