This project is a fork of the Homebrew.git project. If you have that one already cloned locally, you can use
git clone --reference /path/to/your/Homebrew.git/incarnation mirror_URL
to save bandwidth during cloning.
 
descriptionA pure-Ruby library for parsing Mach-O files.
homepage URLhttps://rubygems.org/gems/ruby-macho
repository URLhttps://github.com/Homebrew/ruby-macho.git
ownerroot@yurikoles.com
last changeThu, 25 Apr 2024 18:26:53 +0000 (25 18:26 +0000)
last refreshThu, 9 May 2024 19:15:17 +0000 (9 21:15 +0200)
content tags
add:
README.md

ruby-macho

Gem Version CI Coverage 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 macOS and iOS (among others) as a general purpose binary format for object files, executables, dynamic libraries, and so forth.

Installation

ruby-macho can be installed via RubyGems:

$ gem install ruby-macho

Documentation

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?

What needs to be done?

Contributing, setting up overcommit and the linters

In order to keep the repo, docs and data tidy, we use a tool called overcommit to connect up the git hooks to a set of quality checks. The fastest way to get setup is to run the following to make sure you have all the tools:

gem install overcommit bundler
bundle install
overcommit --install

Attribution

License

ruby-macho is licensed under the MIT License.

For the exact terms, see the license file.

shortlog
2024-04-25 William Woodruffworkflows: pin setup-ruby action (#598)master
2024-04-25 William Woodrufftests: set CODECOV_TOKEN (#597)
2024-04-04 Mike McQuaidMerge pull request #595 from Homebrew/sync-triage-config
2024-04-03 MikeMcQuaid[create-pull-request] automated change
2024-04-03 BrewTestBotstale-issues.yml: update to match main configuration
2024-04-03 BrewTestBotlock-threads.yml: update to match main configuration
2024-02-26 Mike McQuaidMerge pull request #594 from Homebrew/dependabot/bundle...
2024-02-26 dependabot... build(deps-dev): bump overcommit from 0.62.0 to 0.63.0
2024-02-16 William Woodruffmacho: 4.0.1 (#593)v4.0.1
2024-02-08 Mike McQuaidMerge pull request #592 from Homebrew/dependabot/bundle...
2024-02-08 dependabot... build(deps-dev): bump minitest from 5.21.2 to 5.22.2
2024-01-22 Mike McQuaidMerge pull request #589 from Homebrew/dependabot/bundle...
2024-01-22 dependabot... build(deps-dev): bump parser from 3.3.0.4 to 3.3.0.5
2024-01-18 Mike McQuaidMerge pull request #588 from Homebrew/dependabot/bundle...
2024-01-18 dependabot... build(deps-dev): bump minitest from 5.21.1 to 5.21.2
2024-01-17 Mike McQuaidMerge pull request #587 from Homebrew/dependabot/bundle...
...
tags
2 months ago v4.0.1
9 months ago v4.0.0
2 years ago v3.0.0
2 years ago v2.5.1
3 years ago v2.5.0
3 years ago v2.4.0
3 years ago 2.3.0
5 years ago 1.4.0
5 years ago 2.2.0
5 years ago 1.3.1
5 years ago 1.3.0
5 years ago 2.1.0
5 years ago 2.0.0
5 years ago 1.3.0.pre.1
5 years ago 1.2.0
7 years ago 1.1.0
...
heads
3 days ago dependabot/github_actions/ruby/setup-ruby-1.176.0
2 weeks ago master
14 months ago ww/code-signing
5 years ago 2.0-compat
5 years ago older-rubies