Package ghidra.app.util.bin.format.ne
Class Segment
- java.lang.Object
-
- ghidra.app.util.bin.format.ne.Segment
-
public class Segment extends java.lang.ObjectA class to represent a new-executable segment.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBytes()Returns the bytes the comprise this segment.shortgetFlagword()Returns the flag word of this segment.shortgetLength()Returns the length of this segment.shortgetMinAllocSize()Returns the minimum allocation size of this segment.shortgetOffset()Returns the offset to the contents of this segment.intgetOffsetShiftAligned()Returns the actual (shifted) offset to the contents.SegmentRelocation[]getRelocations()Returns an array of the relocations defined for this segment.intgetSegmentID()Returns segment ID.booleanhasRelocation()Returns true if this segment has relocations.booleanis32bit()Returns true if the segment should operate in 32 bit mode.booleanisCode()Returns true if this is a code segment.booleanisData()Returns true if this is a data segment.booleanisDiscardable()Returns true if this segment is discardable.booleanisExecuteOnly()Returns true if this segment is execute-only.booleanisLoaded()Returns true if this segment is loaded.booleanisLoaderAllocated()Returns true if this segment is loader allocated.booleanisMoveable()Returns true if this segment is moveable.booleanisPreload()Returns true if this segment is preloaded.booleanisPure()Returns true if this segment is pure.booleanisReadOnly()Returns true if this segment is read-only.
-
-
-
Method Detail
-
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
-
getBytes
public byte[] getBytes() throws java.io.IOExceptionReturns the bytes the comprise this segment. The size of the byte array is MAX(length,minalloc).- Returns:
- the bytes the comprise this segment
- Throws:
java.io.IOException
-
-