Class ELFRelocationContext

java.lang.Object
com.pnfsoftware.jeb.core.units.codeobject.ELFRelocationContext

public abstract class ELFRelocationContext extends Object
ELF relocation contexts can be registered using the ELFPluginsService.

A relocation context means a type of ELF (e.g. executable, or dynamic file) and an architecture (e.g. Arm). A context consists of one or more relocation applicators.

  • Constructor Details

    • ELFRelocationContext

      public ELFRelocationContext(ELFRelocationApplicator<?>... relocApplicators)
      Create a relocation context.
      Parameters:
      relocApplicators - relocation applicators supported by this context
  • Method Details

    • getApplicableRelocations

      public List<ELFRelocationApplicator<?>> getApplicableRelocations()
      Get the relocation applicators supported by this context.
      Returns:
      relocation applicators
    • canApply

      public abstract boolean canApply(IELFUnit elfUnit, long actualImageBase)
      Determine whether this context applies to the given file.
      Parameters:
      elfUnit - ELF unit
      actualImageBase - actual image base
      Returns:
      true if this context can process the file
    • isMappedAtPreferredAddress

      protected boolean isMappedAtPreferredAddress(IELFUnit elfUnit, long actualImageBase)
      Determine whether the file is mapped at its preferred image base.
      Parameters:
      elfUnit - ELF unit
      actualImageBase - actual image base
      Returns:
      true if the actual image base is the preferred image base