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
getProjectRootFolder() from flatAPI does not seem to be working in 9.1 #1250
Comments
It is accessible from a GhidraScript but not from Python. At first I thought it was because it is a protected method but this does not appear to be the case as both currentProgram and monitor are protected members yet are accessible from python. |
Here is the code that explains the behavior: ghidra/Ghidra/Features/Python/src/main/java/ghidra/python/GhidraPythonInterpreter.java Lines 322 to 359 in a0aff4f
Only public methods are getting added to the python environment. I can't think of a good reason why this is being done, since it should mimic the java environment as closely as possibly. |
@ryanmkurtz that is what I had thought. It is strange though because currentProgram is a protected member yet it is accessible. It doesn't make sense to add protected members but not protected methods. |
Im working on a fix. |
Doh, the obvious/simple fix of just adding protected methods didn't quite work:
I'll have to dig into this more. |
Looks like it's Jython blocking it:
Just have to figure out how to set |
It's not programmatically, but try specifying -D python.security.respectJavaAccessibility=false when launching ghidra. source The problem here I think would be that it would always allow python to access protected/private methods/members and not just the ones in GhidraScript. |
It seems to be working. I'll put the fix in. |
Describe the bug
A clear and concise description of the bug.
This does not seem to be working in https://ghidra.re/ghidra_docs/api/ghidra/program/flatapi/FlatProgramAPI.html#getProjectRootFolder()
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Similar functionality to https://ghidra.re/ghidra_docs/api/ghidra/app/script/GhidraScript.html#askProjectFolder(java.lang.String)
Screenshots
Attachments
If applicable, please attach any files that caused problems or log files generated by the software.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: