Class CliStreamHeader
- java.lang.Object
-
- ghidra.app.util.bin.format.pe.cli.CliStreamHeader
-
- All Implemented Interfaces:
PeMarkupable
,StructConverter
public class CliStreamHeader extends java.lang.Object implements StructConverter, PeMarkupable
A structure used by aCliMetadataRoot
describe aCliAbstractStream
.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.
-
-
Constructor Summary
Constructors Constructor Description CliStreamHeader(CliMetadataRoot metadataRoot, BinaryReader reader)
Constructs a new CLI Stream Header datatype.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CliMetadataRoot
getMetadataRoot()
Gets theCliMetadataRoot
that contains us.java.lang.String
getName()
Gets the name of this header's stream.int
getNameLength()
Gets the name length.int
getOffset()
Gets the offset.int
getSize()
Gets the size of this header's stream.CliAbstractStream
getStream()
Gets theCliAbstractStream
that this is a header for.void
markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader)
Marks up a PE structure.protected void
setStream(CliAbstractStream stream)
Sets this header's stream.DataType
toDataType()
Returns a structure datatype representing the contents of the implementor of this interface.java.lang.String
toString()
-
-
-
Constructor Detail
-
CliStreamHeader
public CliStreamHeader(CliMetadataRoot metadataRoot, BinaryReader reader) throws java.io.IOException
Constructs a new CLI Stream Header datatype.- Parameters:
reader
- A binary reader set to start reading at the start of this header.virtualAddress
- The RVA of this header.ntHeader
- The NT header.- Throws:
java.io.IOException
-
-
Method Detail
-
markup
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader) throws DuplicateNameException, java.io.IOException, MemoryAccessException
Description copied from interface:PeMarkupable
Marks up a PE structure.- Specified by:
markup
in 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:
DuplicateNameException
java.io.IOException
MemoryAccessException
-
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
Description copied from interface:StructConverter
Returns 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:
toDataType
in interfaceStructConverter
- Returns:
- returns a structure datatype representing the implementor of this interface
- Throws:
DuplicateNameException
- when a datatype of the same name already existsjava.io.IOException
- See Also:
StructureDataType
-
getMetadataRoot
public CliMetadataRoot getMetadataRoot()
Gets theCliMetadataRoot
that contains us.- Returns:
- The
CliMetadataRoot
that contains us.
-
getStream
public CliAbstractStream getStream()
Gets theCliAbstractStream
that this is a header for.- Returns:
- The
CliAbstractStream
that 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
public java.lang.String 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setStream
protected void setStream(CliAbstractStream stream)
Sets this header's stream.- Parameters:
stream
- The stream associated with this header.
-
-