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
ConstructorDescriptionCliStreamHeader
(CliMetadataRoot metadataRoot, BinaryReader reader) Constructs a new CLI Stream Header datatype. -
Method Summary
Modifier and TypeMethodDescriptionGets theCliMetadataRoot
that contains us.getName()
Gets the name of this header's stream.int
Gets the name length.int
Gets the offset.int
getSize()
Gets the size of this header's stream.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.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: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
IOException
MemoryAccessException
-
toDataType
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 existsIOException
- if an IO-related error occurs- See Also:
-
getMetadataRoot
Gets theCliMetadataRoot
that contains us.- Returns:
- The
CliMetadataRoot
that contains us.
-
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
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.
-