Class SegmentInformation
java.lang.Object
com.pnfsoftware.jeb.core.units.codeobject.SegmentInformation
- All Implemented Interfaces:
ISegmentInformation
Standard implementation of the
ISegmentInformation interface for segments and sections.-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation
FLAG_ALLOC_ON_WRITE, FLAG_EXECUTE, FLAG_INVALID, FLAG_READ, FLAG_RW, FLAG_RWX, FLAG_RX, FLAG_SYNTHETIC, FLAG_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionSegmentInformation(SegmentInformation segment) Copy segment information.SegmentInformation(String name, long offsetInFile, long sizeInFile, long offsetInMemory, long sizeInMemory, int flags) Create segment information. -
Method Summary
Modifier and TypeMethodDescriptionlongGet the memory alignment within the segment.intgetFlags()Get the flags for this segment or section.getName()Retrieve the name of the segment or section.longGet the file offset of the segment or section.longGet the in-memory, base-relative address of the beginning of this segment or section.longGet the file size of this segment or section.longGet the in-memory size of this segment or section.voidsetAlignment(long alignment) Set alignment.voidsetFlags(int flags) Set segment flags.voidSet the segment or section name.voidsetOffsetInFile(long offsetInFile) Set the file offset.voidsetOffsetInMemory(long offsetInMemory) Set the memory offset.voidsetSizeInFile(long sizeInFile) Set the file size.voidsetSizeInMemory(long sizeInMemory) Set the memory size.toString()
-
Constructor Details
-
SegmentInformation
public SegmentInformation(String name, long offsetInFile, long sizeInFile, long offsetInMemory, long sizeInMemory, int flags) Create segment information.- Parameters:
name- segment or section nameoffsetInFile- file offsetsizeInFile- file sizeoffsetInMemory- memory offsetsizeInMemory- memory sizeflags- segment flags
-
SegmentInformation
Copy segment information.- Parameters:
segment- source segment
-
-
Method Details
-
getName
Description copied from interface:ISegmentInformationRetrieve the name of the segment or section.- Specified by:
getNamein interfaceISegmentInformation- Returns:
- the name, null if unsupported
-
setName
Set the segment or section name.- Parameters:
name- name
-
getOffsetInFile
public long getOffsetInFile()Description copied from interface:ISegmentInformationGet the file offset of the segment or section.- Specified by:
getOffsetInFilein interfaceISegmentInformation- Returns:
- the file offset in bytes
-
setOffsetInFile
public void setOffsetInFile(long offsetInFile) Set the file offset.- Parameters:
offsetInFile- file offset in bytes
-
getSizeInFile
public long getSizeInFile()Description copied from interface:ISegmentInformationGet the file size of this segment or section.- Specified by:
getSizeInFilein interfaceISegmentInformation- Returns:
- the size in bytes
-
setSizeInFile
public void setSizeInFile(long sizeInFile) Set the file size.- Parameters:
sizeInFile- file size in bytes
-
getOffsetInMemory
public long getOffsetInMemory()Description copied from interface:ISegmentInformationGet the in-memory, base-relative address of the beginning of this segment or section. If a base address is not known or cannot be determined, the offset is 0-relative, and therefore, considered absolute.- Specified by:
getOffsetInMemoryin interfaceISegmentInformation- Returns:
- the base-relative memory address in bytes
-
setOffsetInMemory
public void setOffsetInMemory(long offsetInMemory) Set the memory offset.- Parameters:
offsetInMemory- memory offset
-
getSizeInMemory
public long getSizeInMemory()Description copied from interface:ISegmentInformationGet the in-memory size of this segment or section.- Specified by:
getSizeInMemoryin interfaceISegmentInformation- Returns:
- the size in bytes
-
setSizeInMemory
public void setSizeInMemory(long sizeInMemory) Set the memory size.- Parameters:
sizeInMemory- memory size in bytes
-
getFlags
public int getFlags()Description copied from interface:ISegmentInformationGet the flags for this segment or section.- Specified by:
getFlagsin interfaceISegmentInformation- Returns:
- a combination of
FLAG_*attributes
-
setFlags
public void setFlags(int flags) Set segment flags.- Parameters:
flags- segment flags
-
getAlignment
public long getAlignment()Description copied from interface:ISegmentInformationGet the memory alignment within the segment.- Specified by:
getAlignmentin interfaceISegmentInformation- Returns:
- the alignment in bytes
-
setAlignment
public void setAlignment(long alignment) Set alignment.- Parameters:
alignment- alignment in bytes
-
toString
-