Interface MemoryLoadable

All Known Implementing Classes:
ElfProgramHeader, ElfSectionHeader

public interface MemoryLoadable
MemoryLoadable serves as both a marker interface which identifies a memory loadable portion of a binary file (supports use as a Hashtable key). In addition, it serves to supply the neccessary input stream to create a MemoryBlock.
  • Method Details

    • hasFilteredLoadInputStream

      boolean hasFilteredLoadInputStream(ElfLoadHelper elfLoadHelper, Address start)
      Determine if the use of input stream decompression or filtering via an extension is neccessary. If this method returns true and a filtered stream is required and will prevent the use of a direct mapping to file bytes for affected memory regions.
      Parameters:
      elfLoadHelper - ELF load helper
      start - memory load address
      Returns:
      true if the use of a filtered input stream is required
    • getFilteredLoadInputStream

      InputStream getFilteredLoadInputStream(ElfLoadHelper elfLoadHelper, Address start, long dataLength, BiConsumer<String,Throwable> errorConsumer) throws IOException
      Return filtered InputStream for loading a memory block (includes non-loaded OTHER blocks). See hasFilteredLoadInputStream(ElfLoadHelper, Address).
      Parameters:
      elfLoadHelper - ELF load helper
      start - memory load address
      dataLength - the in-memory data length in bytes (actual bytes read from dataInput may be more)
      errorConsumer - consumer that will accept errors which may occur during stream decompression, if null Msg.error() will be used.
      Returns:
      filtered input stream or original input stream
      Throws:
      IOException - if error initializing filtered input stream
    • getRawInputStream

      InputStream getRawInputStream() throws IOException
      Returns raw data input stream associated with this loadable object..
      Returns:
      raw data input stream associated with this loadable object.
      Throws:
      IOException - if error initializing input stream