Package ghidra.app.util.bin.format
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 Summary
Modifier and TypeMethodDescriptiongetFilteredLoadInputStream
(ElfLoadHelper elfLoadHelper, Address start, long dataLength, BiConsumer<String, Throwable> errorConsumer) Return filtered InputStream for loading a memory block (includes non-loaded OTHER blocks).Returns raw data input stream associated with this loadable object..boolean
hasFilteredLoadInputStream
(ElfLoadHelper elfLoadHelper, Address start) Determine if the use of input stream decompression or filtering via an extension is neccessary.
-
Method Details
-
hasFilteredLoadInputStream
Determine if the use of input stream decompression or filtering via an extension is neccessary. If this method returns true and afiltered stream
is required and will prevent the use of a direct mapping to file bytes for affected memory regions.- Parameters:
elfLoadHelper
- ELF load helperstart
- 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 IOExceptionReturn filtered InputStream for loading a memory block (includes non-loaded OTHER blocks). SeehasFilteredLoadInputStream(ElfLoadHelper, Address)
.- Parameters:
elfLoadHelper
- ELF load helperstart
- memory load addressdataLength
- 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
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
-