Class CliMetadataRoot
java.lang.Object
ghidra.app.util.bin.format.pe.cli.CliMetadataRoot
- All Implemented Interfaces:
PeMarkupable
,StructConverter
The header of a
CliMetadataDirectory
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionCliMetadataRoot
(BinaryReader reader, int rva) Constructs a new CLI Metadata Root datatype. -
Method Summary
Modifier and TypeMethodDescriptionint
getBlobOffsetAtIndex
(int index) Gets the blob stream.long
Gets the file offset of this header.short
getFlags()
Gets the flags.Gets the GUID stream.short
Gets the major version.Gets the Metadata stream.short
Gets the minor version.int
Gets the reserved field.int
getRva()
Gets the relative virtual address of this header.int
Gets the signature.getStreamHeader
(String name) Gets the stream header with the given name.Gets the stream headers.short
Gets the number of streams present in the metadata.Gets the strings stream.Gets the user strings stream.Gets the version string.int
Gets the length of the version string that follows the length field.void
markup
(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader) Marks up a PE structure.boolean
parse()
Returns a structure datatype representing the contents of the implementor of this interface.
-
Field Details
-
NAME
- See Also:
-
PATH
- See Also:
-
-
Constructor Details
-
CliMetadataRoot
Constructs a new CLI Metadata Root datatype. Matches ISO 23271 II.24.2.- Parameters:
reader
- A binary reader set to start reading at the start of this header.rva
- The RVA of this header.- Throws:
IOException
- if there is a problem reading the header.
-
-
Method Details
-
parse
- Throws:
IOException
-
markup
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException, 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
CodeUnitInsertionException
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:
-
getFileOffset
public long getFileOffset()Gets the file offset of this header.- Returns:
- The file offset of this header.
-
getRva
public int getRva()Gets the relative virtual address of this header.- Returns:
- The relative virtual address of this header.
-
getSignature
public int getSignature()Gets the signature.Should always be 0x424a5342.
- Returns:
- The signature.
-
getMajorVersion
public short getMajorVersion()Gets the major version.- Returns:
- The major version.
-
getMinorVersion
public short getMinorVersion()Gets the minor version.- Returns:
- The minor version.
-
getReserved
public int getReserved()Gets the reserved field.Should always be 0.
- Returns:
- The reserved field.
-
getVersionLength
public int getVersionLength()Gets the length of the version string that follows the length field.- Returns:
- The length of the version string that follows the length field.
-
getVersion
Gets the version string.- Returns:
- The version string. Could be null if the version length appeared too long during parsing of the header.
-
getFlags
public short getFlags()Gets the flags.Should always be 0.
- Returns:
- The flags.
-
getStreamsCount
public short getStreamsCount()Gets the number of streams present in the metadata.- Returns:
- The number of streams present in the metadata.
-
getGuidStream
Gets the GUID stream.- Returns:
- The GUID stream. Could be null if it did not parse correctly.
-
getUserStringsStream
Gets the user strings stream.- Returns:
- The user strings stream. Could be null if it did not parse correctly.
-
getStringsStream
Gets the strings stream.- Returns:
- The strings stream. Could be null if it did not parse correctly.
-
getBlobStream
Gets the blob stream.- Returns:
- The blob stream. Could be null if it did not parse correctly.
-
getMetadataStream
Gets the Metadata stream.- Returns:
- The Metadata stream. Could be null if it did not parse correctly.
-
getStreamHeaders
Gets the stream headers.- Returns:
- A collection of stream headers.
-
getStreamHeader
Gets the stream header with the given name.- Parameters:
name
- The name of the stream header to get.- Returns:
- The stream header that matches the given name, or null if it wasn't found.
-
getBlobOffsetAtIndex
public int getBlobOffsetAtIndex(int index)
-