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 Object implements 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

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ARCHITECTURE_68k`
  `static final String`
  `ARCHITECTURE_PPC`
  `static final String`
  `TAG1`
  `static final String`
  `TAG2`

  ### Fields inherited from interface ghidra.app.util.bin.StructConverter

  `ASCII, BYTE, DWORD, IBO32, IBO64, POINTER, QWORD, SLEB128, STRING, ULEB128, UTF16, UTF8, VOID, WORD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContainerHeader(ByteProvider provider)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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.
  `List<SectionHeader>`
  `getSections()`
  `String`
  `getTag1()`
  Always returns "Joy!"
  `String`
  `getTag2()`
  Always returns "peff"
  `void`
  `parse()`
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TAG1

    public static final String TAG1
    See Also:
      - Constant Field Values

  - ### TAG2

    public static final String TAG2
    See Also:
      - Constant Field Values

  - ### ARCHITECTURE_PPC

    public static final String ARCHITECTURE_PPC
    See Also:
      - Constant Field Values

  - ### ARCHITECTURE_68k

    public static final String ARCHITECTURE_68k
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ContainerHeader

    public ContainerHeader(ByteProvider provider) throws IOException, PefException
    Throws:
      `IOException`
      `PefException`

- ## Method Details

  - ### parse

    public void parse() throws IOException, PefException
    Throws:
      `IOException`
      `PefException`

  - ### getTag1

    public String getTag1()
    Always returns "Joy!"
    Returns:
      always returns "Joy!"

  - ### getTag2

    public String getTag2()
    Always returns "peff"
    Returns:
      always returns "peff"

  - ### getArchitecture

    public 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 List<SectionHeader> getSections()

  - ### getLoader

    public LoaderInfoHeader getLoader()

  - ### toDataType

    public DataType toDataType() throws DuplicateNameException, 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 interface `StructConverter`
    Returns:
      returns a structure datatype representing the implementor of this interface
    Throws:
      `DuplicateNameException` - when a datatype of the same name already exists
      `IOException`
    See Also:
      - `StructureDataType`

  - ### getImageBase

    public long getImageBase()