Package ghidra.app.util.bin.format.pef
Class ContainerHeader
- java.lang.Object
-
- ghidra.app.util.bin.format.pef.ContainerHeader
-
- All Implemented Interfaces:
StructConverter
public class ContainerHeader extends java.lang.Object implements StructConverter
See Apple's -- PEFBinaryFormat.hstruct PEFContainerHeader { OSType tag1; //Must contain 'Joy!'. SType tag2; //Must contain 'peff'. (Yes, with two 'f's.) OSType architecture; //The ISA for code sections. Constants in CodeFragments.h. UInt32 formatVersion; //The physical format version. UInt32 dateTimeStamp; //Macintosh format creation/modification stamp. UInt32 oldDefVersion; //Old definition version number for the code fragment. UInt32 oldImpVersion; //Old implementation version number for the code fragment. UInt32 currentVersion; //Current version number for the code fragment. UInt16 sectionCount; //Total number of section headers that follow. UInt16 instSectionCount; //Number of instantiated sections. UInt32 reservedA; //Reserved, must be written as zero };
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ARCHITECTURE_68k
static java.lang.String
ARCHITECTURE_PPC
static java.lang.String
TAG1
static java.lang.String
TAG2
-
Constructor Summary
Constructors Constructor Description ContainerHeader(ByteProvider provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getArchitecture()
Returns the architecture for this container.int
getCurrentVersion()
Returns the current CFM version.int
getDateTimeStamp()
Returns the creation date of this PEF container.int
getFormatVersion()
Returns the version of this PEF container.long
getImageBase()
short
getInstantiatedSectionCount()
Returns the number of instantiated sections.LoaderInfoHeader
getLoader()
int
getOldDefVersion()
Returns the old CFM version.int
getOldImpVersion()
Returns the old CFM implementation version.int
getReservedA()
Reserved field, always returns zero (0).short
getSectionCount()
Returns the total sections in this container.java.util.List<SectionHeader>
getSections()
java.lang.String
getTag1()
Always returns "Joy!"java.lang.String
getTag2()
Always returns "peff"void
parse()
DataType
toDataType()
Returns a structure datatype representing the contents of the implementor of this interface.
-
-
-
Field Detail
-
TAG1
public static final java.lang.String TAG1
- See Also:
- Constant Field Values
-
TAG2
public static final java.lang.String TAG2
- See Also:
- Constant Field Values
-
ARCHITECTURE_PPC
public static final java.lang.String ARCHITECTURE_PPC
- See Also:
- Constant Field Values
-
ARCHITECTURE_68k
public static final java.lang.String ARCHITECTURE_68k
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContainerHeader
public ContainerHeader(ByteProvider provider) throws java.io.IOException, PefException
- Throws:
java.io.IOException
PefException
-
-
Method Detail
-
parse
public void parse() throws java.io.IOException, PefException
- Throws:
java.io.IOException
PefException
-
getTag1
public java.lang.String getTag1()
Always returns "Joy!"- Returns:
- always returns "Joy!"
-
getTag2
public java.lang.String getTag2()
Always returns "peff"- Returns:
- always returns "peff"
-
getArchitecture
public java.lang.String getArchitecture()
Returns the architecture for this container. Either PowerPC CFM or CFm-68k.- Returns:
- the architecture for this container
-
getFormatVersion
public int getFormatVersion()
Returns the version of this PEF container. The current version is 1.- Returns:
- the version of this PEF container
-
getDateTimeStamp
public int getDateTimeStamp()
Returns the creation date of this PEF container. The stamp follows the Mac time-measurement scheme. That is, the number of seconds measured from Jan 1, 1904.- Returns:
- the creation date of this PEF container
-
getOldDefVersion
public int getOldDefVersion()
Returns the old CFM version.- Returns:
- the old CFM version
-
getOldImpVersion
public int getOldImpVersion()
Returns the old CFM implementation version.- Returns:
- the old CFM implementation version
-
getCurrentVersion
public int getCurrentVersion()
Returns the current CFM version.- Returns:
- the current CFM version
-
getSectionCount
public short getSectionCount()
Returns the total sections in this container.- Returns:
- the total sections in this container
-
getInstantiatedSectionCount
public short getInstantiatedSectionCount()
Returns the number of instantiated sections. Instantiated sections contain code or data that are required for execution.- Returns:
- the number of instantiated sections
-
getReservedA
public int getReservedA()
Reserved field, always returns zero (0).- Returns:
- always returns zero (0)
-
getSections
public java.util.List<SectionHeader> getSections()
-
getLoader
public LoaderInfoHeader getLoader()
-
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
-
getImageBase
public long getImageBase()
-
-