Class ResourceDirectoryEntry
java.lang.Object
ghidra.app.util.bin.format.pe.resource.ResourceDirectoryEntry
- All Implemented Interfaces:
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; }; }; };
-
Field Summary
-
Constructor Summary
ConstructorDescriptionResourceDirectoryEntry
(BinaryReader reader, int index, int resourceBase, boolean isNameEntry, boolean isFirstLevel, NTHeader ntHeader) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetData()
boolean
Returns a pointer to information about a specific resource instance.int
getId()
Returns a resource ID.int
getName()
boolean
Returns the ID of the name of this resource.int
Returns the offset to the name of this resource.int
int
Returns an offset to another resource directory.getResources
(int level) boolean
Returns true if the parent resource directory is named, false indicates an ID.boolean
isValid()
Returns a structure datatype representing the contents of the implementor of this interface.toString()
-
Field Details
-
SIZEOF
public static final int SIZEOF- See Also:
-
-
Constructor Details
-
ResourceDirectoryEntry
public ResourceDirectoryEntry(BinaryReader reader, int index, int resourceBase, boolean isNameEntry, boolean isFirstLevel, NTHeader ntHeader) throws IOException Constructor.- Parameters:
reader
- the binary readerindex
- the index where this directory begins- Throws:
IOException
-
-
Method Details
-
getResources
-
isNameEntry
public boolean isNameEntry()Returns true if the parent resource directory is named, false indicates an ID. -
getDirectoryString
-
getData
-
getSubDirectory
-
toString
-
getNameOffset
public int getNameOffset()Returns the offset to the name of this resource.- Returns:
- the offset to the name of this resource
- See Also:
-
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
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:
-
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:
-
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:
-
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:
-
isValid
public boolean isValid()
-