GithubHelp home page GithubHelp logo

richo / unrubby Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 3.0 9.8 MB

License: Other

Makefile 0.36% Ruby 58.77% Prolog 0.01% C 29.88% Batchfile 0.06% Perl 0.01% Python 0.01% Scheme 0.01% Perl 6 0.01% Groff 9.04% R 0.08% C++ 0.01% HTML 1.13% Shell 0.01% Ragel in Ruby Host 0.09% Tcl 0.17% Assembly 0.01% JavaScript 0.02% CSS 0.05% Emacs Lisp 0.33%

unrubby's Introduction

unrubby

Unrubby is a hacked up rubby interpreter. In addition to parsing and evaluating rubby code, it will dump a decompiled copy of any bytecode evaluated to stdout upon exiting.

Building

You'll want to configure with something akin to:

./configure --prefix=$(pwd) --disable-install-doc

There's a Makefile in the toplevel of unrubby that will likely do something plausible looking for you, if you prefer.

Usage

In short, just invoke bin/unrubby instead of ruby. You almost certainly want to

export UNRUBBY_METHODS=1

Which will invoke the method disasembler, which is definitely what you want unless you just want a classmap.

Experimental support for disasembling entire ISeq's is hidden behind UNRUBBY_FULL_ISEQ.

When invoked as unrubby, unrubby will attempt to automatically load its paired copy of reversal, but if you have moved things around, simply passing

unrubby -r path/to/bundled/reversal/lib/reversal.rb

Should give you the disasembler you need.

If you want to suppress the automatic load (Because, eg, you want to require dependencies for the application without dissembling them and making your dump horrendously huge):

export UNRUBBY_DEFER_REVERSAL=1

Sockets

If you really don't want whatever it is you're poking to talk to the network;

export UNRUBBY_SOCKET_HACK=1

This won't protect you from shared objects knowing how to socket(3), raw syscalls, etc. It's also a pretty blunt hammer, but defining a Socket with some method_missing glue won't be too hard.

Stubs

There's a stub that will bring up most of a rails app in etc. Additionally, if you

export UNRUBBY_STUBS=1

It will duck punch Object right in the face and make most any attempts to poke at other classes succeed. Note that this will break attempts to include or extend modules, you will need to define them yourself.

Reporting Bugs

unrubby isn't perfect, and probably has a lot of lowhanging fruit right now. If you run into crashes (InternalDecompilerErrors), there's a reporting mode that'll cough up enough information for me to probably fix it. It's documented in more detail in reporting bugs

unrubby's People

Contributors

richo avatar

Stargazers

Dan Guido avatar Jai Grimshaw avatar Glenn 'devalias' Grant avatar  avatar  avatar Topher Timzen avatar Joel Ferrier avatar Frenchie avatar Mathew Payne avatar  avatar Andrew Shumate avatar Garrett Barboza avatar Matt H avatar Bob Blanchett avatar

Watchers

James Cloos avatar Joel Ferrier avatar  avatar

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.