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

AutoConstants and AutoSyscalls broken on latest Ghidra #3

Open
Legoclones opened this issue Jun 23, 2023 · 3 comments
Open

AutoConstants and AutoSyscalls broken on latest Ghidra #3

Legoclones opened this issue Jun 23, 2023 · 3 comments

Comments

@Legoclones
Copy link

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
@msh1307
Copy link

msh1307 commented Sep 8, 2023

fix scripts/lib/Constants.py like following
line1: from ghidra.util.task import TaskMonitor

line63 : function = self.currentProgram.getListing().getFunctionContaining(call)

@Legoclones
Copy link
Author

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.

@j4k0xb
Copy link

j4k0xb commented Oct 17, 2023

only change needed at line 63:

- evaluate = ConstantPropagationContextEvaluator(True)
+ evaluate = ConstantPropagationContextEvaluator(self.monitor)

this works with ghidra 10.4

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

No branches or pull requests

3 participants