Class MachoLoader

    • Constructor Detail

      • MachoLoader

        public MachoLoader()
    • Method Detail

      • findSupportedLoadSpecs

        public java.util.Collection<LoadSpec> findSupportedLoadSpecs​(ByteProvider provider)
        Description copied from interface: Loader
        If this Loader supports loading the given ByteProvider, this methods returns a Collection of all supported LoadSpecs that contain discovered load specification information that this Loader will need to load. If this Loader cannot support loading the given ByteProvider, an empty Collection is returned.
        provider - The bytes being loaded.
        A Collection of LoadSpecs that this Loader supports loading, or an empty Collection if this Loader doesn't support loading the given ByteProvider.
        Throws: - if there was an IO-related issue finding the LoadSpecs.
      • getName

        public java.lang.String getName()
        Description copied from interface: Loader
        Gets the Loader's name, which is used both for display purposes, and to identify the Loader in the opinion files.
        The Loader's name.
      • importLibrary

        protected boolean importLibrary​(java.lang.String libName,
                                        DomainFolder libFolder,
                                        LoadSpec loadSpec,
                                        java.util.List<Option> options,
                                        MessageLog log,
                                        java.lang.Object consumer,
                                        java.util.Set<java.lang.String> unprocessedLibs,
                                        java.util.List<Program> programList,
                                        TaskMonitor monitor)
                                 throws CancelledException,
        Overrides the default implementation to account for Universal Binary (UBI) files. These must be specially parsed to find the internal file matching the current architecture.

        FatHeader is used to parse the file to determine if it is a UBI. If so, each file within the archive is run through the import process until one is found that is successful (meaning it matches the correct architecture). Only one file in the UBI will ever be imported. If the provided file is NOT a UBI, default import method will be invoked.

        importLibrary in class AbstractLibrarySupportLoader
        libName - the name of the library to import
        libFolder - the library folder
        libFile - the library file to load
        loadSpec - the LoadSpec
        options - the load options
        log - the message log
        consumer - consumer object for the Program generated
        unprocessedLibs - list of libraries that need to be loaded
        programList - list of programs to add the imported library to
        monitor - the task monitor
        true if the load was successful
        CancelledException - if the user cancelled the load operation - if there was an error during the load