Class CliStreamHeader
java.lang.Object
ghidra.app.util.bin.format.pe.cli.CliStreamHeader
- All Implemented Interfaces:
PeMarkupable,StructConverter
A structure used by a
CliMetadataRoot describe a CliAbstractStream.
Note that this type of "header" isn't found at the start of the stream, but as
elements of a list of headers at the end of a CliMetadataRoot. They
are kind of like PE section headers.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCliStreamHeader(CliMetadataRoot metadataRoot, BinaryReader reader) Constructs a new CLI Stream Header datatype. -
Method Summary
Modifier and TypeMethodDescriptionGets theCliMetadataRootthat contains us.getName()Gets the name of this header's stream.intGets the name length.intGets the offset.intgetSize()Gets the size of this header's stream.Gets theCliAbstractStreamthat this is a header for.voidmarkup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader) Marks up a PE structure.protected voidsetStream(CliAbstractStream stream) Sets this header's stream.Returns a structure datatype representing the contents of the implementor of this interface.toString()
-
Constructor Details
-
CliStreamHeader
Constructs a new CLI Stream Header datatype.- Parameters:
metadataRoot- the metadata root.reader- A binary reader set to start reading at the start of this header.- Throws:
IOException- if there is a problem reading the header.
-
-
Method Details
-
markup
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader) throws DuplicateNameException, IOException, MemoryAccessException Description copied from interface:PeMarkupableMarks up a PE structure.- Specified by:
markupin interfacePeMarkupable- Parameters:
program- The program to markup.isBinary- True if the program is binary; otherwise, false.monitor- The monitor.log- The log.ntHeader- The PE's NT Header structure.- Throws:
DuplicateNameExceptionIOExceptionMemoryAccessException
-
toDataType
Description copied from interface:StructConverterReturns a structure datatype representing the contents of the implementor of this interface.For example, given:
class A { int foo; double bar; }The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.
- Specified by:
toDataTypein interfaceStructConverter- Returns:
- returns a structure datatype representing the implementor of this interface
- Throws:
DuplicateNameException- when a datatype of the same name already existsIOException- if an IO-related error occurs- See Also:
-
getMetadataRoot
Gets theCliMetadataRootthat contains us.- Returns:
- The
CliMetadataRootthat contains us.
-
getStream
Gets theCliAbstractStreamthat this is a header for.- Returns:
- The
CliAbstractStreamthat this is a header for. Could be null if we don't support the stream type.
-
getOffset
public int getOffset()Gets the offset. This is not a file offset, but an offset that gets added to the metadata header's offset to obtain a file offset.- Returns:
- The offset.
-
getSize
public int getSize()Gets the size of this header's stream.- Returns:
- The size of this header's stream.
-
getName
Gets the name of this header's stream.- Returns:
- The name of this header's stream.
-
getNameLength
public int getNameLength()Gets the name length.The name length may be larger than necessary because the name string is must be aligned to the next 4-byte boundary.
- Returns:
- The name length.
-
toString
-
setStream
Sets this header's stream.- Parameters:
stream- The stream associated with this header.
-