Class DyldCacheSlideInfoCommon
java.lang.Object
ghidra.app.util.bin.format.macho.dyld.DyldCacheSlideInfoCommon
- All Implemented Interfaces:
StructConverter
- Direct Known Subclasses:
DyldCacheSlideInfo1,DyldCacheSlideInfo2,DyldCacheSlideInfo3,DyldCacheSlideInfo4,DyldCacheSlideInfo5
Class for representing the common components of the various dyld_cache_slide_info structures.
The intent is for the full dyld_cache_slide_info structures to extend this and add their
specific parts.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intprotected DyldCacheMappingInfoprotected longprotected int -
Constructor Summary
ConstructorsConstructorDescriptionDyldCacheSlideInfoCommon(BinaryReader reader, DyldCacheMappingInfo mappingInfo) Create a newDyldCacheSlideInfoCommon. -
Method Summary
Modifier and TypeMethodDescriptionvoidfixupSlidePointers(Program program, boolean markup, boolean addRelocations, MessageLog log, TaskMonitor monitor) Fixes up the program's slide pointersReturns The base address of where the slide fixups will take place.getSlideFixups(BinaryReader reader, int pointerSize, MessageLog log, TaskMonitor monitor) longReturns The original slide info offset.intReturns The version of the DYLD slide info.static DyldCacheSlideInfoCommonparseSlideInfo(BinaryReader reader, long slideInfoOffset, DyldCacheMappingInfo mappingInfo, MessageLog log, TaskMonitor monitor) Parses the slide infoReturns a structure datatype representing the contents of the implementor of this interface.
-
Field Details
-
DATA_PAGE_MAP_ENTRY
public static final int DATA_PAGE_MAP_ENTRY- See Also:
-
BYTES_PER_CHAIN_OFFSET
public static final int BYTES_PER_CHAIN_OFFSET- See Also:
-
CHAIN_OFFSET_MASK
public static final int CHAIN_OFFSET_MASK- See Also:
-
version
protected int version -
slideInfoOffset
protected long slideInfoOffset -
mappingInfo
-
-
Constructor Details
-
DyldCacheSlideInfoCommon
public DyldCacheSlideInfoCommon(BinaryReader reader, DyldCacheMappingInfo mappingInfo) throws IOException Create a newDyldCacheSlideInfoCommon.- Parameters:
reader- ABinaryReaderpositioned at the start of a DYLD slide infomappingInfo- TheDyldCacheMappingInfoof where the slide fixups will take place- Throws:
IOException- if there was an IO-related problem creating the DYLD slide info
-
-
Method Details
-
parseSlideInfo
public static DyldCacheSlideInfoCommon parseSlideInfo(BinaryReader reader, long slideInfoOffset, DyldCacheMappingInfo mappingInfo, MessageLog log, TaskMonitor monitor) Parses the slide info- Parameters:
reader- ABinaryReaderpositioned at the start of a DYLD slide infoslideInfoOffset- The offset of the slide info to parsemappingInfo- TheDyldCacheMappingInfoof where the slide fixups will take placelog- The logmonitor- A cancelable task monitor- Returns:
- The slide info object
-
getVersion
public int getVersion()Returns The version of the DYLD slide info.- Returns:
- The version of the DYLD slide info
-
getSlideInfoOffset
public long getSlideInfoOffset()Returns The original slide info offset.- Returns:
- The original slide info offset
-
getMappingInfo
Returns The base address of where the slide fixups will take place.- Returns:
- The base address of where the slide fixups will take place
-
getSlideFixups
public abstract List<DyldFixup> getSlideFixups(BinaryReader reader, int pointerSize, MessageLog log, TaskMonitor monitor) throws IOException, CancelledException Walks the slide fixup information and collects aListofDyldFixups that will need to be applied to the image- Parameters:
reader- ABinaryReaderpositioned at the start of the segment to fix uppointerSize- The size of a pointer in byteslog- The logmonitor- A cancellable monitor- Returns:
- A
ListofDyldFixups - Throws:
IOException- If there was an IO-related issueCancelledException- If the user cancelled the operation
-
fixupSlidePointers
public void fixupSlidePointers(Program program, boolean markup, boolean addRelocations, MessageLog log, TaskMonitor monitor) throws MemoryAccessException, CancelledException Fixes up the program's slide pointers- Parameters:
program- TheProgrammarkup- True if the slide pointers should be marked up; otherwise, falseaddRelocations- True if slide pointer locations should be added to the relocation table; otherwise, falselog- The logmonitor- A cancellable monitor- Throws:
MemoryAccessException- If there was a problem accessing memoryCancelledException- If the user cancelled the operation
-
toDataType
Description copied from interface:StructConverterReturns 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:
toDataTypein 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:
-