Giter Club home page Giter Club logo

goatshriek / ruby-dragon Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 13.0 60.51 MB

Ruby, Kotlin, Groovy, Clojure, and JShell support for Ghidra scripting and interactive sessions.

Home Page: https://goatshriek.github.io/ruby-dragon/

License: Apache License 2.0

Ruby 4.25% CSS 1.99% HTML 12.11% Java 73.76% Clojure 3.02% Kotlin 2.97% Groovy 1.91%
ghidra ruby jruby plugin clojure reverse-engineering kotlin jshell contributions-welcome good-first-issue

ruby-dragon's People

Contributors

byteit101 avatar goatshriek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ruby-dragon's Issues

kotlin version of SetEquate script

Ghidra comes with a number of scripts included which serve as both examples of the sorts of things that can be done with scripts as well as perform some useful tasks. Ruby Dragon includes examples itself to show how things written in Java/Python can be done in the languages that it adds to Ghidra. More of these example scripts will provide a greater base of examples for users to refer to when writing a script in their language of choice.

Implement a Kotlin version of the SetEquateScript included with Ghidra. This should go in the ghidra_scripts folder, along with the other examples, and be put in the category Examples.Kotlin. The existing Kotlin scripts will give you some examples of the basics of using Kotlin within Ghidra.

Of course, please ask any questions you have here if you get stuck!

add a terminal emulator for interactive interpreters

An effort to integrate Jediterm into Ruby Dragon as a full terminal interpreter for interactive sessions has been started, but has been put into the backlog due to some issues arriving that don't seem to have clear solutions. Anyone wishing to pick up this work is more than welcome to - it currently lives in the term branch of the project.

image

The existing implementation allows users to switch to the terminal emulator by allowing users to enable a plugin that implements the existing InterpreterPanelService interface used by Ghidra's built in interpreter window. This works for basic sessions, but currently has a number off problems that prevent it from being ready for release (particularly on Windows), including:

  • Backspaces and other control characters work inconsistently
  • Some characters are not passed to the session. For example, letters bound to a Ghidra action are not passed to Groovy if they are the first in the line, but are otherwise.
  • Some newline vs. crlf issues (see above screenshot)

Any help making progress towards these problems is welcome, even if it is only advice on how to overcome them. My focus is currently on other features of this project as well as other projects I maintain, but that doesn't mean I've abandoned this particular feature.

interactive Ruby interpreter broken in Ghidra 10.0.3

The v1.0.0 build of the plugin in Ghidra 10.0.3 may not be able to open an interactive Ruby interpreter, instead throwing a class not found exception.

NameError: cannot load Java class org.jruby.ext.readline.Readline
      load_ext at org/jruby/ext/jruby/JRubyUtilLibrary.java:201
        <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/readline.rb:9
       require at org/jruby/RubyKernel.java:974
       require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83
  <module:IRB> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/input-method.rb:130
        <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/input-method.rb:15
       require at org/jruby/RubyKernel.java:974
       require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83
        <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:19
       require at org/jruby/RubyKernel.java:974
       require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83
        <main> at <script>:1

There are two possible workarounds for this. First, the issue does not seem to occur in JDK 11 (it has been confirmed in JDK 16). Alternatively, if changing Java versions is not an option, replacing the support/launch.properties file in the Ghidra 10.0.3 installation folder with the version from 10.0.2 also seems to resolve the issue.

An issue will be created with the Ghidra project along with a proposed patch within the next 72 hours.

access javadoc from jshell

JShell is capable of handling documentation for items in its SourceCodeAnalysis class, and the Python interpreter provides access to Javadocs using the script using the ghidradoc.py script. By combining these techniques, it should be possible to make documentation for classes and methods more easily accessible directly from the interpreter.

groovy version of SetEquate script

Ghidra comes with a number of scripts included which serve as both examples of the sorts of things that can be done with scripts as well as perform some useful tasks. Ruby Dragon includes examples itself to show how things written in Java/Python can be done in the languages that it adds to Ghidra. More of these example scripts will provide a greater base of examples for users to refer to when writing a script in their language of choice.

Implement a Groovy version of the SetEquateScript included with Ghidra. This should go in the ghidra_scripts folder, along with the other examples, and be put in the category Examples.Groovy. The existing Groovy scripts will give you some examples of the basics of using Groovy within Ghidra.

Of course, please ask any questions you have here if you get stuck!

Excessive jshell imports

Importing all the class names when you are creating the jshell instance (~2600 classes) causes some severe lag when executing even simple REPL statements (eg. "int i = 0;")

The REPL isn't even responsive for almost a minute after starting up because its processing the evals for currentAddress, etc, which each take several seconds. The async nature of the console make it confusing because your input is accepted, but nothing happens.

Maybe just import a few hand-picked packages?

ruby version of SetEquate script

Ghidra comes with a number of scripts included which serve as both examples of the sorts of things that can be done with scripts as well as perform some useful tasks. Ruby Dragon includes examples itself to show how things written in Java/Python can be done in the languages that it adds to Ghidra. More of these example scripts will provide a greater base of examples for users to refer to when writing a script in their language of choice.

Implement a Ruby version of the SetEquateScript included with Ghidra. This should go in the ghidra_scripts folder, along with the other examples, and be put in the category Examples.Ruby. The existing Ruby scripts will give you some examples of the basics of JRuby and using it within Ghidra.

Of course, please ask any questions you have here if you get stuck!

clojure version of SetEquate script

Ghidra comes with a number of scripts included which serve as both examples of the sorts of things that can be done with scripts as well as perform some useful tasks. Ruby Dragon includes examples itself to show how things written in Java/Python can be done in the languages that it adds to Ghidra. More of these example scripts will provide a greater base of examples for users to refer to when writing a script in their language of choice.

Implement a Clojure version of the SetEquateScript included with Ghidra. This should go in the ghidra_scripts folder, along with the other examples, and be put in the category Examples.Clojure. The existing Clojure scripts will give you some examples of how to use Clojure within Ghidra.

Of course, please ask any questions you have here if you get stuck!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.