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 byte
getCpuFlag()
Returns the CPU bit flags.byte
getCpuType()
Reserved.long
getDataStart()
Returns the virtual address of the .data section.long
getDebugger()
This field should be 0.long
getEntry()
Returns the virtual address of the entry point.byte
getFlags()
This field consists of 4 1-bit flags and a 4-bit .tdata alignment.long
getInitializedDataSize()
Returns the size (in bytes) of the raw data for the .data section.short
getMagic()
Returns the magic value.short
getMaxAlignmentForData()
Returns log (base-2) of the maximum alignment needed for any csect in the .data or .bss section.short
getMaxAlignmentForText()
Returns log (base-2) of the maximum alignment needed for any csect in the .text section.long
getMaxDataSize()
Returns the maximum data size allowed for this executable.long
getMaxStackSize()
Returns the maximum stack size allowed for this executable.java.lang.String
getModuleType()
Returns the module type.short
getSectionNumberForBss()
Returns the number of the .bss section.short
getSectionNumberForData()
Returns the number of the .data section.short
getSectionNumberForEntry()
Returns the number of the section that contains the entry point.short
getSectionNumberForLoader()
Returns the number of the section that contains the system loader information.short
getSectionNumberForTBss()
short
getSectionNumberForTData()
short
getSectionNumberForText()
Returns the number of the .text section.short
getSectionNumberForTOC()
Returns the number of the section that contains the TOC.long
getTextSize()
Returns the size (in bytes) of the raw data for the .text section.long
getTextStart()
Returns the virtual address of the .text section.long
getTOC()
Returns the virtual address of the TOC anchor.long
getUninitializedDataSize()
Returns the size (in bytes) of the .bss section.short
getVersionStamp()
Returns the format version for this auxiliary header.DataType
toDataType()
Returns a structure datatype representing the contents of the implementor of this interface.java.lang.String
toString()
-
-
-
Field Detail
-
AOUTHDRSZ
public static final int AOUTHDRSZ
- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:StructConverter
Returns 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:
toDataType
in 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
-
-