1

I'm using Ghidra to work out the structure of some binary files. No code.

I can use the Structure Editor to define a struct, such as the header of the file format.

But I can only find a way to create the struct in the context of one of the files and then it will not be visible to the other.

Is there a way to make it visible to both?

2 Answers 2

3

I have two PNG files open in tabs Ghidra Listing panel with two tabs

Now on the bottom right in Data Type Manager I create a new archive file foo.gdt

Click the small black arrow -> New File Archive

Ghidra Structure Editor

In that .gdt archive I create an arbitrary structure with three dwords named pngheader, pngtail, pngfeet

Ghidra Data Type Manager

Now I can apply this structure to both files using data->choose data type (press T shortcut) as below

Ghidra Listing window with new struct applied

Are you looking for this?

2

Programs in the same project can share data types through the data type manager of each program. This can be done using drag-n-drop from one data type manager to the other or through copy (Ctrl+C) with focus on the type and paste (Ctrl+V ) with focus on the directory or top level archive where the data type should be copied to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.