Home

Awesome

IdaJava 0.3

IdaJava is a plugin for IDA Pro that allows to write IDA plugins in Java. In other words: IdaJava is to Java like IDAPython is to Python... The plugin creates an in-process Java VM and looks for JAR files in IDA's plugins directory. Each Java based plugin gets their own menu item in Edit|Plugins.

NOTE (2017): This is old code that will likely no longer work. It's mainly here for reference. I don't plan on making further changes.

Table of Contents

Requirements

Obviously:

To rebuild language bindings:

Bugs

There are quite a few rough edges:

How to build

IdaJava was developed using Visual Studio 2010, but should compile on Visual Studio 2005/2008 as well. Just link with jvm.lib from a 32-bit Sun JDK and the ida.lib from the IDA 5.7 SDK. There are no other dependencies.

To rebuild the SWIG bindings, edit CallSwig.cmd and execute it. It will produce quite a few warnings, though.

The Java part of IdaJava was developed with Eclipse 3.6. Earlier versions will work as well. The complete project is included.

Source code is in part documented using JavaDoc-style comments. Java sources can thus be processed with JavaDoc, C++ sources with Doxygen.

The folder structure is roughly:

idajava/
+- javasrc/      Java project
|  +- bin/       Compiled Java classes
|  +- src/       Java source folder
|  +- external/  External source packages of used libraries
|  +- lib/       Jar files needed for building
+- cppsrc/       C++ project
|  +- Debug/     Debug build result files
|  +- Release/   Release build results files
|  +- src/       C++ sources
+- CONTRIBUTERS
+- LICENSE
+- README.md

Installation

  1. Copy the file cppsrc\Debug\idajava.plw to your IDA plugin directory.
  2. Copy the folder javasrc\bin\de folder to your IDA plugin directory
  3. Copy the sample plugin javasrc\sample-plugin.jar to a sub directory java in your IDA directory.
  4. Import cppsrc\EmptyPluginSettings.reg into the registry (the registry path HKCU\Software\blichmann.de\IdaJava\0.3 must exist).

Using the steps above, the Java part of IdaJava will be run from the compiled .class files instead of a JAR file. After loading a database, invoke the plugin with CTRL+8, it should display a small about dialog. To invoke the sample plugin, use the Edit|IdaJava Hello World Plugin menu item. It should display the current screen address in decimal.

Developing Java Plugins for IDA

  1. Extend your plugin class from de.blichmann.idajava.api.plugin.IdaPlugin and implement the getDisplayName(), getHotkey() and run() methods (see the Java source, esp. de.blichmann.idajava.samples.HelloIdaPlugin).
  2. Package your plugin as a JAR file (you can use Eclipse or an Ant task for that) and drop it in a directory IDADIR\java.

You can attach a debugger to the running Java VM inside of IDA. Your other options are of course System.out.println() and/or logging, sorry.

Access to a large part of the IDA SDK is provided through the classes of the de.blichmann.idajava.natives package. Constants are defined in de.blichmann.idajava.natives.IdaJavaConstants, API functions in de.blichmann.idajava.natives.IdaJava. A PrintStream for convenient output to IDA's message window is available in de.blichmann.idajava.api.IdaConsole. A part of idc.idc has been converted as well, it is available in the de.blichmann.api.idc.IdcCompat class (expect bugs!).

Future Directions

Copyright/Licensing

IDAJava version 0.3 Copyright (c)2007-2017 Christian Blichmann idajava@blichmann.eu

IdaJava is subject to the terms of the GPLv2. See LICENSE for details. This also applies to all classes in the de.blichmann.framework package.