Package ghidra.app.util.bin.format.pe
Class ResourceDataDirectory
- java.lang.Object
-
- ghidra.app.util.bin.format.pe.DataDirectory
-
- ghidra.app.util.bin.format.pe.ResourceDataDirectory
-
- All Implemented Interfaces:
PeMarkupable
,StructConverter
public class ResourceDataDirectory extends DataDirectory
Points to the root resource directory.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.Integer>
directoryMap
static int
IMAGE_RESOURCE_DATA_IS_DIRECTORY
A flag indicating that a resources is a directory.static int
IMAGE_RESOURCE_NAME_IS_STRING
A flag indicating that a resources is a string.static int
IMAGE_SIZEOF_RESOURCE_DIRECTORY
The size of a resource directory, in bytes.static int
IMAGE_SIZEOF_RESOURCE_DIRECTORY_ENTRY
The size of a resource directory entry, in bytes.static java.lang.String[]
PREDEFINED_RESOURCE_NAMES
A lookup table to obtain a string name for a resource type.static byte
RT_ACCELERATOR
Accelerator table.static byte
RT_ANICURSOR
Animated cursor resource.static byte
RT_ANIICON
Animated icon resource.static byte
RT_BITMAP
Bitmap resource.static byte
RT_CURSOR
/** Hardware-dependent cursor resource.static byte
RT_DIALOG
Dialog box.static byte
RT_DLGINCLUDE
static byte
RT_FONT
Font resource.static byte
RT_FONTDIR
Font directory resource.static byte
RT_GROUP_CURSOR
Hardware-independent cursor resource.static byte
RT_GROUP_ICON
Hardware-independent icon resource.static byte
RT_HTML
HTML resource.static byte
RT_ICON
Hardware-dependent icon resource.static byte
RT_MANIFEST
Manifest resourcestatic byte
RT_MENU
Menu resource.static byte
RT_MESSAGETABLE
Message-table entry.static byte
RT_NOTDEFINED
Not defined in documentation but PNGs and WAVs are both this typestatic byte
RT_PLUGPLAY
Plug and Play resource.static byte
RT_RCDATA
Application-defined resource (raw data).static byte
RT_STRING
String-table entry.static byte
RT_VERSION
Version resource.static byte
RT_VXD
VXD resource.-
Fields inherited from class ghidra.app.util.bin.format.pe.DataDirectory
hasParsed, IMAGE_SIZEOF_IMAGE_DIRECTORY_ENTRY, ntHeader, reader, size, TITLE, virtualAddress
-
-
Constructor Summary
Constructors Constructor Description ResourceDataDirectory()
DO NOT USE THIS CONSTRUCTOR, USE create*(GenericFactory ...) FACTORY METHODS INSTEAD.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDirectoryName()
java.util.List<ResourceInfo>
getResources()
ResourceDirectory
getRootDirectory()
void
markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader)
Marks up a PE structure.boolean
parse()
Parses this data directory.DataType
toDataType()
This method should return a datatype representing the data stored in this directory.java.lang.String
toString()
-
Methods inherited from class ghidra.app.util.bin.format.pe.DataDirectory
createDirectoryBookmark, createFragment, createTerminatedString, getPointer, getSize, getVirtualAddress, hasParsedCorrectly, processDataDirectory, setBookmark, setEolComment, setPlateComment, setPreComment, setSize, setVirtualAddress, va, writeBytes
-
-
-
-
Field Detail
-
IMAGE_SIZEOF_RESOURCE_DIRECTORY_ENTRY
public static final int IMAGE_SIZEOF_RESOURCE_DIRECTORY_ENTRY
The size of a resource directory entry, in bytes.- See Also:
- Constant Field Values
-
IMAGE_SIZEOF_RESOURCE_DIRECTORY
public static final int IMAGE_SIZEOF_RESOURCE_DIRECTORY
The size of a resource directory, in bytes.- See Also:
- Constant Field Values
-
IMAGE_RESOURCE_NAME_IS_STRING
public static final int IMAGE_RESOURCE_NAME_IS_STRING
A flag indicating that a resources is a string.- See Also:
- Constant Field Values
-
IMAGE_RESOURCE_DATA_IS_DIRECTORY
public static final int IMAGE_RESOURCE_DATA_IS_DIRECTORY
A flag indicating that a resources is a directory.- See Also:
- Constant Field Values
-
PREDEFINED_RESOURCE_NAMES
public static final java.lang.String[] PREDEFINED_RESOURCE_NAMES
A lookup table to obtain a string name for a resource type.
-
RT_NOTDEFINED
public static final byte RT_NOTDEFINED
Not defined in documentation but PNGs and WAVs are both this type- See Also:
- Constant Field Values
-
RT_CURSOR
public static final byte RT_CURSOR
/** Hardware-dependent cursor resource.- See Also:
- Constant Field Values
-
RT_BITMAP
public static final byte RT_BITMAP
Bitmap resource.- See Also:
- Constant Field Values
-
RT_ICON
public static final byte RT_ICON
Hardware-dependent icon resource.- See Also:
- Constant Field Values
-
RT_MENU
public static final byte RT_MENU
Menu resource.- See Also:
- Constant Field Values
-
RT_DIALOG
public static final byte RT_DIALOG
Dialog box.- See Also:
- Constant Field Values
-
RT_STRING
public static final byte RT_STRING
String-table entry.- See Also:
- Constant Field Values
-
RT_FONTDIR
public static final byte RT_FONTDIR
Font directory resource.- See Also:
- Constant Field Values
-
RT_FONT
public static final byte RT_FONT
Font resource.- See Also:
- Constant Field Values
-
RT_ACCELERATOR
public static final byte RT_ACCELERATOR
Accelerator table.- See Also:
- Constant Field Values
-
RT_RCDATA
public static final byte RT_RCDATA
Application-defined resource (raw data).- See Also:
- Constant Field Values
-
RT_MESSAGETABLE
public static final byte RT_MESSAGETABLE
Message-table entry.- See Also:
- Constant Field Values
-
RT_GROUP_CURSOR
public static final byte RT_GROUP_CURSOR
Hardware-independent cursor resource.- See Also:
- Constant Field Values
-
RT_GROUP_ICON
public static final byte RT_GROUP_ICON
Hardware-independent icon resource.- See Also:
- Constant Field Values
-
RT_VERSION
public static final byte RT_VERSION
Version resource.- See Also:
- Constant Field Values
-
RT_DLGINCLUDE
public static final byte RT_DLGINCLUDE
- See Also:
- Constant Field Values
-
RT_PLUGPLAY
public static final byte RT_PLUGPLAY
Plug and Play resource.- See Also:
- Constant Field Values
-
RT_VXD
public static final byte RT_VXD
VXD resource.- See Also:
- Constant Field Values
-
RT_ANICURSOR
public static final byte RT_ANICURSOR
Animated cursor resource.- See Also:
- Constant Field Values
-
RT_ANIICON
public static final byte RT_ANIICON
Animated icon resource.- See Also:
- Constant Field Values
-
RT_HTML
public static final byte RT_HTML
HTML resource.- See Also:
- Constant Field Values
-
RT_MANIFEST
public static final byte RT_MANIFEST
Manifest resource- See Also:
- Constant Field Values
-
directoryMap
public static java.util.Set<java.lang.Integer> directoryMap
-
-
Method Detail
-
getRootDirectory
public ResourceDirectory getRootDirectory()
-
getDirectoryName
public java.lang.String getDirectoryName()
- Specified by:
getDirectoryName
in classDataDirectory
-
markup
public void markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader) throws DuplicateNameException, CodeUnitInsertionException, DataTypeConflictException, java.io.IOException
Description copied from interface:PeMarkupable
Marks up a PE structure.- 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
java.io.IOException
DataTypeConflictException
-
parse
public boolean parse() throws java.io.IOException
Description copied from class:DataDirectory
Parses this data directory.- Specified by:
parse
in classDataDirectory
- Returns:
- True if parsing completed successfully; otherwise, false.
- Throws:
java.io.IOException
- If there was an IO problem while parsing.
-
getResources
public java.util.List<ResourceInfo> getResources()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDataDirectory
- See Also:
Object.toString()
-
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
Description copied from class:DataDirectory
This method should return a datatype representing the data stored in this directory.- Specified by:
toDataType
in interfaceStructConverter
- Specified by:
toDataType
in classDataDirectory
- 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:
StructConverter.toDataType()
-
-