Class ElfLoader

    • Field Detail

      • ELF_ENTRY_FUNCTION_NAME

        public static final java.lang.String ELF_ENTRY_FUNCTION_NAME
        See Also:
        Constant Field Values
      • ELF_FILE_TYPE_PROPERTY

        public static final java.lang.String ELF_FILE_TYPE_PROPERTY
        See Also:
        Constant Field Values
      • ELF_ORIGINAL_IMAGE_BASE_PROPERTY

        public static final java.lang.String ELF_ORIGINAL_IMAGE_BASE_PROPERTY
        See Also:
        Constant Field Values
      • ELF_PRELINKED_PROPERTY

        public static final java.lang.String ELF_PRELINKED_PROPERTY
        See Also:
        Constant Field Values
      • ELF_REQUIRED_LIBRARY_PROPERTY_PREFIX

        public static final java.lang.String ELF_REQUIRED_LIBRARY_PROPERTY_PREFIX
        See Also:
        Constant Field Values
      • ELF_SOURCE_FILE_PROPERTY_PREFIX

        public static final java.lang.String ELF_SOURCE_FILE_PROPERTY_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • ElfLoader

        public ElfLoader()
    • Method Detail

      • getElfOriginalImageBase

        public static java.lang.Long getElfOriginalImageBase​(Program program)
        Getter for the ELF_ORIGINAL_IMAGE_BASE_PROPERTY property.
        Parameters:
        program - Ghidra program that has the property to get
        Returns:
        Long value of the original image base, or null if the property is not present
      • validateOptions

        public java.lang.String validateOptions​(ByteProvider provider,
                                                LoadSpec loadSpec,
                                                java.util.List<Option> options,
                                                Program program)
        Description copied from interface: Loader
        Validates the Loader's options and returns null if all options are valid; otherwise, an error message describing the problem is returned.
        Specified by:
        validateOptions in interface Loader
        Overrides:
        validateOptions in class AbstractLibrarySupportLoader
        Parameters:
        provider - The bytes of the thing being loaded.
        loadSpec - The proposed LoadSpec.
        options - The list of Options to validate.
        program - existing program if the loader is adding to an existing program. If it is a fresh import, then this will be null.
        Returns:
        null if all Options are valid; otherwise, an error message describing the problem is returned.
      • findSupportedLoadSpecs

        public java.util.Collection<LoadSpec> findSupportedLoadSpecs​(ByteProvider provider)
                                                              throws java.io.IOException
        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.
        Parameters:
        provider - The bytes being loaded.
        Returns:
        A Collection of LoadSpecs that this Loader supports loading, or an empty Collection if this Loader doesn't support loading the given ByteProvider.
        Throws:
        java.io.IOException - if there was an IO-related issue finding the LoadSpecs.
      • postLoadProgramFixups

        protected void postLoadProgramFixups​(java.util.List<Program> importedPrograms,
                                             DomainFolder importFolder,
                                             java.util.List<Option> options,
                                             MessageLog messageLog,
                                             TaskMonitor monitor)
                                      throws CancelledException,
                                             java.io.IOException
        Description copied from class: AbstractProgramLoader
        This gets called after the given list of Programs is finished loading. It provides subclasses an opportunity to do follow-on actions to the load.
        Overrides:
        postLoadProgramFixups in class AbstractLibrarySupportLoader
        Parameters:
        importedPrograms - The Programs that got loaded.
        importFolder - The folder the programs were loaded to.
        options - The load options.
        messageLog - The message log.
        monitor - A cancelable task monitor.
        Throws:
        CancelledException - if the user cancelled the load.
        java.io.IOException - if there was an IO-related problem loading.
      • 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.
        Returns:
        The Loader's name.