Class DyldCacheHeader

    • Constructor Detail

      • DyldCacheHeader

        public DyldCacheHeader​(BinaryReader reader)
                        throws java.io.IOException
        Create a new DyldCacheHeader.
        Parameters:
        reader - A BinaryReader positioned at the start of a DYLD cache header
        Throws:
        java.io.IOException - if there was an IO-related problem creating the DYLD cache header
    • Method Detail

      • parseFromFile

        public void parseFromFile​(boolean parseSymbols,
                                  MessageLog log,
                                  TaskMonitor monitor)
                           throws CancelledException
        Parses the structures referenced by this DyldCacheHeader from a file.
        Parameters:
        parseSymbols - True if symbols should be parsed (could be very slow); otherwise, false
        log - The log
        monitor - A cancellable task monitor
        Throws:
        CancelledException - if the user cancelled the operation
      • getBaseAddress

        public long getBaseAddress()
        Gets the base address of the DYLD cache. This is where the cache should be loaded in memory.
        Returns:
        The base address of the DYLD cache
      • getMagic

        public byte[] getMagic()
        Gets the magic bytes, which contain version information.
        Returns:
        The magic bytes
      • getMappedImages

        public java.util.List<DyldCacheImage> getMappedImages()
        Generates a List of DyldCacheImages that are mapped in by this DyldCacheHeader. Requires header to have been parsed.

        NOTE: A "split" DYLD Cache header may declare an image, but that image may get loaded at an address defined by the memory map of a different split header. This method will only return the images that are mapped by "this" header's memory map.

        Returns:
        A List of DyldCacheImages mapped by this DyldCacheHeader
      • getBranchPoolAddresses

        public java.util.List<java.lang.Long> getBranchPoolAddresses()
        Gets the List of branch pool address. Requires header to have been parsed.
        Returns:
        The List of branch pool address
      • getArchitecture

        public DyldArchitecture getArchitecture()
        Gets architecture information.
        Returns:
        architecture information
      • 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
      • haSlideInfo

        public boolean haSlideInfo()
        Checks to see if any slide info exists
        Returns:
        True if any slide info exists; otherwise, false
      • unslidLoadAddress

        public long unslidLoadAddress()
        Get the original unslid load address. This is found in the first mapping infos.
        Returns:
        the original unslid load address