Package ghidra.app.util.bin.format.macho.dyld

# Class LibObjcOptimization

java.lang.Object
ghidra.app.util.bin.format.macho.dyld.LibObjcOptimization

All Implemented Interfaces:
  `StructConverter`

public class LibObjcOptimization extends Object implements StructConverter
Represents a objc_opt_t structure, which resides in the libobjc DYLIB within a DYLD cache

See Also:
  - dyld/include/objc-shared-cache.h

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `SECTION_NAME`
  The name of the section that contains the objc_opt_t_structure

  ### Fields inherited from interface ghidra.app.util.bin.StructConverter

  `ASCII, BYTE, DWORD, IBO32, IBO64, POINTER, QWORD, SLEB128, STRING, ULEB128, UTF16, UTF8, VOID, WORD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LibObjcOptimization(Program program, Address objcOptRoSectionAddr)`
  Create a new `LibObjcOptimization`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getAddr()`
  Gets the address of the objc_opt_t structure
  `long`
  `getRelativeSelectorBaseAddressOffset()`
  Gets the relative method selector base address offset.
  `void`
  `markup(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor)`
  Marks up this structure in memory
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### SECTION_NAME

    public static final String SECTION_NAME
    The name of the section that contains the objc_opt_t_structure
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### LibObjcOptimization

    public LibObjcOptimization(Program program, Address objcOptRoSectionAddr) throws IOException
    Create a new `LibObjcOptimization`.
    Parameters:
      `program` - The `Program`
      `objcOptRoSectionAddr` - The start address of the __objc_opt_ro section
    Throws:
      `IOException` - if there was an IO-related problem parsing the structure

- ## Method Details

  - ### getAddr

    public long getAddr()
    Gets the address of the objc_opt_t structure
    Returns:
      The address of the objc_opt_t structure

  - ### getRelativeSelectorBaseAddressOffset

    public long getRelativeSelectorBaseAddressOffset()
    Gets the relative method selector base address offset. This will be 0 if the version is less than 16.
    Returns:
      The relative method selector base address offset

  - ### markup

    public void markup(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor)
    Marks up this structure in memory
    Parameters:
      `program` - The `Program`
      `space` - The `AddressSpace`
      `log` - The log
      `monitor` - A cancelable task monitor

  - ### toDataType

    public DataType toDataType() throws DuplicateNameException, IOException
    Description copied from interface: `StructConverter`
    Returns a structure datatype representing the contents of the implementor of this interface.

    For example, given:

         class A {
             int foo;
             double bar;
         }

    The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

    Specified by:
      `toDataType` in interface `StructConverter`
    Returns:
      returns a structure datatype representing the implementor of this interface
    Throws:
      `DuplicateNameException` - when a datatype of the same name already exists
      `IOException` - if an IO-related error occurs
    See Also:
      - `StructureDataType`