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 Cmd to Apply All Data Types (not just Function Data Types) to program archive from custom GDT. #7281

Open
clearbluejar opened this issue Dec 13, 2024 · 1 comment

Comments

@clearbluejar
Copy link

Is your feature request related to a problem? Please describe.

When working with data types in the DTM, Ghidra supports the ability to apply function data types to a currently open program from a custom GDT.

image

As I understand it, it will apply all matching function signatures and related function signature types to the current program. It does not however sync data types not related to function signatures found within the custom GDT.

public class ApplyFunctionDataTypesCmd extends BackgroundCommand<Program> {

Problem: I don't have the ability in Ghidra (or I don't know how) to run the same command applied to all data types in a custom GDT. In the scenario where my custom GDT has a data type that is complete, and the program archive data type exists, but has no structure/info, I have to copy paste that data type manually.

No info in program archive:
image

Data type defined in custom GDT:
image

Need to manually copy data type into program archive or replace data type to update.

Describe the solution you'd like
I would like to be able to add a cmd similar to

public class ApplyFunctionDataTypesCmd extends BackgroundCommand<Program> {
that would allow to also copy data types (enums, structs, etc).

I would like the cmd to allow you to select the merge conflict resolution as well.
image The ideal default for this cmd would be "Replace else Rename"

It would also need the option to replace by name (not necessarily by Category) to avoid this situation.
image

Describe alternatives you've considered
Doing this with a script? Iterate each data type in custom GDT and replace in program archive by name.

Additional context
Perhaps there is already a way to do this? But I can't see it besides scripting. I see the ability to sync data types from another archive:
image

But the ability to select a custom archive only exists after the program archive has already copied a data type sourced from the another GDT.
image

And the sync doesn't solve the issue of data types with the same name in a different category.
image

I can see the issue is complex, but I feel like this could really help with quick analysis when you want to improve data types without knowing or having all the function signatures well defined.

@clearbluejar
Copy link
Author

🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant