Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-6146 Change elastic skeleton to support 8.19.7

caheckmanad4b450f3189
diff --git a/Ghidra/Extensions/BSimElasticPlugin/README.md b/Ghidra/Extensions/BSimElasticPlugin/README.md
index b7c224b41e..b7807d5a1e 100644
--- a/Ghidra/Extensions/BSimElasticPlugin/README.md
+++ b/Ghidra/Extensions/BSimElasticPlugin/README.md
@@ -77,8 +77,8 @@ details.
## Version
-The current BSim plug-in was tested with Elasticsearch version `8.8.1`. A change to the
-Elasticsearch scripting interface, starting with version `7.15`, makes the BSim plug-in incompatible
+The current BSim plug-in was tested with Elasticsearch version `8.19.7`. A change to the
+Elasticsearch scripting interface, starting with version `8.16`, makes the BSim plug-in incompatible
with previous versions, but the lsh plug-in jars may work without change across later Elasticsearch
versions.
@@ -93,7 +93,7 @@ elasticsearch/plugin-descriptor.properties
The file format is fairly simple: edit the line
```
-elasticsearch.version=8.8.1
+elasticsearch.version=8.19.7
```
The plugin may work with other nearby versions, but proceed at your own risk.
diff --git a/Ghidra/Extensions/BSimElasticPlugin/build.gradle b/Ghidra/Extensions/BSimElasticPlugin/build.gradle
index b0ee3f42a9..fdf2c379b1 100755
--- a/Ghidra/Extensions/BSimElasticPlugin/build.gradle
+++ b/Ghidra/Extensions/BSimElasticPlugin/build.gradle
@@ -92,8 +92,8 @@ task elasticPluginZip(type: Zip) {
destinationDirectory = file("build/data")
}
-// Currently targeting elasticsearch-8.8.1 which by default runs with java 20
-compileElasticPluginJava.options.release = 20
+// Currently targeting elasticsearch-8.19.7 which by default runs with java 25
+compileElasticPluginJava.options.release = 21
compileElasticPluginJava.dependsOn copyGenericTask
compileElasticPluginJava.dependsOn copyUtilityTask
diff --git a/Ghidra/Extensions/BSimElasticPlugin/contribZipExclude/plugin-descriptor.properties b/Ghidra/Extensions/BSimElasticPlugin/contribZipExclude/plugin-descriptor.properties
index bb6c329c67..4445fdfd65 100755
--- a/Ghidra/Extensions/BSimElasticPlugin/contribZipExclude/plugin-descriptor.properties
+++ b/Ghidra/Extensions/BSimElasticPlugin/contribZipExclude/plugin-descriptor.properties
@@ -2,5 +2,5 @@ description=Feature Vector Plugin
version=1.0
name=lsh
classname=org.elasticsearch.plugin.analysis.lsh.AnalysisLSHPlugin
-java.version=1.11
-elasticsearch.version=8.8.1
+java.version=1.21
+elasticsearch.version=8.19.7
diff --git a/Ghidra/Extensions/BSimElasticPlugin/src/org/elasticsearch/plugin/analysis/lsh/VectorCompareScriptFactory.java b/Ghidra/Extensions/BSimElasticPlugin/src/org/elasticsearch/plugin/analysis/lsh/VectorCompareScriptFactory.java
index e47b274018..7e063061de 100755
--- a/Ghidra/Extensions/BSimElasticPlugin/src/org/elasticsearch/plugin/analysis/lsh/VectorCompareScriptFactory.java
+++ b/Ghidra/Extensions/BSimElasticPlugin/src/org/elasticsearch/plugin/analysis/lsh/VectorCompareScriptFactory.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -73,6 +73,11 @@ public class VectorCompareScriptFactory implements ScoreScript.Factory {
return false;
}
+ @Override
+ public boolean needs_termStats() {
+ return false;
+ }
+
private static int scanForFeatures(byte[] buffer, int offset) throws IOException {
int i = 0;
while (i < FEATURES_NAME.length()) {
diff --git a/Ghidra/Extensions/BSimElasticPlugin/srcdummy/org/elasticsearch/script/ScoreScript.java b/Ghidra/Extensions/BSimElasticPlugin/srcdummy/org/elasticsearch/script/ScoreScript.java
index 01f5111046..d514b93786 100644
--- a/Ghidra/Extensions/BSimElasticPlugin/srcdummy/org/elasticsearch/script/ScoreScript.java
+++ b/Ghidra/Extensions/BSimElasticPlugin/srcdummy/org/elasticsearch/script/ScoreScript.java
@@ -5,9 +5,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,6 +39,8 @@ public abstract class ScoreScript {
public interface LeafFactory {
boolean needs_score();
+ boolean needs_termStats();
+
ScoreScript newInstance(DocReader reader) throws IOException;
}