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 Details

  • Constructor Details

  • 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:
    • getImageBase

      public long getImageBase()