From a7b2d9c19f2e9a59f99c803ced0bef342c93f09c Mon Sep 17 00:00:00 2001 From: Mike Hunhoff Date: Tue, 19 Dec 2023 15:34:38 -0700 Subject: [PATCH] update Jep requirement to 4.2 (#83) * update Jep requirement to 4.2 * fix Python 3.12 escape error * fix #79 * update README for Jep 4.2 --- README.md | 2 +- build.gradle | 2 +- data/python/jepwelcome.py | 2 +- data/python/jepwrappers.py | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3063386..336d951 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ The following tools are needed to build, install, and run Ghidrathon: Tool | Version |Source | |---|---|---| | Ghidra | `>= 10.3` | https://ghidra-sre.org | -| Jep | `>= 4.1.1` | https://github.com/ninia/jep | +| Jep | `4.2.0` | https://github.com/ninia/jep | | Gradle | `>= 7.3` | https://gradle.org/releases | | Python | `>= 3.8` | https://www.python.org/downloads | diff --git a/build.gradle b/build.gradle index 59b952f..3fe7290 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,7 @@ else { // the env variable "JAVA_HOME" containing absolute path to Java JDK configured for Ghidra task installJep(type: Exec) { environment "JAVA_HOME", System.getProperty("java.home") - commandLine pythonBin, '-m', 'pip', 'install', 'jep' + commandLine pythonBin, '-m', 'pip', 'install', 'jep==4.2' } // we need to copy the Jep native binaries built in installJep to our extension directory; we use a small diff --git a/data/python/jepwelcome.py b/data/python/jepwelcome.py index 7ef1918..7923a58 100644 --- a/data/python/jepwelcome.py +++ b/data/python/jepwelcome.py @@ -15,7 +15,7 @@ import sys -message = """ +message = r""" _____ _ _ _ _ _ / ____| | (_) | | | | | | | | __| |__ _ __| |_ __ __ _| |_| |__ ___ _ __ diff --git a/data/python/jepwrappers.py b/data/python/jepwrappers.py index 1d12a44..9018254 100644 --- a/data/python/jepwrappers.py +++ b/data/python/jepwrappers.py @@ -311,6 +311,10 @@ def wrapped_state(): return get_script_state() +def wrapped_script(): + return get_script() + + def wrapped_currentProgram(): return get_script_state().getCurrentProgram() @@ -333,6 +337,7 @@ def wrapped_currentHighlight(): __builtins__["monitor"] = wrapped_monitor __builtins__["state"] = wrapped_state +__builtins__["script"] = wrapped_script __builtins__["currentProgram"] = wrapped_currentProgram __builtins__["currentAddress"] = wrapped_currentAddress __builtins__["currentLocation"] = wrapped_currentLocation