Skip to content

Commit 0e4bf1c

Browse files
authored
upgrade for 11.3
Version bumps, deprecations, and documentation updates for Ghidra 11.3.
1 parent 7e31f81 commit 0e4bf1c

File tree

10 files changed

+82
-47
lines changed

10 files changed

+82
-47
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,20 @@ jobs:
1212
runs-on: "ubuntu-latest"
1313
strategy:
1414
matrix:
15-
ghidra: ["11.1", "11.1.1", "11.2.1"]
15+
ghidra: ["11.3"]
1616
include:
17-
- ghidra: "11.1"
18-
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.1_build/ghidra_11.1_PUBLIC_20240607.zip"
19-
ghidra-sha256: "293f60e04fa480315d2c467f4b2b4b10b3b6b5c8a8416bf7167fe082406e3be8"
20-
ghidra-filename: "ghidra_11.1_PUBLIC_20240607.zip"
21-
ghidra-folder: "ghidra_11.1_PUBLIC"
22-
- ghidra: "11.1.1"
23-
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.1.1_build/ghidra_11.1.1_PUBLIC_20240614.zip"
24-
ghidra-sha256: "7fe8d9a6e7e5267f3cf487a0c046b21fb08d7a602facaa2e81ac2f09b5df2866"
25-
ghidra-filename: "ghidra_11.1.1_PUBLIC_20240614.zip"
26-
ghidra-folder: "ghidra_11.1.1_PUBLIC"
27-
- ghidra: "11.2.1"
28-
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.2.1_build/ghidra_11.2.1_PUBLIC_20241105.zip"
29-
ghidra-sha256: "ce4db5117da0fbaf8f33863fec4f40902f754f06b68945a59fb1c0f9b1bc461c"
30-
ghidra-filename: "ghidra_11.2.1_PUBLIC_20241105.zip"
31-
ghidra-folder: "ghidra_11.2.1_PUBLIC"
17+
- ghidra: "11.3"
18+
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.3_build/ghidra_11.3_PUBLIC_20250205.zip"
19+
ghidra-sha256: "73b42cec587f370bfef49809ae55d2c7a3db689e8f164a1e7d7b8de295b6359f"
20+
ghidra-filename: "ghidra_11.3_PUBLIC_20250205.zip"
21+
ghidra-folder: "ghidra_11.3_PUBLIC"
3222

3323
env:
3424
GHIDRA_INSTALL_DIR: /home/runner/ghidra/${{ matrix.ghidra-folder }}
3525
steps:
3626
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3727
- name: Cache Ghidra
38-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
28+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
3929
id: cache-ghidra
4030
with:
4131
path: ~/ghidra
@@ -46,23 +36,16 @@ jobs:
4636
wget -q ${{ matrix.ghidra-url }}
4737
echo "${{ matrix.ghidra-sha256 }} ${{ matrix.ghidra-filename }}" | sha256sum -c
4838
unzip ${{ matrix.ghidra-filename }} -d ~/ghidra
49-
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
39+
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
5040
with:
51-
distribution: 'adopt'
52-
java-version: '21'
53-
- name: Set Up SDK Environment
54-
run: |
55-
curl -s "https://get.sdkman.io?rcupdate=false" | bash
56-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
57-
sdk install gradle 8.8
58-
sdk use gradle 8.8
59-
sdk default gradle 8.8
41+
distribution: "temurin"
42+
java-version: "21"
43+
cache: "gradle"
6044
- name: Run Unit Tests
6145
run: |
6246
echo "skipping gradle test due to inconsistencies in reliability"
6347
- name: Build and Install
6448
run: |
65-
source "/home/runner/.sdkman/bin/sdkman-init.sh"
6649
gradle buildExtension
6750
rm -rf $GHIDRA_INSTALL_DIR/Ghidra/Extensions/ruby-dragon
6851
unzip dist/$(ls dist) -d $GHIDRA_INSTALL_DIR/Ghidra/Extensions

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8-
## [4.1.0] - 2024-11-8
8+
## [4.2.0] - 2025-02-14
9+
### Changed
10+
- Upgrade to JRuby 9.4.12.0 (Ruby 3.1.4)
11+
- Upgrade to Groovy 4.0.25
12+
- Upgrade to Kotlin 2.1.10
13+
14+
### Deprecated
15+
- `DragonPlugin.getCompletions(String cmd)` in favor of
16+
`DragonPlugin.getCompletions(String cmd, int caretPos)`. This mirrors the
17+
deprecation of the same method in
18+
`ghidra.app.plugin.core.interpreter.InterpreterConnection`.
19+
20+
21+
## [4.1.0] - 2024-11-08
922
### Changed
1023
- Upgrade to JRuby 9.4.9.0 (Ruby 3.1.4)
1124
- Upgrade to Clojure 1.12.0
@@ -27,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2740
- Warnings and `launch.properties` files for broken JRuby support in older
2841
versions of Ghidra.
2942

43+
3044
## [3.3.0] - 2024-03-28
3145
### Changed
3246
- Upgrade to JRuby 9.4.6.0 (Ruby 3.1.4)

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ plugins {
1919
}
2020

2121
dependencies {
22-
implementation('org.jruby:jruby-complete:9.4.9.0')
22+
implementation('org.jruby:jruby-complete:9.4.12.0')
2323
implementation('org.clojure:clojure:1.12.0')
24-
implementation('org.apache.groovy:groovy:4.0.23')
25-
implementation('org.apache.groovy:groovy-groovysh:4.0.23')
24+
implementation('org.apache.groovy:groovy:4.0.25')
25+
implementation('org.apache.groovy:groovy-groovysh:4.0.25')
2626
testImplementation('junit:junit:4.13.2')
27-
runtimeOnly('org.jetbrains.kotlin:kotlin-scripting-jsr223:2.0.21')
27+
runtimeOnly('org.jetbrains.kotlin:kotlin-scripting-jsr223:2.1.10')
2828
}
2929

3030
test {

src/main/java/com/goatshriek/rubydragon/DragonException.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
/*
4-
* Copyright 2021-2022 Joel E. Anderson
4+
* Copyright 2021-2025 Joel E. Anderson
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,12 +18,23 @@
1818

1919
package com.goatshriek.rubydragon;
2020

21+
/**
22+
* A generic exception from RubyDragon.
23+
*
24+
* This class shouldn't be used directly, instead it should be extended and then
25+
* the more specific child should be thrown instead.
26+
*/
2127
public class DragonException extends Exception {
2228
/**
2329
* Auto-generated serial version UID.
2430
*/
2531
private static final long serialVersionUID = -7049257880213278474L;
2632

33+
/**
34+
* A new generic RubyDragon exception.
35+
*
36+
* @param message A description of the issue encountered.
37+
*/
2738
public DragonException(String message) {
2839
super(message);
2940
}

src/main/java/com/goatshriek/rubydragon/DragonPlugin.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public abstract class DragonPlugin extends ProgramPlugin implements InterpreterC
6767
* @since 2.2.0
6868
*/
6969
public static final String OPTION_CATEGORY_NAME = "Ruby Dragon Interpreters";
70-
70+
7171
/**
7272
* The name of the plugin category used by DragonPlugins.
7373
*
@@ -197,12 +197,28 @@ public String getAutoImportOptionName() {
197197
* @param cmd The command to try to complete.
198198
*
199199
* @return A list of possible code completions.
200+
*
201+
* @deprecated Move to using {@link #getCompletions(String, int)}.
200202
*/
201-
@Override
203+
@Deprecated
202204
public List<CodeCompletion> getCompletions(String cmd) {
203205
return getInterpreter().getCompletions(cmd);
204206
}
205207

208+
/**
209+
* Gets a {@link List} of {@link CodeCompletion code completions} for the given
210+
* command relative to the given caret position.
211+
*
212+
* @param cmd The command to get code completions for.
213+
* @param caretPos The position of the caret in cmd. It must satisfy the
214+
* constraint {@code 0 <= caretPos <= cmd.length()}.
215+
* @return A {@link List} of code completions for the given command.
216+
*/
217+
@Override
218+
public List<CodeCompletion> getCompletions(String cmd, int caretPos) {
219+
return getInterpreter().getCompletions(cmd.substring(0, caretPos));
220+
}
221+
206222
/**
207223
* The icon for this plugin.
208224
*/

src/main/java/com/goatshriek/rubydragon/MissingDragonDependency.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
/*
4-
* Copyright 2021-2022 Joel E. Anderson
4+
* Copyright 2021-2025 Joel E. Anderson
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,12 +18,21 @@
1818

1919
package com.goatshriek.rubydragon;
2020

21+
/**
22+
* Used when a runtime dependency needed for some RubyDragon functionality is
23+
* missing.
24+
*/
2125
public class MissingDragonDependency extends DragonException {
2226
/**
2327
* Auto-generated serial version UID.
2428
*/
2529
private static final long serialVersionUID = -4736891692182929160L;
2630

31+
/**
32+
* Creates a new missing dependency message with the given message.
33+
*
34+
* @param message A message describing the missing dependency.
35+
*/
2736
public MissingDragonDependency(String message) {
2837
super(message);
2938
}

src/main/java/com/goatshriek/rubydragon/clojure/ClojureGhidraInterpreter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public ClojureGhidraInterpreter() {
8383
* the new interpreter.
8484
*
8585
* @param console The console to bind to the interpreter streams.
86-
* @param parentPlugin The DragonPlugin instance owning this interpreter.
86+
* @param plugin The DragonPlugin instance owning this interpreter.
8787
*/
8888
public ClojureGhidraInterpreter(InterpreterConsole console, DragonPlugin plugin) {
8989
this();

src/main/java/com/goatshriek/rubydragon/groovy/GroovyGhidraInterpreter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public GroovyGhidraInterpreter() {
9494
* @param in The input stream to use for the interpeter.
9595
* @param out The output stream to use for the interpreter.
9696
* @param err The error stream to use for the interpreter.
97+
* @param plugin The plugin that manages this interpreter.
9798
*/
9899
public GroovyGhidraInterpreter(InputStream in, OutputStream out, OutputStream err, DragonPlugin plugin) {
99100
inStream = in;

src/main/java/com/goatshriek/rubydragon/ruby/RubyGhidraInterpreter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public RubyGhidraInterpreter() {
8080
* the new interpreter.
8181
*
8282
* @param console The console to bind to the interpreter streams.
83+
* @param plugin The plugin that manages this interpreter.
8384
*/
8485
public RubyGhidraInterpreter(InterpreterConsole console, DragonPlugin plugin) {
8586
this();

src/test/resources/expected/GhidraBasicsScript.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ FUN_0040195b
4040
FUN_00401961
4141
FUN_0040196d
4242
FUN_00401970
43-
_guard_check_icall
43+
guard_check_icall
4444
FUN_00401994
4545
FUN_0040199a
4646
FUN_004019a0
@@ -62,28 +62,28 @@ Unwind@00401e57
6262
__current_exception
6363
__current_exception_context
6464
memset
65-
_except_handler4_common
65+
except_handler4_common
6666
_seh_filter_exe
6767
_set_app_type
6868
__setusermatherr
6969
_configure_narrow_argv
7070
_initialize_narrow_environment
71-
_get_initial_narrow_environment
72-
_initterm
73-
_initterm_e
71+
get_initial_narrow_environment
72+
initterm
73+
initterm_e
7474
exit
7575
_exit
7676
_set_fmode
7777
__p___argc
7878
__p___argv
7979
_cexit
8080
_c_exit
81-
_register_thread_local_exe_atexit_callback
81+
register_thread_local_exe_atexit_callback
8282
_configthreadlocale
8383
__p__commode
84-
_initialize_onexit_table
85-
_register_onexit_function
86-
_crt_atexit
84+
initialize_onexit_table
85+
register_onexit_function
86+
crt_atexit
8787
_controlfp_s
8888
terminate
8989
__filter_x86_sse2_floating_point_exception_default

0 commit comments

Comments
 (0)