Class SegmentRelocation

java.lang.Object
ghidra.app.util.bin.format.ne.SegmentRelocation

public class SegmentRelocation extends Object
A class to represent a new-executable segment relocation.
  • Field Details

    • VALUES_SIZE

      public static final int VALUES_SIZE
      See Also:
    • MOVEABLE

      public static final short MOVEABLE
      Moveable relocation.
      See Also:
    • TYPE_MASK

      public static final byte TYPE_MASK
      A mask indicating that the low-order nibble is the type.
      See Also:
    • TYPE_LO_BYTE

      public static final byte TYPE_LO_BYTE
      low byte at the specified address.
      See Also:
    • TYPE_SEGMENT

      public static final byte TYPE_SEGMENT
      16-bit selector.
      See Also:
    • TYPE_FAR_ADDR

      public static final byte TYPE_FAR_ADDR
      32-bit pointer.
      See Also:
    • TYPE_OFFSET

      public static final byte TYPE_OFFSET
      16-bit pointer.
      See Also:
    • TYPE_FAR_ADDR_48

      public static final byte TYPE_FAR_ADDR_48
      48-bit pointer.
      See Also:
    • TYPE_OFFSET_32

      public static final byte TYPE_OFFSET_32
      32-bit offset.
      See Also:
    • TYPE_STRINGS

      public static final String[] TYPE_STRINGS
      The names of the available relocations.
    • TYPE_LENGTHS

      public static final int[] TYPE_LENGTHS
      The number of bytes required to perform relocation
    • FLAG_TARGET_MASK

      public static final byte FLAG_TARGET_MASK
      A mask indicating that the low-order two-bits is the type.
      See Also:
    • FLAG_INTERNAL_REF

      public static final byte FLAG_INTERNAL_REF
      Internal reference relocation.
      See Also:
    • FLAG_IMPORT_ORDINAL

      public static final byte FLAG_IMPORT_ORDINAL
      Import ordinal relocation.
      See Also:
    • FLAG_IMPORT_NAME

      public static final byte FLAG_IMPORT_NAME
      Import name relocation.
      See Also:
    • FLAG_OS_FIXUP

      public static final byte FLAG_OS_FIXUP
      Operating system fixup relocation.
      See Also:
    • FLAG_ADDITIVE

      public static final byte FLAG_ADDITIVE
      Additive relocaiton.
      See Also:
  • Method Details

    • isInternalRef

      public boolean isInternalRef()
      Returns true if this relocation is an internal reference.
      Returns:
      true if this relocation is an internal reference
    • isImportOrdinal

      public boolean isImportOrdinal()
      Returns true if this relocation is an import by ordinal.
      Returns:
      true if this relocation is an import by ordinal
    • isImportName

      public boolean isImportName()
      Returns true if this relocation is an import by name.
      Returns:
      true if this relocation is an import by name
    • isOpSysFixup

      public boolean isOpSysFixup()
      Returns true if this relocation is an operating system fixup.
      Returns:
      true if this relocation is an operating system fixup
    • isAdditive

      public boolean isAdditive()
      Returns true if this relocation is additive. If this bit is set, then add relocation to existing value. Otherwise overwrite the existing value.
      Returns:
      true if this relocation is additive.
    • getType

      public byte getType()
      Returns the relocation type.
      Returns:
      the relocation type
    • getFlagByte

      public byte getFlagByte()
      Returns the relocation flags.
      Returns:
      the relocation flags
    • getOffset

      public short getOffset()
      Returns the relocation offset.
      Returns:
      the relocation offset
    • getTargetSegment

      public short getTargetSegment()
      Returns the relocation target segment.
      Returns:
      the relocation target segment
    • getTargetOffset

      public short getTargetOffset()
      Returns the relocation target offset.
      Returns:
      the relocation target offset
    • getValues

      public long[] getValues()
      Returns values required to reconstruct this object.
      Returns:
      values required to reconstruct this object