intellij-ghidra icon indicating copy to clipboard operation
intellij-ghidra copied to clipboard

Help wanted about IDEA Project

Open Yatogaii opened this issue 9 months ago • 10 comments

I'm a newbie to java development, now I'm trying to develop a ghidra script with IDEA. Thank you in advance for your development of this plug-in🥰.

Now that I have done "Add a Ghidra Facets to Project Structure" and "Add a new Ghidra Launcher in Configurations, " I can get a fully completion suggestion and script result in Ghidra Script Manager.

But when I run my script in IDEA, it first show can't find a class about Log4j , after I manually add the log4j-core and log4j-api to my project, I have rerun the script in IDEA's Ghidra Launcher, it just stuck on (LoggingInitialization), like this: image

I have no idea what to do to solve this, sorry for my pool English, any suggestion would be aprreciate😘😘😘😘😘

Yatogaii avatar May 02 '24 09:05 Yatogaii

PS: I'm running Ghidra on Fedora39 with KDE Plasma

Yatogaii avatar May 02 '24 10:05 Yatogaii

Hey,

It shouldn't be necessary to add the log4j dependencies to your own project, the plugin should be handling that for you. Could you share a bit more information about your project (i.e. do you have a standalone Java project containing scripts, or are you opening your ghidra_scripts folder)?

Though one thing to mention is that intellij-ghidra currently can't run scripts directly. What it can do instead is launch Ghidra with a debugger attached and allow you to set breakpoints on your scripts.

garyttierney avatar May 02 '24 11:05 garyttierney

I'm sorry for my lack of description!

I have IDEA Ultimate 2023.2.6 and intellj-idea 0.5.0 installed.

  • Step to produce:
  1. Create a new project in idea, like this: image
  2. Using File->Project Structure->Facets add ghidra to current project and choose a right Ghidra Install Location.
  3. Add a Ghidra Launcher in Run/Debug Configuration Window.
  4. Write some code with GhidraScript and Run it with Ghidra Launcher
  5. Got ClassNotFound Error! image

Is there anything I have missed? Thank you for being so helpful!

Yatogaii avatar May 02 '24 13:05 Yatogaii

Nothing wrong with your approach, that should be working. Looks like potentially a bug in the plugin. I'll reproduce your steps and get back to you.

garyttierney avatar May 02 '24 14:05 garyttierney

Hi, I have the same problem. I am using IntelliJ 2024.1.1 Ultimate Edition. I have tested it with OpenJDK 17 but also other JDKs. @Yatogaii have you found any workaround?

lcian avatar May 27 '24 19:05 lcian

@lcian Sorry, I haven't found a solution either🥹🥹🥹.

Yatogaii avatar May 28 '24 08:05 Yatogaii

The same behaviour

  • Ghidra 11.0.3 & 10.3.2
  • OpenJDK 21
  • Windows 10

deniska-iriska avatar Jun 10 '24 21:06 deniska-iriska

Looks like plugin unproperly import third-party libs. As example log4j from "Ghidra/Framework/Generic/lib/log4j-core-x.y.z.jar" or flatlaf from "Ghidra/Framework/Gui/lib/flatlaf-x.y.z.jar". If I manually import flatlaf, then 2 more lines of logs appear in the console

deniska-iriska avatar Jun 10 '24 22:06 deniska-iriska

@deniska-iriska I encountered the same situation. Are there any solutions available at the moment?

cong0221 avatar Sep 05 '24 14:09 cong0221

@cong0221, nope. I just started using IDA Pro

deniska-iriska avatar Sep 12 '24 09:09 deniska-iriska