Package ghidra.app.util.bin.format.ne

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final byte`
  `FLAG_ADDITIVE`
  Additive relocaiton.
  `static final byte`
  `FLAG_IMPORT_NAME`
  Import name relocation.
  `static final byte`
  `FLAG_IMPORT_ORDINAL`
  Import ordinal relocation.
  `static final byte`
  `FLAG_INTERNAL_REF`
  Internal reference relocation.
  `static final byte`
  `FLAG_OS_FIXUP`
  Operating system fixup relocation.
  `static final byte`
  `FLAG_TARGET_MASK`
  A mask indicating that the low-order two-bits is the type.
  `static final short`
  `MOVEABLE`
  Moveable relocation.
  `static final byte`
  `TYPE_FAR_ADDR`
  32-bit pointer.
  `static final byte`
  `TYPE_FAR_ADDR_48`
  48-bit pointer.
  `static final int[]`
  `TYPE_LENGTHS`
  The number of bytes required to perform relocation
  `static final byte`
  `TYPE_LO_BYTE`
  low byte at the specified address.
  `static final byte`
  `TYPE_MASK`
  A mask indicating that the low-order nibble is the type.
  `static final byte`
  `TYPE_OFFSET`
  16-bit pointer.
  `static final byte`
  `TYPE_OFFSET_32`
  32-bit offset.
  `static final byte`
  `TYPE_SEGMENT`
  16-bit selector.
  `static final String[]`
  `TYPE_STRINGS`
  The names of the available relocations.
  `static final int`
  `VALUES_SIZE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte`
  `getFlagByte()`
  Returns the relocation flags.
  `short`
  `getOffset()`
  Returns the relocation offset.
  `short`
  `getTargetOffset()`
  Returns the relocation target offset.
  `short`
  `getTargetSegment()`
  Returns the relocation target segment.
  `byte`
  `getType()`
  Returns the relocation type.
  `long[]`
  `getValues()`
  Returns values required to reconstruct this object.
  `boolean`
  `isAdditive()`
  Returns true if this relocation is additive.
  `boolean`
  `isImportName()`
  Returns true if this relocation is an import by name.
  `boolean`
  `isImportOrdinal()`
  Returns true if this relocation is an import by ordinal.
  `boolean`
  `isInternalRef()`
  Returns true if this relocation is an internal reference.
  `boolean`
  `isOpSysFixup()`
  Returns true if this relocation is an operating system fixup.

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

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

- ## Field Details

  - ### VALUES_SIZE

    public static final int VALUES_SIZE
    See Also:
      - Constant Field Values

  - ### MOVEABLE

    public static final short MOVEABLE
    Moveable relocation.
    See Also:
      - Constant Field Values

  - ### TYPE_MASK

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

  - ### TYPE_LO_BYTE

    public static final byte TYPE_LO_BYTE
    low byte at the specified address.
    See Also:
      - Constant Field Values

  - ### TYPE_SEGMENT

    public static final byte TYPE_SEGMENT
    16-bit selector.
    See Also:
      - Constant Field Values

  - ### TYPE_FAR_ADDR

    public static final byte TYPE_FAR_ADDR
    32-bit pointer.
    See Also:
      - Constant Field Values

  - ### TYPE_OFFSET

    public static final byte TYPE_OFFSET
    16-bit pointer.
    See Also:
      - Constant Field Values

  - ### TYPE_FAR_ADDR_48

    public static final byte TYPE_FAR_ADDR_48
    48-bit pointer.
    See Also:
      - Constant Field Values

  - ### TYPE_OFFSET_32

    public static final byte TYPE_OFFSET_32
    32-bit offset.
    See Also:
      - Constant Field Values

  - ### 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:
      - Constant Field Values

  - ### FLAG_INTERNAL_REF

    public static final byte FLAG_INTERNAL_REF
    Internal reference relocation.
    See Also:
      - Constant Field Values

  - ### FLAG_IMPORT_ORDINAL

    public static final byte FLAG_IMPORT_ORDINAL
    Import ordinal relocation.
    See Also:
      - Constant Field Values

  - ### FLAG_IMPORT_NAME

    public static final byte FLAG_IMPORT_NAME
    Import name relocation.
    See Also:
      - Constant Field Values

  - ### FLAG_OS_FIXUP

    public static final byte FLAG_OS_FIXUP
    Operating system fixup relocation.
    See Also:
      - Constant Field Values

  - ### FLAG_ADDITIVE

    public static final byte FLAG_ADDITIVE
    Additive relocaiton.
    See Also:
      - Constant Field Values

- ## 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