mahaloz / DAILA

A decompiler-agnostic plugin for interacting with AI in your decompiler. GPT-4, Claude, and local models supported!
548 stars 50 forks source link

DAILA Plugin enabled but menù not present #61

Open velteyn opened 2 weeks ago

velteyn commented 2 weeks ago

Hi there, I installed anythng , enabled the plugin etc. I see the DAILA start beck end menù and I can start it. When I go th the de-compiler there is not context menu for the variables I use linux manjaro and GHidra 11.0.3. I went to the ghidra log and i see this:

  |   |   | at org.python.core.__builtin__.__import__(__builtin__.java:1232) -- | -- | -- | --   |   |   | at org.python.core.imp.importFromAs(imp.java:1636)   |   |   | at org.python.core.imp.importFrom(imp.java:1611)   |   |   | at libbs_vendored.ghidra_bridge_server$py.f$0(/home/velteyn/ghidra_scripts/libbs_vendored/ghidra_bridge_server.py:200)   |   |   | at libbs_vendored.ghidra_bridge_server$py.call_function(/home/velteyn/ghidra_scripts/libbs_vendored/ghidra_bridge_server.py)   |   |   | at org.python.core.PyTableCode.call(PyTableCode.java:173)   |   |   | at org.python.core.PyCode.call(PyCode.java:18)   |   |   | at org.python.core.imp.createFromCode(imp.java:632)   |   |   | at org.python.core.imp.createFromSource(imp.java:585)   |   |   | at org.python.core.imp.loadFromSource(imp.java:946)   |   |   | at org.python.core.imp.find_module(imp.java:771)   |   |   | at org.python.core.PyModule.findSubModule(PyModule.java:140)   |   |   | at org.python.core.PyModule.impAttr(PyModule.java:107)   |   |   | at org.python.core.imp.import_next(imp.java:1163)   |   |   | at org.python.core.imp.import_logic(imp.java:1280)   |   |   | at org.python.core.imp.import_module_level(imp.java:1371)   |   |   | at org.python.core.imp.importName(imp.java:1544)   |   |   | at org.python.core.ImportFunction.__call__(__builtin__.java:1285)   |   |   | at org.python.core.PyObject.__call__(PyObject.java:433)   |   |   | at org.python.core.__builtin__.__import__(__builtin__.java:1232)   |   |   | at org.python.core.imp.importFromAs(imp.java:1636)   |   |   | at org.python.core.imp.importFrom(imp.java:1611)   |   |   | at org.python.pycode._pyx6.f$0(/home/velteyn/ghidra_scripts/daila_plugin.py:69)   |   |   | at org.python.pycode._pyx6.call_function(/home/velteyn/ghidra_scripts/daila_plugin.py)   |   |   | at org.python.core.PyTableCode.call(PyTableCode.java:173)   |   |   | at org.python.core.PyCode.call(PyCode.java:18)   |   |   | at org.python.core.Py.runCode(Py.java:1703)   |   |   | at org.python.core.__builtin__.execfile_flags(__builtin__.java:535)   |   |   | at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:287)   |   |   | at ghidra.python.GhidraPythonInterpreter.execFile(GhidraPythonInterpreter.java:239)   |   |   | at ghidra.python.PythonScriptExecutionThread.run(PythonScriptExecutionThread.java:51)   |   |   |   2024-10-05 | 13:15:18 | DEBUG | (PlatformDependent0) jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable java.lang.IllegalAccessException: class org.python.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @539f9c5e -- | -- | -- | --

error.csv

mahaloz commented 2 weeks ago

Hi @velteyn, the minimum version of Ghidra DAILA works on is 11.1. Would you be able to update and test again?

velteyn commented 2 weeks ago

Ah ok thanks !! I'll do tonight

nobodyisnobody commented 1 week ago

daila plugin in ghidra 11.2 does not show the context menu too.

there is the DAILA entry in Tools menu, I can start the backend but no context menu on vars P.S.: I'm on ubuntu 24.04

mahaloz commented 6 days ago

@nobodyisnobody, can you run daila in your shell? The way that DAILA works on the backend is that when it starts in Ghidra, it calls out to daila on your shell. But I've seen issues on 24.04 with globally accessible installs.

Relevant line for reference: https://github.com/mahaloz/DAILA/blob/2ebe2a6b20c0b7d28aedb120f64aa12f235ca2b0/dailalib/daila_plugin.py#L25

nobodyisnobody commented 6 days ago

Well, I can run daila in my shell.

I tried on my laptop running ubuntu 22.04, on ghidra 11.2 with openjdk 21.0.4 and now it works perfectly.

So the problem is maybe linked with ubuntu 24.04, or to something else.. I have to explore more to confirm

mahaloz commented 6 days ago

Sorry about the typo above. Corrected it to be 24.04. Yeah I think it's possibly 24.04 specific, since the new Python limitation on global installs has caused some pain.

nobodyisnobody commented 6 days ago

I will try to find what's wrong on 24.04 when I'm back to my main computer.

just a question: could a model like STRIDE be implemented in Daila? https://github.com/hgarrereyn/STRIDE

seems to perform very well on var renaming & retyping

P.S.: thanks for your great work.

mahaloz commented 6 days ago

Sounds good @nobodyisnobody, and thank you :).

Yes, STRIDE can actually pretty easily be integrated into DAILA if they follow the same format that VarBERT did: https://github.com/binsync/varbert_api/blob/1e6a85bbde85c4111ab317979c040e7ca0a98466/varbert/api.py#L22

However, I will note that VarBERT (currently in DAILA), was shown to be more accurate than STRIDE in eval, albeit more expensive to run. For these reasons, it's been low on my priority board to implement.

velteyn commented 1 day ago

Now I am on GHidra 11.2 and I have the same problem :-(

mahaloz commented 18 hours ago

@velteyn your in latest DAILA right?

velteyn commented 18 hours ago

ops I think I forgot to upgrade first..Sorry