-
Notifications
You must be signed in to change notification settings - Fork 72
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
Ghidra headless analysis failed #24
Comments
I have the same problem using Ida 7.5, regardless of Ghidra version used. I tried 9.0.4, 9.1.2 and 9.2.2 and I always get the same error (see below). I think it is an issue with Ida 7.5 and python3 (i use 3.8) because Ida 7.3 with python 2.7 don't have this problem. I looked for the error (Expecting value ...) but I couldn't see where the line originates and I looked at all the python code, the xml exporter and importer the loader and idaxml.py. I would appreciate it if somebody could help me figure out how to debug this issue because I am stumped. XML Exporter v5.0.1 : SDK 750Exporting XML document ....
|
@paxcut I can confirm that the plugin works with the following configuration:
Please, check if you have correctly installed the GhIDA Python3 version (it is slightly different from the Python2 version) and let me know if the same problem happens with different binaries. If the problem persists, there are |
@jimmy-sonny Thank you for replying. Using this configuration the error persists. Should I try to switch to python 3.7.5? Do I need to try the earlier Ida version (7.5.200619)? I don't have a linux license for Ida so I can't try to see if it works there. |
I've to try with IDA 7.5 on Windows to check if everything works correctly. I'll let you know. |
I found some interesting facts. Ida 7.5.200728 which is the previous release to the latest SP 2, can run GHida using any python 3 but with the following caveat. By observing the processes and looking at the java process created by the headless Ghidra run it is possible to see when the decompilation finishes because the process cpu will go to zero. At that point it is OK to cancel the Ghida plugin and the decompiled code will appear. If you don't cancel the plugin it will run until timeout is reached and then it will display the decompiled code. It appears that the code that checks to see if the headless run has finished no longer works for that version of Ida. Also when I use the clear function from cache option the XML exporter is run which seemed strange to me but it appears to be a consequence of the fact that the java process is not being killed when the plugin run is canceled. If the above is tried in Ida SP2 (7.5.201028) the Ghida plugin will start by exporting to xml and when the headless Ghidra run is supposed to be invoked, the Ghida plugin stops and the error message shown in my first post is displayed. It appears that for this version of Ida the part that fails is the invocation of the headless Ghidra decompilation because no java process ever appears on task manager. If you are going to test windows maybe this may help determine why it is not working on my end. |
I need to correct the previous post. the strange behavior that occurs when using the clear cache still occurs but it is not due to a failure to kill the java process. the java process is indeed killed but the xml export only occurs when I left click the disassembly to be decompiled. no "decompile function using Ghida " needs to be selected for this to occur. it happens as soon as the left click occurs which is what I found so strange. |
It appears that removing the folowwing arguments |
I found a way to fix this in all versions of Ida 7.5 without removing the arguments mentioned in my previous post. First make sure there are no strange (illegal) characters in the path to Ida (I had '(' and ')' which are bad),but the error still occurs even if there are none. |
I was using the wrong branch in the pull request but now it is fixed. |
Thanks you for your answer :D Sorry for my delay. I will try yours very soon because now I'm working at the end of other project :D |
I am using IDA version 7.6 SP1 and Ghidra 10.0.1 |
did you try the fix i implemented? you can find them here |
It works! Thanks |
I use IDA pro 7.5, Ghidra 9.2.2 lastest, python 3.7.9
I'm trying to test decompile function in IDA with GhidraDec but not working any function :(
The text was updated successfully, but these errors were encountered: