Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Deletion Callback on Struct/Enum Renaming #48

Open
Flipout50 opened this issue Apr 3, 2024 · 0 comments
Open

Add Deletion Callback on Struct/Enum Renaming #48

Flipout50 opened this issue Apr 3, 2024 · 0 comments
Labels
enhancement New feature or request ghidra

Comments

@Flipout50
Copy link
Collaborator

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

@Flipout50 Flipout50 added enhancement New feature or request ghidra labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ghidra
Projects
None yet
Development

No branches or pull requests

1 participant