Write a Ghidra Extension without using Java or Eclipse!

Overview

Ghidra Extension in Kotlin using IntelliJ IDEA

Write a Ghidra Extension without using Java or Eclipse!

Setup

  • Hit Use this template at the top of the repo on GitHub
  • Clone the new repo to your development machine
  • Add the line GHIDRA_INSTALL_DIR=/path/to/your/ghidra_10.1_PUBLIC/ to $HOME/.gradle/gradle.properties
  • Open IntelliJ, create a new Project from Existing Sources... and select the build.gradle
    • If you are using the Kotlin Jupyter Plugin uncomment the line in the dependencies block in the build.gradle
  • Wait for IntelliJ to finish indexing and fetching dependencies, hit the build button, and then run Ghidra

Features

  • Gradle Config that works out of the box with IntelliJ
  • IntelliJ IDEA Run Configuration for debugging of the extension
  • GitHub CI files that
    • make sure the extension at least builds for each PR
    • will automatically build a release and publish it on GitHub if a commit is tagged with a version matching vX.X.X, e.g. v1.2.3/v1.2.0 (v1.2 doesn't work!)

Additional Development Tips

These aspects can not be included in the repo files itself, but make development smoother.

Thread Breakpoints

Make sure that you use breakpoints that only suspend the thread, and not everything. This means that the breakpoint will only suspend the thread that is currently running the analysis or the script, and the GUI will keep working.

  • Set a breakpoint, right-click the icon, and in the Suspend line select Thread instead of All
  • IntelliJ IDEA will suggest making this the default, click this too

Use Scripts and the Jupyter Kernel to prototype ideas

With the Kotlin Jupyter Plugin you can test your new ideas first. IntelliJ IDEA can do hot reloading of classes, but this has limits and then still requires a Ghidra restart, which takes an annoying amount of time. The QT Console is fairly basic, but the Jupyter Notebook uses nearly the same code analysis engine as IntelliJ itself.

Automatic conversion to Kotlin

  • pasting Java code into a Kotlin file you will get the suggestion for this to be converted and then pasted
  • right-click .java file in the Project Tree there is an action at the very bottom to convert the entire file

Issues

If any step in this process doesn't work as described in the README, please open an issue on GitHub. I have only tested this on Linux so there might be some aspects that work differently on macOS or Windows, though these should be minor.

Known issues

Ghidra looks even worse than usual when run via IDE

The run configuration only includes the class loader VM option, and none of the others that are usually set by the Ghidra launch script, which include OpenGL settings and Font Anti Aliasing, because this depends on the OS.

Generate the VM options for your system:

cd $GHIDRA_INSTALL_DIR
java -cp ./support/LaunchSupport.jar LaunchSupport ./support/.. -vmargs

and then edit the run configuration and add them.

You might also like...
A collection of useful extension methods for Android

Kotlin Jetpack A collection of useful extension methods for Android Arguments Bindings Preferences Bindings Resources Bindings Arguments Bindings publ

A set of extension properties on Int, Long, Double, and Duration, that makes it easier to work with Kotlin Duration

Kotlin Duration Extensions Gradle Groovy repositories { mavenCentral() } implementation 'com.eygraber:kotlin-duration-extensions:1.0.1' Kotlin rep

Most used extension methods for Kotlin

Extensify Most used extension methods for Kotlin Download Step 1. Add the JitPack repository to your build file allprojects { repositories {

A kotlin library of extension functions that add smalltalk style methods to objects.

KtTalk A kotlin library of extension functions that add smalltalk style methods to objects. Motivation Smalltalk is a pure OO language in which everyt

Extension functions over Android's callback-based APIs which allows writing them in a sequential way within coroutines or observe multiple callbacks through kotlin flow.

callback-ktx A lightweight Android library that wraps Android's callback-based APIs into suspending extension functions which allow writing them in a

A library provides some useful kotlin extension functions

ktext ๐Ÿ”ฅ A library provides some useful kotlin extension functions. Including in your project Gradle Add below codes to your root build.gradle file (n

A Burp extension to find stuff ยฏ\_(ใƒ„)_/ยฏ
A Burp extension to find stuff ยฏ\_(ใƒ„)_/ยฏ

FindStuffer FindStuffer, a Burp extension to find stuff, both for Community and Pro versions. You can use FindStuffer to aggregate as many text querie

Jackson extension for Mojang's NBT format

Jackson NBT Data Format Implements Mojang's NBT format in jackson. Usage Using this format works just like regular jackson, but with the ObjectMapper

Android Spinner Dialog Library supported on both Java and Kotlin, Use for single or multi selection of choice
Android Spinner Dialog Library supported on both Java and Kotlin, Use for single or multi selection of choice

SpinnerDialog Android Spinner Dialog Library, Use for single or multi selection of choice Android UI Download To include SpinnerDialog in your project

Owner
Florian Magin
Hacking and Reverse Engineering of Computers and Brains
Florian Magin
This repository is part of a Uni-Project to write a complete Compiler for a subset of Java.

Compiler This repository is part of a Uni-Project to write a complete Compiler for a subset of Java. Features error recovery using context sensitive a

null 3 Jan 10, 2022
Android MVVM framework write in kotlin, develop Android has never been so fun.

KBinding ไธญๆ–‡็‰ˆ Android MVVM framework write in kotlin, base on anko, simple but powerful. It depends on my another project AutoAdapter(A library for sim

Benny 413 Dec 5, 2022
Don't write a RecyclerView adapter again. Not even a ViewHolder!

LastAdapter Don't write a RecyclerView adapter again. Not even a ViewHolder! Based on Android Data Binding Written in Kotlin No need to write the adap

Miguel รngel Moreno 781 Dec 19, 2022
use kmm to write a flutter plugin

use KMM to write a flutter plugin The reference plugin_codelab example plugin that accompanies the How to write a Flutter plugin codelab. I changed pl

libill 8 Nov 9, 2022
The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

Martmists 14 Dec 26, 2022
A React Native library making file access easier for developers as first class citizens, without the tears

React Native File Gateway A React Native library making file access easier for developers as first class citizens, without the tears. โš ๏ธ NOTE: This li

Jimmy Wei 4 Sep 11, 2021
Create minecraft worlds without lag!

WorldGen ๋ž™ ์—†๋Š” ์›”๋“œ ์ƒ์„ฑ์„ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ, ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” UHC_System ์˜ ์›”๋“œ ์ƒ์„ฑ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋ฉด์„œ WorldCreator์˜ ๋‹จ์ ์ธ ๋ž™์„ ์—†์• ๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์–ด์ง„ ์ฝ”๋“œ์˜ ์ผ๋ถ€๋ฅผ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ๊ณต๊ฐœํ•˜๋Š” ๊ฒƒ์ž„์„ ์•Œ๋ ค๋“œ๋ฆฝ๋‹ˆ๋‹ค WorldCre

dolphin2410 4 Jul 29, 2022
Minecraft Server Software specially designed for Thicc SMP. Here on GitHub without the private patches, just a normal hybrid JettPack-Pufferfish-Empirecraft fork

AlynaaMC A private, custom server software for Thicc SMP and a fork of Pufferfish. Here on GitHub with patches from JettPack, Airplane and Pufferfish

ThiccMC 14 Dec 31, 2021
An extension of EditText with pin style written in Kotlin

pin-edittext An extension of EditText with pin style Usage Include PinCodeEditText in your layout XML <com.oakkub.android.PinEditText android:layo

Metas Kerdwat 15 May 28, 2021
A collection of useful Kotlin extension for Android

karamba A collection of useful Kotlin extension for Android Install Add to gradle in allprojects maven { url 'https://jitpack.io' } then add this com

Matteo Crippa 48 Dec 15, 2022