2

This is the window that appears when you press Shift + /.

Example:

screenshot

1 Answer 1

3

I am not sure if there is something inbuilt, but you can write a simple Python script and assign a key binding to that script as below:

#TODO evaluates a string expression as Numeral and formats it in multiple radix
#@author  blabb
#@category _NEW_
#@keybinding Shift-SLASH

import ghidra
exp = askString("Expression","Expression")
print("Expression is %s" % exp)
val = eval(exp)
print(ghidra.util.NumericUtilities.formatNumber(val,2))
print(ghidra.util.NumericUtilities.formatNumber(val,8))
print(ghidra.util.NumericUtilities.formatNumber(val,10))
print(ghidra.util.NumericUtilities.formatNumber(val,16))

Executed and screenshotted as below:

enter image description here

3
  • I think is now available also as a built-in feature, look there for Pure Emulation
    – zi0Black
    Dec 13, 2021 at 14:18
  • @zi0Black Pure Emulation does string parsing splitting and evaluating ? i dont think so it might be related to Emulating instructions
    – blabb
    Dec 13, 2021 at 14:58
  • You're right; Pure Emulation is related to instruction emulation. I misread the question at first.
    – zi0Black
    Dec 13, 2021 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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