Class DyldChainedFixups

java.lang.Object
ghidra.app.util.bin.format.macho.commands.chained.DyldChainedFixups

public class DyldChainedFixups extends Object
  • Field Details

  • Constructor Details

    • DyldChainedFixups

      public DyldChainedFixups()
  • Method Details

    • getChainedFixups

      public static List<DyldFixup> getChainedFixups(BinaryReader reader, DyldChainedImports chainedImports, DyldChainedPtr.DyldChainType pointerFormat, long page, long nextOff, long auth_value_add, long imagebase, SymbolTable symbolTable, MessageLog log, TaskMonitor monitor) throws IOException, CancelledException
      Walks the chained fixup information and collects a List of DyldFixups that will need to be applied to the image
      Parameters:
      reader - A BinaryReader that can read the image
      chainedImports - chained imports (could be null)
      pointerFormat - format of pointers within this chain
      page - within data pages that has pointers to be unchained
      nextOff - offset within the page that is the chain start
      auth_value_add - value to be added to each chain pointer
      imagebase - The image base
      symbolTable - The SymbolTable, or null if not available
      log - The log
      monitor - A cancellable monitor
      Returns:
      A List of DyldFixups
      Throws:
      IOException - If there was an IO-related issue
      CancelledException - If the user cancelled the operation
    • fixupChainedPointers

      public static List<Address> fixupChainedPointers(List<DyldFixup> fixups, Program program, Address imagebase, List<String> libraryPaths, MessageLog log, TaskMonitor monitor) throws CancelledException
      Fixes up the program's chained pointers
      Parameters:
      fixups - A List of the fixups
      program - The Program
      imagebase - The image base
      libraryPaths - A List of library paths
      log - The log
      monitor - A cancellable monitor
      Returns:
      A List of fixed up Address's
      Throws:
      CancelledException - If the user cancelled the operation
    • processPointerChain

      public static List<DyldFixup> processPointerChain(BinaryReader reader, long chainStart, long nextOffSize, long imagebase, MessageLog log, TaskMonitor monitor) throws IOException, CancelledException
      Fixes up any chained pointers, starting at the given address.
      Parameters:
      reader - A BinaryReader that can read the image
      chainStart - The starting of address of the pointer chain to fix.
      nextOffSize - The size of the next offset.
      imagebase - The image base
      log - The log
      monitor - A cancellable monitor
      Returns:
      A list of addresses where pointer fixes were performed.
      Throws:
      IOException - If there was an IO-related issue
      CancelledException - If the user cancelled the operation