Giter Site home page Giter Site logo

liufeigit / ruby-macho Goto Github PK

View Code? Open in Web Editor NEW

This project forked from homebrew/ruby-macho

0.0 2.0 0.0 644 KB

:nut_and_bolt: A pure-Ruby library for parsing Mach-O files.

Home Page: https://rubygems.org/gems/ruby-macho

License: MIT License

Ruby 96.37% Shell 1.19% Makefile 2.32% C 0.11%

ruby-macho's Introduction

ruby-macho

Gem Version Build Status

A Ruby library for examining and modifying Mach-O files.

What is a Mach-O file?

The Mach-O file format is used by OS X and iOS (among others) as a general purpose binary format for object files, executables, dynamic libraries, and so forth.

Documentation

Important: ruby-macho does not have a stable API (yet). Use it with this in mind.

Full documentation is available on RubyDoc.

A quick example of what ruby-macho can do:

require 'macho'

file = MachO::MachOFile.new("/path/to/my/binary")

# get the file's type (object, dynamic lib, executable, etc)
file.filetype # => :execute

# get all load commands in the file and print their offsets:
file.load_commands.each do |lc|
  puts "#{lc.type}: offset #{lc.offset}, size: #{lc.cmdsize}"
end

# access a specific load command
lc_vers = file[:LC_VERSION_MIN_MACOSX].first
puts lc_vers.version_string # => "10.10.0"

What works?

  • Reading data from x86/x86_64/PPC Mach-O files
  • Changing the IDs of Mach-O and Fat dylibs
  • Changing install names in Mach-O and Fat files
  • Adding, deleting, and modifying rpaths.

What needs to be done?

  • Documentation.
  • Unit and performance testing.

Attribution:

License

ruby-macho is licensed under the MIT License.

For the exact terms, see the license file.

ruby-macho's People

Contributors

uniqmartin avatar woodruffw avatar

Watchers

 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.