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 DyldArchitecture
getArchitecture()
Gets architecture information.long
getBaseAddress()
Gets the base address of the DYLD cache.java.util.List<java.lang.Long>
getBranchPoolAddresses()
Gets theList
of branch pool address.java.util.List<DyldCacheImageInfo>
getImageInfos()
Gets theList
ofDyldCacheImageInfo
s.int
getImagesCount()
Gets the number ofDyldCacheImageInfo
s.int
getImagesOffset()
Gets the file offset to firstDyldCacheImageInfo
.DyldCacheLocalSymbolsInfo
getLocalSymbolsInfo()
Gets theDyldCacheLocalSymbolsInfo
.byte[]
getMagic()
Gets the magic bytes, which contain version information.java.util.List<DyldCacheMappingInfo>
getMappingInfos()
Gets theList
ofDyldCacheMappingInfo
s.DyldCacheSlideInfoCommon
getSlideInfo()
Gets theDyldCacheSlideInfoCommon
.long
getSlideInfoOffset()
long
getSlideInfoSize()
void
markup(Program program, AddressSpace space, TaskMonitor monitor, MessageLog log)
Marks up thisDyldCacheHeader
with data structures and comments.void
parseFromFile(boolean parseSymbols, MessageLog log, TaskMonitor monitor)
Parses the structures referenced by thisDyldCacheHeader
from a file.void
parseFromMemory(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor)
Parses the structures referenced by thisDyldCacheHeader
from memory.DataType
toDataType()
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
- ABinaryReader
positioned 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 CancelledException
Parses the structures referenced by thisDyldCacheHeader
from 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 thisDyldCacheHeader
from memory.- Parameters:
program
- TheProgram
whose memory to parsespace
- TheProgram
'sAddressSpace
log
- 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 thisDyldCacheHeader
with data structures and comments.- Parameters:
program
- TheProgram
to mark upspace
- TheProgram
'sAddressSpace
monitor
- 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 theList
ofDyldCacheMappingInfo
s. Requires header to have been parsed.- Returns:
- The
List
ofDyldCacheMappingInfo
s
-
getImagesOffset
public int getImagesOffset()
Gets the file offset to firstDyldCacheImageInfo
.- Returns:
- The file offset to first
DyldCacheImageInfo
-
getImagesCount
public int getImagesCount()
Gets the number ofDyldCacheImageInfo
s.- Returns:
- The number of
DyldCacheImageInfo
s
-
getImageInfos
public java.util.List<DyldCacheImageInfo> getImageInfos()
Gets theList
ofDyldCacheImageInfo
s. Requires header to have been parsed.- Returns:
- The
List
ofDyldCacheImageInfo
s
-
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 theList
of branch pool address. Requires header to have been parsed.- Returns:
- The
List
of 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: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
-
-