Class DebugDirectoryParser
java.lang.Object
ghidra.app.util.bin.format.pe.debug.DebugDirectoryParser
- All Implemented Interfaces:
OffsetValidator
A helper class to parsing different types of
debug information from a debug directory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteBorland debug type.static final byteCLS ID debug type.static final byteCodeView debug type.static final byteCOFF debug type.static final byteException debug type.static final byteFixup debug type.static final byteFPO debug type.static final byteMisc debug type.static final byteOMAP-From-Source debug type.static final byteOMAP-To-Source debug type.static final byteReserved debug type.static final byteUnknown debug type. -
Constructor Summary
ConstructorsConstructorDescriptionDebugDirectoryParser(BinaryReader reader, long ptr, int size, long sizeOfImage, int sectionAlignment, int fileAlignment) Constructs a new debug directory parser. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPointer(long ptr) Returns whether or not the specified pointer is contained within the PE file.booleancheckRVA(long rva) Returns whether or not the specified RVA value is contained within the PE image.Returns the CodeView debug information, or null if it does not exists.Returns the COFF debug information, or null if it does not exists.Returns the Fixup debug information, or null if it does not exists.Returns the miscellaneous debug information, or null if it does not exists.intReturns the PE's file alignment, or 0 if unknown/unused.intReturns the PE's sectionAlignment, or 0 if unknown/unused.
-
Field Details
-
IMAGE_DEBUG_TYPE_UNKNOWN
public static final byte IMAGE_DEBUG_TYPE_UNKNOWNUnknown debug type.- See Also:
-
IMAGE_DEBUG_TYPE_COFF
public static final byte IMAGE_DEBUG_TYPE_COFFCOFF debug type.- See Also:
-
IMAGE_DEBUG_TYPE_CODEVIEW
public static final byte IMAGE_DEBUG_TYPE_CODEVIEWCodeView debug type.- See Also:
-
IMAGE_DEBUG_TYPE_FPO
public static final byte IMAGE_DEBUG_TYPE_FPOFPO debug type.- See Also:
-
IMAGE_DEBUG_TYPE_MISC
public static final byte IMAGE_DEBUG_TYPE_MISCMisc debug type.- See Also:
-
IMAGE_DEBUG_TYPE_EXCEPTION
public static final byte IMAGE_DEBUG_TYPE_EXCEPTIONException debug type.- See Also:
-
IMAGE_DEBUG_TYPE_FIXUP
public static final byte IMAGE_DEBUG_TYPE_FIXUPFixup debug type.- See Also:
-
IMAGE_DEBUG_TYPE_OMAP_TO_SRC
public static final byte IMAGE_DEBUG_TYPE_OMAP_TO_SRCOMAP-To-Source debug type.- See Also:
-
IMAGE_DEBUG_TYPE_OMAP_FROM_SRC
public static final byte IMAGE_DEBUG_TYPE_OMAP_FROM_SRCOMAP-From-Source debug type.- See Also:
-
IMAGE_DEBUG_TYPE_BORLAND
public static final byte IMAGE_DEBUG_TYPE_BORLANDBorland debug type.- See Also:
-
IMAGE_DEBUG_TYPE_RESERVED10
public static final byte IMAGE_DEBUG_TYPE_RESERVED10Reserved debug type.- See Also:
-
IMAGE_DEBUG_TYPE_CLSID
public static final byte IMAGE_DEBUG_TYPE_CLSIDCLS ID debug type.- See Also:
-
-
Constructor Details
-
DebugDirectoryParser
public DebugDirectoryParser(BinaryReader reader, long ptr, int size, long sizeOfImage, int sectionAlignment, int fileAlignment) throws IOException Constructs a new debug directory parser.- Parameters:
reader- the binary readerptr- the pointer into the binary readersize- the size of the directorysizeOfImage- the size of the image in memorysectionAlignment- the section alignment (0 if unknown)fileAlignment- the file alignment (0 if unknown)- Throws:
IOException- if an I/O error occurs
-
-
Method Details
-
getDebugDirectories
-
getDebugMisc
Returns the miscellaneous debug information, or null if it does not exists.- Returns:
- the miscellaneous debug information
-
getDebugCodeView
Returns the CodeView debug information, or null if it does not exists.- Returns:
- the CodeView debug information
-
getDebugCOFFSymbolsHeader
Returns the COFF debug information, or null if it does not exists.- Returns:
- the COFF debug information
-
getDebugFixup
Returns the Fixup debug information, or null if it does not exists.- Returns:
- the Fixup debug information
-
checkPointer
public boolean checkPointer(long ptr) Description copied from interface:OffsetValidatorReturns whether or not the specified pointer is contained within the PE file.- Specified by:
checkPointerin interfaceOffsetValidator- Parameters:
ptr- the pointer value to check- Returns:
- whether or not the specified pointer is contained within the PE file
-
checkRVA
public boolean checkRVA(long rva) Description copied from interface:OffsetValidatorReturns whether or not the specified RVA value is contained within the PE image.- Specified by:
checkRVAin interfaceOffsetValidator- Parameters:
rva- the RVA to check- Returns:
- whether or not the specified RVA value is contained within the PE image
-
getFileAlignment
public int getFileAlignment()Description copied from interface:OffsetValidatorReturns the PE's file alignment, or 0 if unknown/unused.- Specified by:
getFileAlignmentin interfaceOffsetValidator- Returns:
- the PE's file alignment, or 0 if unknown/unused
-
getSectionAlignment
public int getSectionAlignment()Description copied from interface:OffsetValidatorReturns the PE's sectionAlignment, or 0 if unknown/unused.- Specified by:
getSectionAlignmentin interfaceOffsetValidator- Returns:
- the PE's sectionAlignment, or 0 if unknown/unused
-