Class ContainerHeader

  • All Implemented Interfaces:
    StructConverter

    public class ContainerHeader
    extends java.lang.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
     };
     
    • Method Detail

      • 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()
      • 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 interface StructConverter
        Returns:
        returns a structure datatype representing the implementor of this interface
        Throws:
        DuplicateNameException - when a datatype of the same name already exists
        java.io.IOException
        See Also:
        StructureDataType
      • getImageBase

        public long getImageBase()