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

# Class LoadCommandFactory

java.lang.Object
ghidra.app.util.bin.format.macho.commands.LoadCommandFactory

public class LoadCommandFactory extends Object
A factory used to create `LoadCommand`s

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LoadCommandFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static LoadCommand`
  `getLoadCommand(BinaryReader reader, MachHeader header, DyldCacheUtils.SplitDyldCache splitDyldCache)`
  Create and parses a `LoadCommand`

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

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

- ## Constructor Details

  - ### LoadCommandFactory

    public LoadCommandFactory()

- ## Method Details

  - ### getLoadCommand

    public static LoadCommand getLoadCommand(BinaryReader reader, MachHeader header, DyldCacheUtils.SplitDyldCache splitDyldCache) throws IOException, MachException
    Create and parses a `LoadCommand`

    NOTE: Parsing `LoadCommand`s whose data lives in the __LINKEDIT segment require that the __LINKEDIT `SegmentCommand` have already been parsed. Thus, it is required that this method be called on `SegmentCommand`s before other types of `LoadCommand`s.

    Parameters:
      `reader` - A `reader` that points to the start of the load command
      `header` - The `header` associated with this load command
      `splitDyldCache` - The `DyldCacheUtils.SplitDyldCache` that this header resides in. Could be null if a split DYLD cache is not being used.
    Returns:
      A new `LoadCommand`
    Throws:
      `IOException` - if an IO-related error occurs while parsing
      `MachException` - if the load command is invalid