Class CliStreamStrings
- java.lang.Object
-
- ghidra.app.util.bin.format.pe.cli.streams.CliAbstractStream
-
- ghidra.app.util.bin.format.pe.cli.streams.CliStreamStrings
-
- All Implemented Interfaces:
PeMarkupable
,StructConverter
public class CliStreamStrings extends CliAbstractStream
The Strings stream contains null-terminated UTF8 strings. When the stream is present, the first entry is always the empty string. This stream may contain garbage in its unreachable parts.
-
-
Constructor Summary
Constructors Constructor Description CliStreamStrings(CliStreamHeader header, long offset, int rva, BinaryReader reader)
Creates a new Strings stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getName()
Gets the name of this stream.java.lang.String
getString(int index)
Gets the string at the given index.boolean
parse()
Parses this stream.DataType
toDataType()
Returns a structure datatype representing the contents of the implementor of this interface.-
Methods inherited from class ghidra.app.util.bin.format.pe.cli.streams.CliAbstractStream
getStreamHeader, getStreamMarkupAddress, markup
-
-
-
-
Constructor Detail
-
CliStreamStrings
public CliStreamStrings(CliStreamHeader header, long offset, int rva, BinaryReader reader) throws java.io.IOException
Creates a new Strings stream.- Parameters:
header
- The stream header associated with this stream.offset
- The reader offset where this stream starts.rva
- The relative virtual address where this stream starts.reader
- A reader that is used to read the stream.- Throws:
java.io.IOException
- if there is a problem reading the stream.
-
-
Method Detail
-
getName
public static java.lang.String getName()
Gets the name of this stream.- Returns:
- The name of this stream.
-
parse
public boolean parse() throws java.io.IOException
Description copied from class:CliAbstractStream
Parses this stream.- Specified by:
parse
in classCliAbstractStream
- Returns:
- True if parsing completed successfully; otherwise, false.
- Throws:
java.io.IOException
- If there was an IO problem while parsing.
-
getString
public java.lang.String getString(int index)
Gets the string at the given index.- Parameters:
The
-CliMetadataRoot
that may point to theCliStreamStrings
.index
- The index of the string to get.- Returns:
- The string at the given index. Could be null if the index was invalid or there was a problem reading the string.
-
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.
- 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
-
-