ruby-macho editorconfig rubocop travis-ci ruby Rubygems

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

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.

Related Repositories

ruby-macho

ruby-macho

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

macho

macho

A small Ruby library for parsing Mach-O binaries ...


Top Contributors

woodruffw UniqMartin

Releases

-   0.2.5 zip tar
-   0.2.4 zip tar
-   0.2.3 zip tar
-   0.2.2 zip tar
-   0.2.1 zip tar
-   0.2.0 zip tar
-   0.1.9 zip tar
-   0.1.8 zip tar
-   0.1.7 zip tar
-   0.1.6 zip tar
-   0.1.5 zip tar
-   0.1.4 zip tar
-   0.1.3 zip tar
-   0.1.2 zip tar
-   0.1.1 zip tar
-   0.1.0 zip tar
-   0.0.9 zip tar
-   0.0.8 zip tar
-   0.0.7 zip tar
-   0.0.6 zip tar
-   0.0.5 zip tar
-   0.0.4 zip tar
-   0.0.3 zip tar
-   0.0.2 zip tar
-   0.0.1 zip tar