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

Metatype 'int' not recognized in Compiler Specification after Ghidra version upgrade #6477

Open
v-p-b opened this issue May 2, 2024 · 2 comments
Assignees

Comments

@v-p-b
Copy link

v-p-b commented May 2, 2024

Describe the bug

The following pentry specification:

<pentry minsize="1" maxsize="8" metatype="int">

Works in Ghidra 10, but results in an error in Ghidra 11.0.3.

The error is as follows:

Open failed: ghidra.program.model.lang.CompilerSpecNotFoundException: Exception reading [NAME]/default(file.cspec:123): Unknown type class: int

To Reproduce
Steps to reproduce the behavior:

  1. Edit a cspec file to include the offending attribute in a pentry node
  2. Open a file in Ghidra 11.0.3 using the modified cspec

Expected behavior

The cspec is parsed and the file is loaded for analysis.

Screenshots

N/A

Attachments

N/A

Environment (please complete the following information):

  • OS: Debian Linux 11
  • Java Version: 17
  • Ghidra Version: 11.0.3
  • Ghidra Origin: GitHub release

Additional context

I looked at the documentation of the latest release (I uploaded the generated docs here ) and confirmed that the metatype attribute of pentry should accept "int" as a value:

metatype (Optional) Restriction on datatype: unknown, float, int, uint, or ptr

@dev747368
Copy link
Collaborator

dev747368 commented May 2, 2024

Yeah, doc is wrong (hasn't been updated since forever). "int" type does not exist.

The code that parsed that value was looser, and used to ignore unknown values, but was changed 11/2023 in commit 1913716.

@v-p-b
Copy link
Author

v-p-b commented May 3, 2024

This clarifies the behavior, thank you!

I suggest to keep this issue open until the documentation is updated (I'll try to open PR, but the linked commit is non-trivial so won't promise anything).

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

No branches or pull requests

4 participants