This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A Python toolbox for Mach-O files analysis. Heavily relies on macholib.

Installation

For usage

$ [sudo] pip install machobot

For development

$ pip install nose macholib
$ git clone https://github.com/rodionovd/machobot.git machobot
$ cd ./machobot
$ nosetests # run the test suite

Usage

  • As a command-line util:

    $ inject_dylib ./target "@rpath/mylib.dylib"
    
  • As a Python module:

    import machobot
    

    Example usage:

    import machobot.dylib as dylib
    
    dylib.insert_load_command("output.a", "@executable_path/../../libk.dylib")
    

Modules

dylib

insert_load_command (target_path, library_install_name)

Inserts a new LC_LOAD_DYLIB load command into the target Mach-O header.

Argument Description
target_path A path to the target Mach-O executable file. This file will be overwritten.
library_install_name An install name for the library to inject. This string is used as a part of the load command.
Return value
Returns True if everything is OK. Otherwise rises an exception.
macho_dependencies_list (target_path, header_magic=None)

Generates a list of libraries the given Mach-O file depends on.

In that list a single library is represented by its “install path”: for some libraries it would be a full file path, and for others it would be a relative path (sometimes with dyld templates like @executable_path or @rpath in it).

Note: I don’t know any reason why would some architectures of a fat Mach-O depend on certain libraries while others don’t, but it’s technically possible. So that’s why you may want to specify the header_magic value for a particular header.

Argument Description
target_path A path to the target Mach-O executable file.
header_magic Mach-O MAGIC value for a header you want to inspect. If this argument is not provided, the function returns a list of the first header’s dependencies.
Return value
An object with two properties: weak and strong that hold lists of weak and strong dependencies respectively.

See machobot/tests/test_dylib.py for usage examples.


Found an issue? Submit an issue! :shipit:

Release History

Release History

0.1.5

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
machobot-0.1.5.tar.gz (6.5 kB) Copy SHA256 Checksum SHA256 Source Aug 18, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting