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

Fix ghidra exporter script when structure field name is empty #1443

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/ghidra_scripts/export_to_redux.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
type_name = component.getDataType().getName()
print('type: ' + type_name)
field_name = component.getFieldName()
if field_name is None:
field_name = component.getDefaultFieldName()
print('field name: ' + field_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper python-y syntax would've been

print('field name: ' + field_name if field_name != None else component.getDefaultFieldName())

but that's okay :)

field_length = str(component.getLength())
print('field length: ' + field_length)
Expand Down
Loading