Class DyldCacheHeader
- java.lang.Object
-
- ghidra.app.util.bin.format.macho.dyld.DyldCacheHeader
-
- All Implemented Interfaces:
StructConverter
public class DyldCacheHeader extends java.lang.Object implements StructConverter
Represents a dyld_cache_header structure.- See Also:
- launch-cache/dyld_cache_format.h
-
-
Constructor Summary
Constructors Constructor Description DyldCacheHeader(BinaryReader reader)Create a newDyldCacheHeader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DyldArchitecturegetArchitecture()Gets architecture information.longgetBaseAddress()Gets the base address of the DYLD cache.java.util.List<java.lang.Long>getBranchPoolAddresses()Gets theListof branch pool address.java.util.List<DyldCacheImageInfo>getImageInfos()Gets theListofDyldCacheImageInfos.intgetImagesCount()Gets the number ofDyldCacheImageInfos.intgetImagesOffset()Gets the file offset to firstDyldCacheImageInfo.DyldCacheLocalSymbolsInfogetLocalSymbolsInfo()Gets theDyldCacheLocalSymbolsInfo.byte[]getMagic()Gets the magic bytes, which contain version information.java.util.List<DyldCacheMappingInfo>getMappingInfos()Gets theListofDyldCacheMappingInfos.DyldCacheSlideInfoCommongetSlideInfo()Gets theDyldCacheSlideInfoCommon.longgetSlideInfoOffset()longgetSlideInfoSize()voidmarkup(Program program, AddressSpace space, TaskMonitor monitor, MessageLog log)Marks up thisDyldCacheHeaderwith data structures and comments.voidparseFromFile(boolean parseSymbols, MessageLog log, TaskMonitor monitor)Parses the structures referenced by thisDyldCacheHeaderfrom a file.voidparseFromMemory(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor)Parses the structures referenced by thisDyldCacheHeaderfrom memory.DataTypetoDataType()Returns a structure datatype representing the contents of the implementor of this interface.
-
-
-
Constructor Detail
-
DyldCacheHeader
public DyldCacheHeader(BinaryReader reader) throws java.io.IOException
Create a newDyldCacheHeader.- Parameters:
reader- ABinaryReaderpositioned at the start of a DYLD cache header- Throws:
java.io.IOException- if there was an IO-related problem creating the DYLD cache header
-
-
Method Detail
-
parseFromFile
public void parseFromFile(boolean parseSymbols, MessageLog log, TaskMonitor monitor) throws CancelledExceptionParses the structures referenced by thisDyldCacheHeaderfrom a file.- Parameters:
parseSymbols- True if symbols should be parsed (could be very slow); otherwise, falselog- The logmonitor- A cancellable task monitor- Throws:
CancelledException- if the user cancelled the operation
-
parseFromMemory
public void parseFromMemory(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor) throws CancelledException
Parses the structures referenced by thisDyldCacheHeaderfrom memory.- Parameters:
program- TheProgramwhose memory to parsespace- TheProgram'sAddressSpacelog- The logmonitor- A cancellable task monitor- Throws:
CancelledException- if the user cancelled the operation
-
markup
public void markup(Program program, AddressSpace space, TaskMonitor monitor, MessageLog log) throws CancelledException
Marks up thisDyldCacheHeaderwith data structures and comments.- Parameters:
program- TheProgramto mark upspace- TheProgram'sAddressSpacemonitor- A cancellable task monitorlog- The log- Throws:
CancelledException- if the user cancelled the operation
-
getBaseAddress
public long getBaseAddress()
Gets the base address of the DYLD cache. This is where the cache should be loaded in memory.- Returns:
- The base address of the DYLD cache
-
getMagic
public byte[] getMagic()
Gets the magic bytes, which contain version information.- Returns:
- The magic bytes
-
getMappingInfos
public java.util.List<DyldCacheMappingInfo> getMappingInfos()
Gets theListofDyldCacheMappingInfos. Requires header to have been parsed.- Returns:
- The
ListofDyldCacheMappingInfos
-
getImagesOffset
public int getImagesOffset()
Gets the file offset to firstDyldCacheImageInfo.- Returns:
- The file offset to first
DyldCacheImageInfo
-
getImagesCount
public int getImagesCount()
Gets the number ofDyldCacheImageInfos.- Returns:
- The number of
DyldCacheImageInfos
-
getImageInfos
public java.util.List<DyldCacheImageInfo> getImageInfos()
Gets theListofDyldCacheImageInfos. Requires header to have been parsed.- Returns:
- The
ListofDyldCacheImageInfos
-
getLocalSymbolsInfo
public DyldCacheLocalSymbolsInfo getLocalSymbolsInfo()
Gets theDyldCacheLocalSymbolsInfo.- Returns:
- The
DyldCacheLocalSymbolsInfo. Could be be null if it didn't parse.
-
getSlideInfo
public DyldCacheSlideInfoCommon getSlideInfo()
Gets theDyldCacheSlideInfoCommon.- Returns:
- the
DyldCacheSlideInfoCommon. Common, or particular version
-
getSlideInfoOffset
public long getSlideInfoOffset()
- Returns:
- slideInfoOffset
-
getSlideInfoSize
public long getSlideInfoSize()
- Returns:
- slideInfoSize
-
getBranchPoolAddresses
public java.util.List<java.lang.Long> getBranchPoolAddresses()
Gets theListof branch pool address. Requires header to have been parsed.- Returns:
- The
Listof branch pool address
-
getArchitecture
public DyldArchitecture getArchitecture()
Gets architecture information.- Returns:
- architecture information
-
toDataType
public DataType toDataType() throws DuplicateNameException, java.io.IOException
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 existsjava.io.IOException- See Also:
StructureDataType
-
-