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

Support scope names in Structs and Enums #97

Open
mahaloz opened this issue Jul 23, 2024 · 0 comments
Open

Support scope names in Structs and Enums #97

mahaloz opened this issue Jul 23, 2024 · 0 comments
Labels
bug Something isn't working common enhancement New feature or request ghidra

Comments

@mahaloz
Copy link
Member

mahaloz commented Jul 23, 2024

In Ghidra, structs can look like this:

dict_items([('ELF/Elf64_Ehdr', <Struct: ELF/Elf64_Ehdr membs=21 (0x40)>), ('ELF/Elf64_Phdr', <Struct: ELF/Elf64_Phdr membs=8 (0x38)>), ('ELF/Elf64_Shdr', <Struct: ELF/Elf64_Shdr membs=10 (0x40)>), ('ELF/Elf64_Dyn', <Struct: ELF/Elf64_Dyn membs=2 (0x10)>), ('ELF/Elf64_Sym', <Struct: ELF/Elf64_Sym membs=6 (0x18)>), ('ELF/Elf64_Rela', <Struct: ELF/Elf64_Rela membs=3 (0x18)>), ('ELF/NoteAbiTag', <Struct: ELF/NoteAbiTag membs=6 (0x20)>), ('ELF/GnuBuildId', <Struct: ELF/GnuBuildId membs=5 (0x24)>), ('eh_frame_hdr', <Struct: eh_frame_hdr membs=4 (0x4)>), ('fde_table_entry', <Struct: fde_table_entry membs=2 (0x8)>), ('ossl_typ.h/evp_pkey_ctx_st', <Struct: ossl_typ.h/evp_pkey_ctx_st membs=0 (0x1)>), ('stdio.h/_IO_FILE', <Struct: stdio.h/_IO_FILE membs=29 (0xd8)>), ('libio.h/_IO_marker', <Struct: libio.h/_IO_marker membs=3 (0x18)>)])

The name is like libio.h/_IO_marker, which is a problem, since we often try to lookup structs by their name in other plugins. This needs to be normalized by adding a scope property to both enums and struct, which normally will be None. For Ghidra, we will put everything before the name as the scope.

This can also be useful for future Class support.

@mahaloz mahaloz added ghidra common bug Something isn't working enhancement New feature or request labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working common enhancement New feature or request ghidra
Projects
Status: paused
Development

No branches or pull requests

1 participant