-
I've noticed that if you create an enumeration and replace a type with it, constant values get displayed as their mnemonic equivalent (in the Decompile View). However, if the type has values that are OR’ed together, this approach is much more fiddly to use. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I believe this is what an Equate is for. From the documentation "An Equate associates a string with a scalar value in the program, and contains a list of addresses and operand positions that refer to this equate." However this has a similar, yet different, problem as the one you mentioned for an enum. If the constant value is the result of more than one instruction it is not possible to apply an equate to it. |
Beta Was this translation helpful? Give feedback.
-
It was always hoped that Ghidra Equates could be supported in the Decompiler. However, last I was aware constants within the Decompiler tend to loose there anchoring to an originating address preventing Equate references which are address based from being respected and applied. |
Beta Was this translation helpful? Give feedback.
I believe this is what an Equate is for. From the documentation "An Equate associates a string with a scalar value in the program, and contains a list of addresses and operand positions that refer to this equate."
However this has a similar, yet different, problem as the one you mentioned for an enum. If the constant value is the result of more than one instruction it is not possible to apply an equate to it.