Interface CoffRelocationHandler

All Superinterfaces:
ExtensionPoint

public interface CoffRelocationHandler extends ExtensionPoint
An abstract class used to perform COFF relocations. Classes should extend this class to provide relocations in a machine/processor specific way.
  • Method Details

    • canRelocate

      boolean canRelocate(CoffFileHeader fileHeader)
      Checks to see whether or not an instance of this COFF relocation hander can handle relocating the COFF defined by the provided file header.
      Parameters:
      fileHeader - The file header associated with the COFF to relocate.
      Returns:
      True if this relocation handler can do the relocation; otherwise, false.
    • relocate

      RelocationResult relocate(Address address, CoffRelocation relocation, CoffRelocationContext relocationContext) throws MemoryAccessException, RelocationException
      Performs a relocation at the specified address.
      Parameters:
      address - The address at which to perform the relocation.
      relocation - The relocation information to use to perform the relocation.
      relocationContext - relocation context data
      Returns:
      applied relocation result (conveys status and applied byte-length)
      Throws:
      MemoryAccessException - If there is a problem accessing memory during the relocation.
      RelocationException - if supported relocation encountered an error during processing. This exception should be thrown in place of returning RelocationResult.FAILURE or a status of Relocation.Status.FAILURE which will facilitate a failure reason via Throwable.getMessage().