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>directoryMapstatic intIMAGE_RESOURCE_DATA_IS_DIRECTORYA flag indicating that a resources is a directory.static intIMAGE_RESOURCE_NAME_IS_STRINGA flag indicating that a resources is a string.static intIMAGE_SIZEOF_RESOURCE_DIRECTORYThe size of a resource directory, in bytes.static intIMAGE_SIZEOF_RESOURCE_DIRECTORY_ENTRYThe size of a resource directory entry, in bytes.static java.lang.String[]PREDEFINED_RESOURCE_NAMESA lookup table to obtain a string name for a resource type.static byteRT_ACCELERATORAccelerator table.static byteRT_ANICURSORAnimated cursor resource.static byteRT_ANIICONAnimated icon resource.static byteRT_BITMAPBitmap resource.static byteRT_CURSOR/** Hardware-dependent cursor resource.static byteRT_DIALOGDialog box.static byteRT_DLGINCLUDEstatic byteRT_FONTFont resource.static byteRT_FONTDIRFont directory resource.static byteRT_GROUP_CURSORHardware-independent cursor resource.static byteRT_GROUP_ICONHardware-independent icon resource.static byteRT_HTMLHTML resource.static byteRT_ICONHardware-dependent icon resource.static byteRT_MANIFESTManifest resourcestatic byteRT_MENUMenu resource.static byteRT_MESSAGETABLEMessage-table entry.static byteRT_NOTDEFINEDNot defined in documentation but PNGs and WAVs are both this typestatic byteRT_PLUGPLAYPlug and Play resource.static byteRT_RCDATAApplication-defined resource (raw data).static byteRT_STRINGString-table entry.static byteRT_VERSIONVersion resource.static byteRT_VXDVXD 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.StringgetDirectoryName()java.util.List<ResourceInfo>getResources()ResourceDirectorygetRootDirectory()voidmarkup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader)Marks up a PE structure.booleanparse()Parses this data directory.DataTypetoDataType()This method should return a datatype representing the data stored in this directory.java.lang.StringtoString()-
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:
getDirectoryNamein 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:PeMarkupableMarks 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:
DuplicateNameExceptionCodeUnitInsertionExceptionjava.io.IOExceptionDataTypeConflictException
-
parse
public boolean parse() throws java.io.IOExceptionDescription copied from class:DataDirectoryParses this data directory.- Specified by:
parsein 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:
toStringin classDataDirectory- See Also:
Object.toString()
-
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
Description copied from class:DataDirectoryThis method should return a datatype representing the data stored in this directory.- Specified by:
toDataTypein interfaceStructConverter- Specified by:
toDataTypein 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()
-
-