Replies: 1 comment
-
There is a way to let the decompiler know some data is constant, although it takes a few more clicks than in IDA. If you select the region of data that is constant in the listing view, and right-click, a menu pops up. In that menu, select "Data", and then "Settings...". Then, in the window that pops up, change the value of the "Mutability" by clicking on the value. In the drop-down that appears, select "constant". Then click "OK" or "Apply". Then go back to the function where the variable was used, and the result from the decompiler should have changed. I agree it would be nice if there was an easier way to tell the decompiler some data is constant, preferably without leaving the function. It is sometimes a bit of a hassle to go to the location where the data is stored and then back, especially if you have to do this often. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
ida have a ability that when we set a global variable type to const, it used the variable value to optimize code. Dose ghidra have the same ability?
Beta Was this translation helpful? Give feedback.
All reactions