Package ghidra.app.util.bin.format.xcoff
Class XCoffOptionalHeader
- java.lang.Object
-
- ghidra.app.util.bin.format.xcoff.XCoffOptionalHeader
-
- All Implemented Interfaces:
StructConverter
public final class XCoffOptionalHeader extends java.lang.Object implements StructConverter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetCpuFlag()Returns the CPU bit flags.bytegetCpuType()Reserved.longgetDataStart()Returns the virtual address of the .data section.longgetDebugger()This field should be 0.longgetEntry()Returns the virtual address of the entry point.bytegetFlags()This field consists of 4 1-bit flags and a 4-bit .tdata alignment.longgetInitializedDataSize()Returns the size (in bytes) of the raw data for the .data section.shortgetMagic()Returns the magic value.shortgetMaxAlignmentForData()Returns log (base-2) of the maximum alignment needed for any csect in the .data or .bss section.shortgetMaxAlignmentForText()Returns log (base-2) of the maximum alignment needed for any csect in the .text section.longgetMaxDataSize()Returns the maximum data size allowed for this executable.longgetMaxStackSize()Returns the maximum stack size allowed for this executable.java.lang.StringgetModuleType()Returns the module type.shortgetSectionNumberForBss()Returns the number of the .bss section.shortgetSectionNumberForData()Returns the number of the .data section.shortgetSectionNumberForEntry()Returns the number of the section that contains the entry point.shortgetSectionNumberForLoader()Returns the number of the section that contains the system loader information.shortgetSectionNumberForTBss()shortgetSectionNumberForTData()shortgetSectionNumberForText()Returns the number of the .text section.shortgetSectionNumberForTOC()Returns the number of the section that contains the TOC.longgetTextSize()Returns the size (in bytes) of the raw data for the .text section.longgetTextStart()Returns the virtual address of the .text section.longgetTOC()Returns the virtual address of the TOC anchor.longgetUninitializedDataSize()Returns the size (in bytes) of the .bss section.shortgetVersionStamp()Returns the format version for this auxiliary header.DataTypetoDataType()Returns a structure datatype representing the contents of the implementor of this interface.java.lang.StringtoString()
-
-
-
Field Detail
-
AOUTHDRSZ
public static final int AOUTHDRSZ
- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getMagic
public short getMagic()
Returns the magic value. The binder assigns the following value: 0x010b.- Returns:
- the magic value
-
getVersionStamp
public short getVersionStamp()
Returns the format version for this auxiliary header. The only valid value is 1.- Returns:
- the format version for this auxiliary header
-
getTextSize
public long getTextSize()
Returns the size (in bytes) of the raw data for the .text section.- Returns:
- the size (in bytes) of the raw data for the .text section
-
getInitializedDataSize
public long getInitializedDataSize()
Returns the size (in bytes) of the raw data for the .data section.- Returns:
- the size (in bytes) of the raw data for the .data section
-
getUninitializedDataSize
public long getUninitializedDataSize()
Returns the size (in bytes) of the .bss section. No raw data exists in the file for the .bss section.- Returns:
- the size (in bytes) of the .bss section
-
getEntry
public long getEntry()
Returns the virtual address of the entry point.- Returns:
- the virtual address of the entry point
-
getTextStart
public long getTextStart()
Returns the virtual address of the .text section.- Returns:
- the virtual address of the .text section
-
getDataStart
public long getDataStart()
Returns the virtual address of the .data section.- Returns:
- the virtual address of the .data section
-
getTOC
public long getTOC()
Returns the virtual address of the TOC anchor.- Returns:
- the virtual address of the TOC anchor
-
getSectionNumberForEntry
public short getSectionNumberForEntry()
Returns the number of the section that contains the entry point. The entry point must be in the .text or .data section.- Returns:
- the number of the section that contains the entry point
-
getSectionNumberForText
public short getSectionNumberForText()
Returns the number of the .text section.- Returns:
- the number of the .text section
-
getSectionNumberForData
public short getSectionNumberForData()
Returns the number of the .data section.- Returns:
- the number of the .data section
-
getSectionNumberForTOC
public short getSectionNumberForTOC()
Returns the number of the section that contains the TOC.- Returns:
- the number of the section that contains the TOC
-
getSectionNumberForLoader
public short getSectionNumberForLoader()
Returns the number of the section that contains the system loader information.- Returns:
- the number of the section that contains the system loader information
-
getSectionNumberForBss
public short getSectionNumberForBss()
Returns the number of the .bss section.- Returns:
- the number of the .bss section
-
getMaxAlignmentForText
public short getMaxAlignmentForText()
Returns log (base-2) of the maximum alignment needed for any csect in the .text section.- Returns:
- the maximum alignment for the .text section
-
getMaxAlignmentForData
public short getMaxAlignmentForData()
Returns log (base-2) of the maximum alignment needed for any csect in the .data or .bss section.- Returns:
- the maximum alignment for the .data or .bss section
-
getModuleType
public java.lang.String getModuleType()
Returns the module type. Valid module types: RO - Specifies a read-only module.- Returns:
- the module type
-
getCpuFlag
public byte getCpuFlag()
Returns the CPU bit flags.- Returns:
- the CPU bit flags
-
getCpuType
public byte getCpuType()
Reserved. Always returns 0.- Returns:
- always returns 0
-
getMaxStackSize
public long getMaxStackSize()
Returns the maximum stack size allowed for this executable. If the value is 0, then the default value is used.- Returns:
- the maximum stack size allow for this executable
-
getMaxDataSize
public long getMaxDataSize()
Returns the maximum data size allowed for this executable. If the value is 0, then the default value is used.- Returns:
- the maximum data size allow for this executable
-
getDebugger
public long getDebugger()
This field should be 0. When the loaded program is being debugged, the memory image of this field may be modified by the debugger to insert a trap instruction.- Returns:
- should return 0
-
getFlags
public byte getFlags()
This field consists of 4 1-bit flags and a 4-bit .tdata alignment.- Returns:
- the flags
-
getSectionNumberForTData
public short getSectionNumberForTData()
-
getSectionNumberForTBss
public short getSectionNumberForTBss()
-
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
Description copied from interface:StructConverterReturns a structure datatype representing the contents of the implementor of this interface.For example, given:
class A { int foo; double bar; }The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.
- Specified by:
toDataTypein interfaceStructConverter- Returns:
- returns a structure datatype representing the implementor of this interface
- Throws:
DuplicateNameException- when a datatype of the same name already existsjava.io.IOException- See Also:
StructureDataType
-
-