Skip to main content

UNKNOWN

Project description

Machotools is a small set of tools built on top of macholib to retrieve and change informations about mach-o files

Examples:

# Print the list of rpath defined in the given .dylib
python -m machotools list_rpaths foo.dylib

# Print the id (i.e. install_name) of the given .dylib
python -m machotools install_name foo.dylib

# Print the list of libraries linked in the given mach-o (simple otool
# -L)
python -m machotools list_libraries a.out

Internally, machotools is written as a library so that it can be used within bigger tools, but the API is currently in-flux until the first 1.0 release.

Example:

from machotools import rewriter_factory

rewriter = rewriter_factory("foo.dylib")
print rewriter.dependencies
# install_name property only available if rewriter is a DylibRewriter
print rewriter.install_name
print rewriter.rpaths

rewriter.install_name = "bar.dylib"
# Changes are not actually written until you call commit()
rewriter.commit()

Main features:

  • ability to query/change rpath

  • ability to query/change the install name

  • ability to query/change the dependencies

  • modifications are safe against crash/interruption as files are never modified in place. Instead, modifications are made against a temporary copy, and replace the original file using atomic rename on Posix (emulated on windows).

Development happens on github

TODO:

  • support for multi arch

  • more detailed output for list_libraries (including versioning info)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

machotools-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

File details

Details for the file machotools-0.1.0.tar.gz.

File metadata

  • Download URL: machotools-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for machotools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20e90b1288a6709ae023ca31ec74de1dd5f64d75caceaa5975e2d6bf5c0524ef
MD5 43a35ed1cb8d7bec4506f1c0391ab807
BLAKE2b-256 a4f1b968a44475f5410d7cbdfe8d6e3260c27864e664a236b6614def822f3441

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page