Package ghidra.app.util.bin.format.pe
Class BaseRelocationDataDirectory
- java.lang.Object
-
- ghidra.app.util.bin.format.pe.DataDirectory
-
- ghidra.app.util.bin.format.pe.BaseRelocationDataDirectory
-
- All Implemented Interfaces:
ByteArrayConverter
,PeMarkupable
,StructConverter
public class BaseRelocationDataDirectory extends DataDirectory implements ByteArrayConverter
Points to the base relocation information.
-
-
Field Summary
-
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 BaseRelocationDataDirectory()
DO NOT USE THIS CONSTRUCTOR, USE create*(GenericFactory ...) FACTORY METHODS INSTEAD.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBaseRelocation(BaseRelocation reloc)
Adds the specified base relocation.BaseRelocation
createBaseRelocation(int va)
Create a new base relocation using the specified virtual address.BaseRelocation[]
getBaseRelocations()
Returns the array of base relocations defined in this base relocation data directory.java.lang.String
getDirectoryName()
void
markup(Program program, boolean isBinary, TaskMonitor monitor, MessageLog log, NTHeader ntHeader)
Marks up a PE structure.boolean
parse()
Parses this data directory.void
removeAllRelocations()
Removes all base relocations from this base relocation directory.byte[]
toBytes(DataConverter dc)
Returns a byte array representing this implementor of this interface.DataType
toDataType()
This method should return a datatype representing the data stored in this directory.-
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, toString, va, writeBytes
-
-
-
-
Method Detail
-
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 CodeUnitInsertionException
Description copied from interface:PeMarkupable
Marks up a PE structure.- Specified by:
markup
in interfacePeMarkupable
- 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:
CodeUnitInsertionException
-
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.
-
getBaseRelocations
public BaseRelocation[] getBaseRelocations()
Returns the array of base relocations defined in this base relocation data directory.- Returns:
- the array of base relocations defined in this base relocation data directory
-
toDataType
public DataType toDataType() throws DuplicateNameException
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 exists- See Also:
StructConverter.toDataType()
-
removeAllRelocations
public void removeAllRelocations()
Removes all base relocations from this base relocation directory.
-
createBaseRelocation
public BaseRelocation createBaseRelocation(int va)
Create a new base relocation using the specified virtual address.- Parameters:
va
- the virtual address of the new base relocation- Returns:
- the new base relocation
-
addBaseRelocation
public void addBaseRelocation(BaseRelocation reloc)
Adds the specified base relocation.- Parameters:
reloc
- the new base relocation
-
toBytes
public byte[] toBytes(DataConverter dc)
Description copied from interface:ByteArrayConverter
Returns a byte array representing this implementor of this interface.- Specified by:
toBytes
in interfaceByteArrayConverter
- Parameters:
dc
- the data converter to use- Returns:
- a byte array representing this object
- See Also:
ByteArrayConverter.toBytes(ghidra.util.DataConverter)
-
-