Package ghidra.app.util.bin.format.pef
Class ContainerHeader
java.lang.Object
ghidra.app.util.bin.format.pef.ContainerHeader
- All Implemented Interfaces:
StructConverter
See Apple's -- PEFBinaryFormat.h
struct 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the architecture for this container.int
Returns the current CFM version.int
Returns the creation date of this PEF container.int
Returns the version of this PEF container.long
short
Returns the number of instantiated sections.int
Returns the old CFM version.int
Returns the old CFM implementation version.int
Reserved field, always returns zero (0).short
Returns the total sections in this container.getTag1()
Always returns "Joy!"getTag2()
Always returns "peff"void
parse()
Returns a structure datatype representing the contents of the implementor of this interface.
-
Field Details
-
TAG1
- See Also:
-
TAG2
- See Also:
-
ARCHITECTURE_PPC
- See Also:
-
ARCHITECTURE_68k
- See Also:
-
-
Constructor Details
-
ContainerHeader
- Throws:
IOException
PefException
-
-
Method Details
-
parse
- Throws:
IOException
PefException
-
getTag1
Always returns "Joy!"- Returns:
- always returns "Joy!"
-
getTag2
Always returns "peff"- Returns:
- always returns "peff"
-
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
-
getLoader
-
toDataType
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 existsIOException
- if an IO-related error occurs- See Also:
-
getImageBase
public long getImageBase()
-