Class ResourceDirectoryEntry
- java.lang.Object
 - 
- ghidra.app.util.bin.format.pe.resource.ResourceDirectoryEntry
 
 
- 
- All Implemented Interfaces:
 StructConverter
public class ResourceDirectoryEntry extends java.lang.Object implements StructConverter
typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { union { struct { DWORD NameOffset:31; DWORD NameIsString:1; }; DWORD Name; WORD Id; }; union { DWORD OffsetToData; struct { DWORD OffsetToDirectory:31; DWORD DataIsDirectory:1; }; }; }; 
- 
- 
Constructor Summary
Constructors Constructor Description ResourceDirectoryEntry(FactoryBundledWithBinaryReader reader, int index, int resourceBase, boolean isNameEntry, boolean isFirstLevel, NTHeader ntHeader)Constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceDataEntrygetData()booleangetDataIsDirectory()Returns a pointer to information about a specific resource instance.ResourceDirectoryStringUgetDirectoryString()intgetId()Returns a resource ID.intgetName()booleangetNameIsString()Returns the ID of the name of this resource.intgetNameOffset()Returns the offset to the name of this resource.intgetOffsetToData()intgetOffsetToDirectory()Returns an offset to another resource directory.java.util.List<ResourceInfo>getResources(int level)ResourceDirectorygetSubDirectory()booleanisNameEntry()Returns true if the parent resource directory is named, false indicates an ID.booleanisValid()DataTypetoDataType()Returns a structure datatype representing the contents of the implementor of this interface.java.lang.StringtoString() 
 - 
 
- 
- 
Field Detail
- 
SIZEOF
public static final int SIZEOF
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
ResourceDirectoryEntry
public ResourceDirectoryEntry(FactoryBundledWithBinaryReader reader, int index, int resourceBase, boolean isNameEntry, boolean isFirstLevel, NTHeader ntHeader) throws java.io.IOException
Constructor.- Parameters:
 reader- the binary readerindex- the index where this directory begins- Throws:
 java.io.IOException
 
 - 
 
- 
Method Detail
- 
getResources
public java.util.List<ResourceInfo> getResources(int level)
 
- 
isNameEntry
public boolean isNameEntry()
Returns true if the parent resource directory is named, false indicates an ID. 
- 
getDirectoryString
public ResourceDirectoryStringU getDirectoryString()
 
- 
getData
public ResourceDataEntry getData()
 
- 
getSubDirectory
public ResourceDirectory getSubDirectory()
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
getNameOffset
public int getNameOffset()
Returns the offset to the name of this resource.- Returns:
 - the offset to the name of this resource
 - See Also:
 getName()
 
- 
getNameIsString
public boolean getNameIsString()
Returns the ID of the name of this resource.- Returns:
 - the ID of the name of this resource
 - See Also:
 getName()
 
- 
getName
public int getName()
- Returns:
 - either an integer ID or a pointer to a structure that contains a string name
 
 
- 
getId
public int getId()
Returns a resource ID.- Returns:
 - a resource ID
 - See Also:
 getName()
 
- 
getOffsetToData
public int getOffsetToData()
- Returns:
 - either an offset to another resource directory or a pointer to information about a specific resource instance
 
 
- 
getOffsetToDirectory
public int getOffsetToDirectory()
Returns an offset to another resource directory.- Returns:
 - an offset to another resource directory
 - See Also:
 getOffsetToData()
 
- 
getDataIsDirectory
public boolean getDataIsDirectory()
Returns a pointer to information about a specific resource instance.- Returns:
 - a pointer to information about a specific resource instance
 - See Also:
 getOffsetToData()
 
- 
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
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 existsjava.io.IOException- See Also:
 StructureDataType
 
- 
isValid
public boolean isValid()
 
 - 
 
 -