Class Segment

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

public class Segment extends Object
A class to represent a new-executable segment.
  • Method Details

    • getSegmentID

      public int getSegmentID()
      Returns segment ID.
      Returns:
      segment ID
    • is32bit

      public boolean is32bit()
      Returns true if the segment should operate in 32 bit mode.
      Returns:
      true if the segment should operate in 32 bit mode
    • isCode

      public boolean isCode()
      Returns true if this is a code segment.
      Returns:
      true if this is a code segment
    • isData

      public boolean isData()
      Returns true if this is a data segment.
      Returns:
      true if this is a data segment
    • hasRelocation

      public boolean hasRelocation()
      Returns true if this segment has relocations.
      Returns:
      true if this segment has relocations
    • isLoaderAllocated

      public boolean isLoaderAllocated()
      Returns true if this segment is loader allocated.
      Returns:
      true if this segment is loader allocated
    • isLoaded

      public boolean isLoaded()
      Returns true if this segment is loaded.
      Returns:
      true if this segment is loaded
    • isMoveable

      public boolean isMoveable()
      Returns true if this segment is moveable.
      Returns:
      true if this segment is moveable
    • isPreload

      public boolean isPreload()
      Returns true if this segment is preloaded.
      Returns:
      true if this segment is preloaded
    • isPure

      public boolean isPure()
      Returns true if this segment is pure.
      Returns:
      true if this segment is pure
    • isReadOnly

      public boolean isReadOnly()
      Returns true if this segment is read-only.
      Returns:
      true if this segment is read-only
    • isExecuteOnly

      public boolean isExecuteOnly()
      Returns true if this segment is execute-only.
      Returns:
      true if this segment is execute-only
    • isDiscardable

      public boolean isDiscardable()
      Returns true if this segment is discardable.
      Returns:
      true if this segment is discardable
    • getFlagword

      public short getFlagword()
      Returns the flag word of this segment.
      Returns:
      the flag word of this segment
    • getLength

      public short getLength()
      Returns the length of this segment.
      Returns:
      the length of this segment
    • getMinAllocSize

      public short getMinAllocSize()
      Returns the minimum allocation size of this segment.
      Returns:
      the minimum allocation size of this segment
    • getOffset

      public short getOffset()
      Returns the offset to the contents of this segment. NOTE: This value needs to be shift aligned.
      Returns:
      the offset to the contents of this segment
    • getOffsetShiftAligned

      public int getOffsetShiftAligned()
      Returns the actual (shifted) offset to the contents.
      Returns:
      the actual (shifted) offset to the contents
    • getRelocations

      public SegmentRelocation[] getRelocations()
      Returns an array of the relocations defined for this segment.
      Returns:
      an array of the relocations defined for this segment