-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a basic Java interpreter implemented using JShell. This interpreter is intended to be similar in functionality to the Jython interpreter included with Ghidra, but more useful for developing and testing Java scripts.
- Loading branch information
1 parent
ad8193d
commit 1e11541
Showing
21 changed files
with
839 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
Ruby Dragon | ||
Copyright 2021 Joel E. Anderson | ||
Copyright 2021-2022 Joel E. Anderson | ||
|
||
The JRuby binary included in the lib folder is Copyright (c) 2007-2018 The JRuby | ||
project and covered by a tri EPL 2.0/GPL 2/LGPL 2.1 license. For the source code | ||
of the project, refer to the project repository at | ||
https://github.com/jruby/jruby. The full terms of the license can be found at | ||
The JRuby project is Copyright (c) 2007-2018 The JRuby project and covered by a | ||
tri EPL 2.0/GPL 2/LGPL 2.1 license. For the source code of the project, refer | ||
to the project repository at https://github.com/jruby/jruby. The full terms of | ||
the license can be found at | ||
https://github.com/jruby/jruby/blob/master/COPYING. | ||
|
||
The Java log included in the src/main/resources/images folder is Copyright (c) | ||
Oracle. | ||
|
||
The Kotlin logo included in the src/main/resources/images folder is | ||
Copyright (c) Kotlin Foundation. Kotlin is covered under the Apache 2.0 license. | ||
For more details on the language and its resources, see https://kotlinlang.org/. | ||
For the full terms of the license included with Kotlin, see | ||
https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt. | ||
|
||
The Clojure binary included in the lib folder is from the Clojure project, | ||
Copyright (c) Rich Hickey. All rights reserved. It is covered by the EPL 1.0 | ||
license. For the source code of the project, refer to the project repository at | ||
https://github.com/clojure/clojure. The full terms of the license can be found | ||
at https://github.com/clojure/clojure/blob/master/epl-v10.html. | ||
The Clojure logo included in the src/main/resources/images folder is from the | ||
Clojure project, Copyright (c) Rich Hickey. All rights reserved. Clojure is | ||
covered by the EPL 1.0 license. For the source code of the project, refer to | ||
the project repository at https://github.com/clojure/clojure. The full terms | ||
of the license can be found at | ||
https://github.com/clojure/clojure/blob/master/epl-v10.html. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
|
||
<HTML> | ||
<HEAD> | ||
<META name="generator" content= | ||
"HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net"> | ||
<META http-equiv="Content-Language" content="en-us"> | ||
<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> | ||
<META name="GENERATOR" content="Microsoft FrontPage 4.0"> | ||
<META name="ProgId" content="FrontPage.Editor.Document"> | ||
|
||
<TITLE>JShell Interpreter</TITLE> | ||
<LINK rel="stylesheet" type="text/css" href="../../shared/Frontpage.css"> | ||
</HEAD> | ||
|
||
<BODY> | ||
<H1><a name="JShell"></a>JShell Interpreter</H1> | ||
|
||
<P> | ||
Ruby Dragon adds an interactive Java shell to Ghidra for use in script | ||
development and running snippets of Java. | ||
</P> | ||
|
||
<P> | ||
This is accomplished using JShell, which is included in Java. | ||
</P> | ||
|
||
<H2>Environment</H2> | ||
<BLOCKQUOTE> | ||
<P> | ||
The JShell interactive interpreter runs as a simple Java REPL. | ||
|
||
The same variables that are available in Ghidra's Java and Python | ||
environments are also available in the JShell interpreter as global | ||
variables: | ||
</P> | ||
|
||
<PRE> | ||
currentAddress | ||
currentHighlight | ||
currentLocation | ||
currentProgram | ||
currentSelection | ||
</PRE> | ||
</BLOCKQUOTE> | ||
|
||
<H2>Copy/Paste</H2> | ||
<BLOCKQUOTE> | ||
<P> | ||
Copy and paste from within the JShell interpreter should work as expected | ||
for your given environment: | ||
<UL> | ||
<LI><B>Windows:</B> CTRL+C / CTRL+V</LI> | ||
<LI><B>Linux:</B> CTRL+C / CTRL+V</LI> | ||
<LI><B>OS X:</B> COMMAND+C / COMMAND+V</LI> | ||
</UL> | ||
</P> | ||
</BLOCKQUOTE> | ||
|
||
<H2><A name="Clear_Interpreter"></A>Clear <IMG border="0" src="images/erase16.png"></H2> | ||
<BLOCKQUOTE> | ||
<P> | ||
This command clears the interpreter's display. Its effect is purely visual. | ||
It does not affect the state of the interpreter in any way. | ||
</P> | ||
</BLOCKQUOTE> | ||
|
||
<H2><A name="Interrupt_Interpreter"></A>Interrupt <IMG border="0" src="images/dialog-cancel.png"></H2> | ||
<BLOCKQUOTE> | ||
<P> | ||
This command issues a stop action to the interpreter, which can be used to interrupt | ||
long running commands or loops. | ||
</P> | ||
</BLOCKQUOTE> | ||
|
||
<H2><A name="Reset_Interpreter"></A>Reset <IMG border="0" src="images/reload3.png"></H2> | ||
<BLOCKQUOTE> | ||
<P> | ||
This command resets the interpreter, which clears the display and resets all state. | ||
</P> | ||
</BLOCKQUOTE> | ||
|
||
<P align="left" class="providedbyplugin">Provided by: <I>RubyDragon</I></P> | ||
</BODY> | ||
</HTML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.