Package: macholib
macholib can be used to analyze and edit Mach-O headers, the executable
format used by Mac OS X.It’s typically used as a dependency analysis tool, and also to rewrite dylib
references in Mach-O headers to be @executable_path relative.Though this tool targets a platform specific file format, it is pure python
code that is platform and endian independent.CI StatusProject linksDocumentationIssue TrackerRepositoryRelease historymacholib 1.16.2Update classifiers for Python 3.11macholib 1.16.1Added some new CPU subtype definitionsmacholib 1.16Addallow_unknown_load_commandsoption toMachOand`macholib.MachOHeader.PR by github user bhamiltoncx.macholib 1.15.2Explicitly mention Python 3.10 in the project metadatamacholib 1.15.1Remove a debug print introduced in the previous release.macholib 1.15Add support for new features in the macOS 11 SDKFix link to repository in README.rstFixmacholib.dyld.dyld_findfor system libraries on macOS 11 or latermacholib 1.14Repository moved to GitHub#32: Update the LC_NAMES tablemacholib 1.13# 31: Add two new load commands introduced in macOS 10.15macholib 1.12#27: Missing describe method for build_version_commandmacholib 1.11Add very hacky limited support for @loader_path. This is just
enough to deal with extensions and dylibs found in Python
binary wheels.macholib 1.10#25: Add support for LC_NOTE and LC_BUILD_VERSIONmacholib 1.9Features:Add definition formacholib.mach_o.reloc_type_generic, which
was used in code but never defined.#22: Add LICENSE file#23: Added “–help” option for “python -m macholib”Added functionmacholib.MachO.lc_str_valuewhich should
help in decoding value ofmacholib.mach_o.lc_str. Those
values are offsets in the data of a load command, the function
will return the actually value as a byte string.See also issue #21.Bug fixes:Pull request #15: Fix typo in thread_command classPatch by user “phdphuc” on bitbucket.macholib 1.8Use the same dependency walk logic as otoolPatch by Taras Tsugrii <ttsugrii@fb.com>Added support for new load commandsPatch by David Dorsey <trogdorsey@gmail.com>,
with enhancements by Ronald Oussoren.Fix procesing DSYM file from XCODE 6.xPatch by HolmsBlazhey <andrey.blazhey@gmail.com>MachOGraph.locate(): When calling dyld_find(), use kwarg ‘loader_path’, not ‘loader’.Patch by Stuart Berg <bergs@janelia.hhmi.org>Add fields to thread_commandPatch by Asger Hautop Drewsen <asgerdrewsen@gmail.com>Add missing ARM_V7S subtype.Patch by “NN”Fix for SymbolTablePatch by Christian Klein <chris@5711.org>Use first Mach-O header as the default headerPatch by Christian Klein <chris@5711.org>Issue #17: add LC_LOAD_UPWARD_DYLIB to _RELOCATABLE setIssue #16: macholib “hangs” on invalid inputDue to the use of the range function on untrusted input
the python process could hang when reading invalid input, due
to trying to construct an enormous list.Issue #18: Bad version parsing in macho_version_helperThe order of subfields inmach_version_helperwas reversed from
reality.Issue #19: Fix aligment issue that prevented code signingPatch by Brendan SimonFix issue #14: Can’t pass endian argument to p_uint64.from_strmacholib 1.7Added support for ARM64, LC_ENCRYPTION_INFO_64 and LC_LINKER_OPTIONPatch by Matthias Ringwald.Load commands now have a “describe” method that returns more information
about the command.Patch by David Dorsey.The MAGIC value in the header was always represented in the native
byte order, instead of as the value read from the binary.Patch by David Dorsey.Added various new constants to “macholib.mach_o”.Patch by David Dorsey.macholib 1.6.1?macholib 1.6Add support for‘@loader_path’ link command in
macholib.dyld:Added functionmacholib.dyld.dyld_loader_searchThis function is used bymacholib.dyld.dyld_find,
and that function now has an new (optional) argument
with the path to the loader.Also add support for‘@loader_path’ to macholib.MachoGraph,
using the newly added‘@loader_path’ support in the
dyld module.Due to this suppport themacho_standalonetool can
now rewrite binaries that contain an‘@loader_path’ load
command.macholib 1.5.2Issue #93: Show the name of the affected file in the exception message
for Mach-O headers that are too large to relocate.macholib 1.5.1There were no ‘classifiers’ in the package metadata due to
a bug in setup.py.macholib 1.5macholib 1.5 is a minor feature releaseNo longer use 2to3 to provide Python 3 supportAs a side-effect of this macholib no longer supports
Python 2.5 and earlier.Adds suppport for some new macho load commandsFix for py3k problem in macho_standalone.pyPatch by Guanqun Lu.Fix for some issues in macho_dump.pyPatch by Nam NguyenIssue #10: Fix for LC_DATA_IN_CODE linker commands, without
this fix py2app cannot build application bundles when
the source binaries have been compiled with Xcode 4.5.Issue #6: Fix for LC_ENCRYPTION_INFO linker commandsUse the mach header information to print the cpu type of a
binary, instead of trying to deduce that from pointer width
and endianness.Changed the code because of issue #6, in which a user tries to
dump a iOS binary which results in bogus output in the previous
releases.The mappingmacholib.macho_dump.ARCH_MAPis undocumented
and no longer used by macholib itself. It will be removed
in the next release.The command-line toolsmacho_find,macho_dumpandmacho_standaloneare deprecated. Use “python -mmacholib”
instead. That is:$ python -mmacholib dump /usr/bin/grep

$ python -mmacholib find ~

$ python -mmacholib standalone myapp.appThis makes it clearer which version of the tools are used.macholib 1.4.3macholib 1.4.3 is a minor feature releaseAdded strings for ‘x86_64’ and ‘ppc64’ to
macholib.mach_o.CPU_TYPE_NAMES.macho_find and macho_dump were broken in the 1.4.2 releaseadded ‘macholib.util.NOT_SYSTEM_FILES’, a list of
files that aren’t system path’s even though they are
located in system locations.Needed to work around a bug in PySide (see issue #32 in the
py2app tracker)macholib 1.4.2macholib 1.4.2 is a minor bugfix releaseThe support for new load commands that was added in 1.4.1
contained a typo that caused problems on OSX 10.7 (Lion).macholib 1.4.1macholib 1.4.1 is a minor feature releaseFeatures:Add support for a number of new MachO load commands that were added
during the lifetime of OSX 10.6:LC_LOAD_UPWARD_DYLIB,LC_VERSION_MIN_MACOSX,LC_VERSION_MIN_IPHONEOSandLC_FUNCTION_STARTS.macholib 1.4macholib 1.4 is a feature releaseFeatures:Documentation is now generated usingsphinxand can be viewed at <http://packages.python.org/macholib>.The repository has moved to bitbucketThere now is a testsuitePrivate functionality inside modules was renamed to
a name starting with an underscore.Noteif this change affects your code you are relying on undefined
implementation features, please stop using private functions.The basic packable types inmacholib.ptypeswere renamed to better
represent the corresponding C type. The table below lists the old
an new names (the old names are still available, but are deprecated and
will be removed in a future release).Old nameNew namep_bytep_int8p_ubytep_uint8p_shortp_int16p_ushortp_uint16p_intp_int32p_uintp_uint32p_longp_int32p_ulongp_uint32p_longlongp_int64p_ulonglongp_uint64Macholib.ptypes.p_ptris no longer present as it had an unclear
definition and isn’t actually used in the codebase.Bug fixes:The semantics ofdyld.dyld_default_searchwere changed a bit,
it now first searches the framework path (if appropriate) and then
the linker path, irrespective of the value of theDYLD_FALLBACK*environment variables.Previous versions would change the search order when those variables
was set, which is odd and doesn’t correspond with the documented
behaviour of the system dyld.It is once again possible to install using python2.5The source distribution includes all files, this was broken
due to the switch to mercurial (which confused setuptools)macholib 1.3macholib 1.3 is a feature release.Features:Experimental Python 3.x supportThis version contains lightly tested support for Python 3.macholib 1.2.2macholib 1.2.2 is a bugfix release.Bug fixes:Macholib should work better with 64-bit code
(patch by Marc-Antoine Parent)