From 67a6ab60d82262361e306bbc5725c92eccd9c7a7 Mon Sep 17 00:00:00 2001 From: Joel Anderson Date: Thu, 24 Apr 2025 15:58:58 -0400 Subject: [PATCH 1/4] bump versions --- .github/workflows/build.yml | 10 ++++++++++ CHANGELOG.md | 7 +++++++ build.gradle | 8 ++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be73f31..b54659e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,16 @@ jobs: ghidra-sha256: "73b42cec587f370bfef49809ae55d2c7a3db689e8f164a1e7d7b8de295b6359f" ghidra-filename: "ghidra_11.3_PUBLIC_20250205.zip" ghidra-folder: "ghidra_11.3_PUBLIC" + - ghidra: "11.3.1" + ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.3.1_build/ghidra_11.3.1_PUBLIC_20250219.zip" + ghidra-sha256: "bcda0a9de8993444766cc255964c65c042b291ddaf6c50d654e316e442b441fa" + ghidra-filename: "ghidra_11.3.1_PUBLIC_20250219.zip" + ghidra-folder: "ghidra_11.3.1_PUBLIC" + - ghidra: "11.3.2" + ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.3.2_build/ghidra_11.3.2_PUBLIC_20250415.zip" + ghidra-sha256: "99d45035bdcc3d6627e7b1232b7b379905a9fad76c772c920602e2b5d8b2dac2" + ghidra-filename: "ghidra_11.3.2_PUBLIC_20250415.zip" + ghidra-folder: "ghidra_11.3.2_PUBLIC" env: GHIDRA_INSTALL_DIR: /home/runner/ghidra/${{ matrix.ghidra-folder }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aa66db..3b72d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.0.0] - 2025-04-24 +### Changed + - Upgrade to JRuby 10.0.0.0 (Ruby 3.4.2) + - Upgrade to Groovy 4.0.26 + - Upgrade to Kotlin 2.1.20 + + ## [4.2.0] - 2025-02-14 ### Changed - Upgrade to JRuby 9.4.12.0 (Ruby 3.1.4) diff --git a/build.gradle b/build.gradle index 5239088..f75d810 100644 --- a/build.gradle +++ b/build.gradle @@ -19,12 +19,12 @@ plugins { } dependencies { - implementation('org.jruby:jruby-complete:9.4.12.0') + implementation('org.jruby:jruby-complete:10.0.0.0') implementation('org.clojure:clojure:1.12.0') - implementation('org.apache.groovy:groovy:4.0.25') - implementation('org.apache.groovy:groovy-groovysh:4.0.25') + implementation('org.apache.groovy:groovy:4.0.26') + implementation('org.apache.groovy:groovy-groovysh:4.0.26') testImplementation('junit:junit:4.13.2') - runtimeOnly('org.jetbrains.kotlin:kotlin-scripting-jsr223:2.1.10') + runtimeOnly('org.jetbrains.kotlin:kotlin-scripting-jsr223:2.1.20') } test { From 951b9a572ecebf6944ba1941082b8cd30f5b04b9 Mon Sep 17 00:00:00 2001 From: Joel Anderson Date: Fri, 25 Apr 2025 14:31:01 -0400 Subject: [PATCH 2/4] add terminal and kotlin fixes --- CHANGELOG.md | 6 ++++++ .../rubydragon/kotlin/KotlinGhidraInterpreter.java | 11 +++++++++++ src/main/resources/scripts/ruby-init.rb | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b72d02..9274e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgrade to Groovy 4.0.26 - Upgrade to Kotlin 2.1.20 +### Fixed + - Ruby console errors on non-Windows systems related to the terminal not using + the typical STDIN file descriptor. + - Kotlin engine startup now includes a warm-up evaluation so that the first + user expression does not have to wait for this. + ## [4.2.0] - 2025-02-14 ### Changed diff --git a/src/main/java/com/goatshriek/rubydragon/kotlin/KotlinGhidraInterpreter.java b/src/main/java/com/goatshriek/rubydragon/kotlin/KotlinGhidraInterpreter.java index 4cf622c..d7ff607 100644 --- a/src/main/java/com/goatshriek/rubydragon/kotlin/KotlinGhidraInterpreter.java +++ b/src/main/java/com/goatshriek/rubydragon/kotlin/KotlinGhidraInterpreter.java @@ -208,6 +208,17 @@ public void initInteractiveInterpreter() { setVariables.forEach((name, value) -> { engine.put(name, value); }); + + // evaluate a dummy expression to warm up the engine + // without this, the first expression evaluated by the user will take + // much longer to come back + try { + engine.eval("\"warm up\""); + } catch (ScriptException e) { + + errWriter.append("could not warm up Kotlin interpreter \n"); + errWriter.flush(); + } } /** diff --git a/src/main/resources/scripts/ruby-init.rb b/src/main/resources/scripts/ruby-init.rb index 068b7f4..8c51436 100644 --- a/src/main/resources/scripts/ruby-init.rb +++ b/src/main/resources/scripts/ruby-init.rb @@ -1,4 +1,13 @@ +# before we require irb, we need to make sure that io-console uses the stub +# console, since the STDIN stream we are using isn't a normal terminal +host_os = RbConfig::CONFIG['host_os'] +RbConfig::CONFIG['host_os'] = 'windows' + require 'irb' + +# now that irb is required, we can switch the host os back +RbConfig::CONFIG['host_os'] = host_os + require 'irb/completion' # allow java-like package names, and import irb and completions From 063e531e57f5d722d3d499f04bb7396a09731d36 Mon Sep 17 00:00:00 2001 From: Joel Anderson Date: Fri, 25 Apr 2025 14:40:52 -0400 Subject: [PATCH 3/4] update workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b54659e..9ad4c02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - ghidra: ["11.3"] + ghidra: ["11.3", "11.3.1", "11.3.2"] include: - ghidra: "11.3" ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.3_build/ghidra_11.3_PUBLIC_20250205.zip" From f21d21e80a078627788112839eba55a380f77266 Mon Sep 17 00:00:00 2001 From: Joel Anderson Date: Fri, 25 Apr 2025 14:47:53 -0400 Subject: [PATCH 4/4] minor updates --- CHANGELOG.md | 2 +- src/main/resources/scripts/ruby-init.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9274e51..d4c7e43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [5.0.0] - 2025-04-24 +## [5.0.0] - 2025-04-25 ### Changed - Upgrade to JRuby 10.0.0.0 (Ruby 3.4.2) - Upgrade to Groovy 4.0.26 diff --git a/src/main/resources/scripts/ruby-init.rb b/src/main/resources/scripts/ruby-init.rb index 8c51436..c03df8b 100644 --- a/src/main/resources/scripts/ruby-init.rb +++ b/src/main/resources/scripts/ruby-init.rb @@ -5,7 +5,7 @@ require 'irb' -# now that irb is required, we can switch the host os back +# now that irb has loaded, we can switch the host os back RbConfig::CONFIG['host_os'] = host_os require 'irb/completion'