Class DyldCacheSlideInfoCommon
- java.lang.Object
-
- ghidra.app.util.bin.format.macho.dyld.DyldCacheSlideInfoCommon
-
- All Implemented Interfaces:
StructConverter
- Direct Known Subclasses:
DyldCacheSlideInfo1
,DyldCacheSlideInfo2
,DyldCacheSlideInfo3
,DyldCacheSlideInfo4
public abstract class DyldCacheSlideInfoCommon extends java.lang.Object implements StructConverter
Class for representing the common components of the various dyld_cache_slide_info structures. The intent is for the the full dyld_cache_slide_info structures to extend this and add their specific parts.- See Also:
- dyld3/shared-cache/dyld_cache_format.h
-
-
Field Summary
Fields Modifier and Type Field Description static int
BYTES_PER_CHAIN_OFFSET
static int
CHAIN_OFFSET_MASK
static int
DATA_PAGE_MAP_ENTRY
protected long
slideInfoOffset
protected int
version
-
Constructor Summary
Constructors Constructor Description DyldCacheSlideInfoCommon(BinaryReader reader)
Create a newDyldCacheSlideInfoCommon
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addRelocationTableEntry(Program program, Address chainLoc, int type, long chainValue, byte[] origBytes, java.lang.String name)
protected void
createChainPointers(Program program, java.util.List<Address> unchainedLocList, TaskMonitor monitor)
Create pointers at each fixed chain location.abstract void
fixPageChains(Program program, DyldCacheHeader dyldCacheHeader, boolean addRelocations, MessageLog log, TaskMonitor monitor)
long
getSlideInfoOffset()
Return the original slide info offsetint
getVersion()
Gets the version of the DYLD slide info.static DyldCacheSlideInfoCommon
parseSlideInfo(BinaryReader reader, long slideInfoOffset, MessageLog log, TaskMonitor monitor)
Parses the slide infoDataType
toDataType()
Returns a structure datatype representing the contents of the implementor of this interface.
-
-
-
Field Detail
-
DATA_PAGE_MAP_ENTRY
public static final int DATA_PAGE_MAP_ENTRY
- See Also:
- Constant Field Values
-
BYTES_PER_CHAIN_OFFSET
public static final int BYTES_PER_CHAIN_OFFSET
- See Also:
- Constant Field Values
-
CHAIN_OFFSET_MASK
public static final int CHAIN_OFFSET_MASK
- See Also:
- Constant Field Values
-
version
protected int version
-
slideInfoOffset
protected long slideInfoOffset
-
-
Constructor Detail
-
DyldCacheSlideInfoCommon
public DyldCacheSlideInfoCommon(BinaryReader reader) throws java.io.IOException
Create a newDyldCacheSlideInfoCommon
.- Parameters:
reader
- ABinaryReader
positioned at the start of a DYLD slide info- Throws:
java.io.IOException
- if there was an IO-related problem creating the DYLD slide info
-
-
Method Detail
-
parseSlideInfo
public static DyldCacheSlideInfoCommon parseSlideInfo(BinaryReader reader, long slideInfoOffset, MessageLog log, TaskMonitor monitor)
Parses the slide info- Parameters:
reader
- ABinaryReader
positioned at the start of a DYLD slide infoslideInfoOffset
- The offset of the slide info to parselog
- The logmonitor
- A cancelable task monitor- Returns:
- The slide info object
-
getVersion
public int getVersion()
Gets the version of the DYLD slide info.- Returns:
- The version of the DYLD slide info.
-
getSlideInfoOffset
public long getSlideInfoOffset()
Return the original slide info offset- Returns:
- the original slide info offset
-
fixPageChains
public abstract void fixPageChains(Program program, DyldCacheHeader dyldCacheHeader, boolean addRelocations, MessageLog log, TaskMonitor monitor) throws MemoryAccessException, CancelledException
-
addRelocationTableEntry
protected void addRelocationTableEntry(Program program, Address chainLoc, int type, long chainValue, byte[] origBytes, java.lang.String name) throws MemoryAccessException
- Throws:
MemoryAccessException
-
createChainPointers
protected void createChainPointers(Program program, java.util.List<Address> unchainedLocList, TaskMonitor monitor) throws CancelledException
Create pointers at each fixed chain location.- Parameters:
program
- The programunchainedLocList
- Address list of fixed pointer locationsmonitor
- A cancelable task monitor- Throws:
CancelledException
- if the user cancels
-
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
Description copied from interface:StructConverter
Returns 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:
toDataType
in interfaceStructConverter
- 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:
StructureDataType
-
-