Free-form C structure entry mechanism
See original GitHub issueBefore closing #4229 there was a small discussion about adding a C-struct text mode editor that would make it easier to copy-paste and duplicate chunks between elements and in and out of the program.
There @ghidra1 said that the team had brainstormed about it in the past.
Personally, I think the all-or-nothing way one has to import and export all their existing headers/types in one go can be severely improved or complemented. When importing you need to do a lot of prepping and dial-tuning, checking that it isn’t in read-write mode, and even if it succeeds it replaces the whole data block so you essentially need to move the imported data somewhere after the import and use a dummy/transient/disposable one for staging (in the likely case you are doing it in pieces).
Sometimes I change the enum
or struct
externally and it would be painless to do a direct copy-paste. Or the other way around, exporting small pieces of fields, or cloning them between data types, as well as quickly refactor in Ghidra by moving them around. It would make things more interoperable.
There is already something very similar for function signatures, and it works very well, so I feel like this would improve everyone’s workflow.
Let me know what you think, and thanks for reading.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (2 by maintainers)
One of the biggest obstacles with using the C Parser for re-parsing Ghidra datatypes is the fact that our type naming is not C-compliant and in many cases can drag in namespace and template constructs that the C Parser can not handle. In addition, the C Parser can not be used for manipulating non-packed Ghidra structures which are frequently incomplete in their definition and precise with component placement (i.e., component offsets).
@emteere Do you foresee this being incorporated into structure merges (update/commit to archive and in VT) or just creation/editing? Hopefully somewhat the same logic and its just a matter of squeezing into the UI once the hard part is done.