pwndra
pwndra copied to clipboard
AutoConstants and AutoSyscalls broken on latest Ghidra
I'm seeing Auto Constants and Auto Syscalls is broken on latest Ghidra (10.3) with Java 17.0.7. Looks to be the same underlying issue.
AutoSyscalls.py:
Traceback (most recent call last):
File "...\pwndra\AutoSyscalls.py", line 34, in <module>
run()
File "...\pwndra\AutoSyscalls.py", line 31, in run
obj = Syscalls(currentProgram, currentSelection, monitor, arch, abi)
File "...\pwndra\lib\Syscalls.py", line 735, in __init__
res = self.getRegisterValue(call, reg)
File "...\pwndra\lib\Syscalls.py", line 583, in getRegisterValue
evaluate = ConstantPropagationContextEvaluator(True)
TypeError: ghidra.app.plugin.core.analysis.ConstantPropagationContextEvaluator(): 1st arg can't be coerced to ghidra.util.task.TaskMonitor
AutoConstants.py:
Traceback (most recent call last):
File "...\pwndra\AutoConstants.py", line 33, in <module>
run()
File "...\pwndra\AutoConstants.py", line 30, in run
obj = Constants(currentProgram, currentSelection, monitor, state, arch, abi)
File "...\pwndra\lib\Constants.py", line 321, in __init__
value = self.getParameterValue(func, call, arg[0])
File "...\pwndra\lib\Constants.py", line 143, in getParameterValue
return self.getRegisterValue(func, call, param.getRegister())
File "...\pwndra\lib\Constants.py", line 63, in getRegisterValue
evaluate = ConstantPropagationContextEvaluator(True)
TypeError: ghidra.app.plugin.core.analysis.ConstantPropagationContextEvaluator(): 1st arg can't be coerced to ghidra.util.task.TaskMonitor
fix scripts/lib/Constants.py like following
line1: from ghidra.util.task import TaskMonitor
line63 : function = self.currentProgram.getListing().getFunctionContaining(call)
I added from ghidra.util.task import TaskMonitor to the first line, line 63 is already set to the value you specified. This didn't change the error message.
only change needed at line 63:
- evaluate = ConstantPropagationContextEvaluator(True)
+ evaluate = ConstantPropagationContextEvaluator(self.monitor)
this works with ghidra 10.4