File: MachO.rst

package info (click to toggle)
python-macholib 1.16.2%2Bds0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 520 kB
  • sloc: python: 4,279; makefile: 126; sh: 10
file content (35 lines) | stat: -rw-r--r-- 1,231 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
:mod:`macholib.MachO` --- Utilities for reading and writing Mach-O headers
==========================================================================

.. module:: macholib.MachO
   :synopsis: Utilities for reading and writing Mach-O headers

This module defines a class :class:`Macho`, which enables reading
and writing the Mach-O header of an executable file or dynamic
library on MacOS X.

.. function:: lc_str_value(offset, cmd_info)

   Returns the bytes for an ``lc_str`` value, given the *offset*
   of type ``lc_str`` and the ``cmd_info`` that contains the
   structure that contains the ``lc_str`` value. ``cmd_info`` is
   and item in the ``commands`` attribute of a MachOHeader instance.


.. class:: MachO(filename, allow_unknown_load_commands=False)

   Creates a MachO object by reading the Mach-O headers from
   *filename*.

   The *filename* should refer to an existing file in Mach-O
   format, and can refer to fat (universal) binaries.

   When *allow_unknown_load_commands* is false the instance will
   raise an error when the specified file contains unknown
   load commands.

   .. versionchanged: 1.16

      Added the *allow_unknown_load_commands* argument.

.. note:: more information will be added later