Package ghidra.app.util.opinion

# Class MapLoader

java.lang.Object
ghidra.app.util.opinion.AbstractProgramLoader
ghidra.app.util.opinion.AbstractProgramWrapperLoader
ghidra.app.util.opinion.MapLoader

All Implemented Interfaces:
  `Loader`, `ExtensionPoint`, `Comparable<Loader>`

public class MapLoader extends AbstractProgramWrapperLoader
A `Loader` for processing Microsoft MAP files.

Sample .map file section we parse to extract symbol information:

       ...
       ...
       ...

       Address         Publics by Value              Rva+Base               Lib:Object

      0000:00000000       ___safe_se_handler_table   0000000000000000     <absolute>
      0000:00000000       ___safe_se_handler_count   0000000000000000     <absolute>
      0000:00000000       __ImageBase                0000000140000000     <linker-defined>
      0001:00000040       foo                        0000000140001040 f   foo.obj
      0001:000000c0       bar                        00000001400010c0 f   foo.obj

      ...
      ...
      ...

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `MAP_NAME`
  `static final String`
  `NO_MAGIC`

  ### Fields inherited from class ghidra.app.util.opinion.AbstractProgramLoader

  `ANCHOR_LABELS_OPTION_NAME, APPLY_LABELS_OPTION_NAME`

  ### Fields inherited from interface ghidra.app.util.opinion.Loader

  `COMMAND_LINE_ARG_PREFIX, OPTIONS_PROJECT_SAVE_STATE_KEY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MapLoader()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Collection<LoadSpec>`
  `findSupportedLoadSpecs(ByteProvider provider)`
  If this `Loader` supports loading the given `ByteProvider`, this methods returns a `Collection` of all supported `LoadSpec`s that contain discovered load specification information that this `Loader` will need to load.
  `String`
  `getName()`
  Gets the `Loader`'s name, which is used both for display purposes, and to identify the `Loader` in the opinion files.
  `void`
  `load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program prog, TaskMonitor monitor, MessageLog log)`
  Loads bytes in a particular format into the given `Program`.
  `boolean`
  `supportsLoadIntoProgram()`
  Checks to see if this `Loader` supports loading into an existing `Program`.

  ### Methods inherited from class ghidra.app.util.opinion.AbstractProgramWrapperLoader

  `getTier, getTierPriority, loadProgram, loadProgramInto`

  ### Methods inherited from class ghidra.app.util.opinion.AbstractProgramLoader

  `concatenatePaths, createDefaultMemoryBlocks, createProgram, generateBlockName, getDefaultOptions, getLanguageService, load, loadInto, markAsFunction, postLoadCleanup, postLoadProgramFixups, release, setProgramProperties, shouldApplyProcessorLabelsByDefault, validateOptions`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.app.util.opinion.Loader

  `compareTo, getPreferredFileName, loadsIntoNewFolder, supportsLoadIntoProgram`

- ## Field Details

  - ### MAP_NAME

    public static final String MAP_NAME
    See Also:
      - Constant Field Values

  - ### NO_MAGIC

    public static final String NO_MAGIC
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MapLoader

    public MapLoader()

- ## Method Details

  - ### findSupportedLoadSpecs

    public Collection<LoadSpec> findSupportedLoadSpecs(ByteProvider provider) throws IOException
    Description copied from interface: `Loader`
    If this `Loader` supports loading the given `ByteProvider`, this methods returns a `Collection` of all supported `LoadSpec`s 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 `LoadSpec`s that this `Loader` supports loading, or an empty `Collection` if this `Loader` doesn't support loading the given `ByteProvider`.
    Throws:
      `IOException` - if there was an IO-related issue finding the `LoadSpec`s.

  - ### load

    public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program prog, TaskMonitor monitor, MessageLog log) throws IOException
    Description copied from class: `AbstractProgramWrapperLoader`
    Loads bytes in a particular format into the given `Program`.
    Specified by:
      `load` in class `AbstractProgramWrapperLoader`
    Parameters:
      `provider` - The bytes to load.
      `loadSpec` - The `LoadSpec` to use during load.
      `options` - The load options.
      `prog` - The `Program` to load into.
      `monitor` - A cancelable task monitor.
      `log` - The message log.
    Throws:
      `IOException` - if there was an IO-related problem loading.

  - ### getName

    public 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.

  - ### supportsLoadIntoProgram

    public boolean supportsLoadIntoProgram()
    Description copied from interface: `Loader`
    Checks to see if this `Loader` supports loading into an existing `Program`.

    The default behavior of this method is to return false.

    Returns:
      True if this `Loader` supports loading into an existing `Program`; otherwise, false.