Class DyldCacheHeader
java.lang.Object
ghidra.app.util.bin.format.macho.dyld.DyldCacheHeader
- All Implemented Interfaces:
StructConverter
Represents a dyld_cache_header structure.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the old accelerate info address or new address of mach header in dyld cache, ornullif it is not defined.longReturns the old accelerate info size or new address of entry point in dyld cache, ornullif it is not defined.intReturns the alt OS version.intReturns the alt platform.Gets architecture information.longReturns the base address of the DYLD cache.Gets theListof branch pool address.intReturns the branch pools count.intReturns the branch pools offset.booleanReturns the built from chained fixups value.longReturns the cache atlas offset.longReturns the cache atlas size.Gets theListofDyldCacheMappingAndSlideInfos.Returns the cache subtype, ornullif it is not defined.longReturns the cache type.longReturns the code signature offset.longReturns the code signature size.longReturns the dyld base address.intReturns the dyld info.booleanReturns the dylibs expected on disk value.longReturns the dylibs image array address.longReturns the dylibs image array size.longReturns the dylibs PrebuildLoaderSet set address.longReturns the dylibs PrebuildLoaderSet state array address (unused), ornullif it is not defined.longReturns the dylibs trie address.longReturns the dylibs trie size.longReturns the dynamic data max size.longReturns the dynamic data offset.intReturns the format version.longReturns the function variant info address.longReturns the function variant info size.Gets theListofDyldCacheImageInfos.intReturns the images count.intReturns the old images count.intReturns the images offset.intReturns the old images offset.longReturns the images text count.longReturns the images text offset.booleanReturns the locally built cache value.Gets theDyldCacheLocalSymbolsInfo.longReturns the local symbols offset.longReturns the local symbols size.byte[]getMagic()Returns the magic bytes, which contain version information.intReturns the mapping count.Gets theListofDyldCacheMappingInfos.intReturns the mapping offset.intReturns the mapping with slide count.intReturns the mapping with slide offset.longReturns the max slide.longReturns the ObjC opts offset.longReturns the ObjC opts size.intReturns the OS version.longReturns the other image array address.longReturns the other image array size.longReturns the other image group address (unused).longReturns the other image group size (unused).longReturns the other trie address.longReturns the other trie size.longReturns the patch info address.longReturns the patch info size.intReturns the platform.longReturns the pre-warming data offset.longReturns the pre-warming data size.longReturns the program launch closures address.longReturns the program launch closures size.longReturns the program launch closures trie address.longReturns the program launch closures trie size.longReturns the programs PrebuildLoaderSet set pool address, ornullif it is not defined.longReturns the programs PrebuildLoaderSet set pool size.longReturns the program trie address.intReturns the program trie size.Returns the reader associated with the header.longReturns the rosetta read-only address.longReturns the rosetta read-only size.longReturns the rosetta read-write address.longReturns the rosetta read-write size.longReturns the shared region size.longReturns the shared region start.booleanReturns the simulator value.longReturns the slide info offset.Gets theListofDyldCacheSlideInfoCommons.longReturns the slide info size.Returns the subcache array count, ornullif it is not defined.intReturns the subcache array offset.Gets theListofDyldSubcacheEntrys.longReturns the swift opts offset.longReturns the swift opts size.byte[]Returns the symbol file UUID, ornullif it is not defined.intReturns the tpro mappings count.intReturns the tpro mappings offset.byte[]getUUID()Returns the UUID, ornullif it is not defined.booleanChecks to see whether or not the old accelerate info fields are being usedbooleanChecks to see if any slide info existsbooleanChecks to see whether or not this is a subcachevoidmarkup(Program program, boolean markupLocalSymbols, AddressSpace space, TaskMonitor monitor, MessageLog log) Marks up thisDyldCacheHeaderwith data structures and comments.voidparseFromFile(boolean parseLocalSymbols, 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.voidparseLocalSymbolsInfo(boolean shouldParse, MessageLog log, TaskMonitor monitor) voidsetFileBlock(MemoryBlock block) Sets theMemoryBlockassociated with this header's FILE block.Returns a structure datatype representing the contents of the implementor of this interface.longGet the original unslid load address.
-
Constructor Details
-
DyldCacheHeader
Create a newDyldCacheHeader.- Parameters:
reader- ABinaryReaderpositioned at the start of a DYLD cache header- Throws:
IOException- if there was an IO-related problem creating the DYLD cache header
-
-
Method Details
-
parseFromFile
public void parseFromFile(boolean parseLocalSymbols, MessageLog log, TaskMonitor monitor) throws CancelledException Parses the structures referenced by thisDyldCacheHeaderfrom a file.- Parameters:
parseLocalSymbols- True if local symbols should be parsed; 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, boolean markupLocalSymbols, AddressSpace space, TaskMonitor monitor, MessageLog log) throws CancelledException Marks up thisDyldCacheHeaderwith data structures and comments.- Parameters:
program- TheProgramto mark upmarkupLocalSymbols- True if the local symbols should be marked up; otherwise, falsespace- TheProgram'sAddressSpacemonitor- A cancellable task monitorlog- The log- Throws:
CancelledException- if the user cancelled the operation
-
getMagic
public byte[] getMagic()Returns the magic bytes, which contain version information.- Returns:
- the magic bytes, which contain version information
-
getMappingOffset
public int getMappingOffset()Returns the mapping offset.- Returns:
- the mapping offset
-
getMappingCount
public int getMappingCount()Returns the mapping count.- Returns:
- the mapping count
-
getImagesOffsetOld
public int getImagesOffsetOld()Returns the old images offset.- Returns:
- the old images offset
-
getImagesCountOld
public int getImagesCountOld()Returns the old images count.- Returns:
- the old images count
-
getDyldBaseAddress
public long getDyldBaseAddress()Returns the dyld base address.- Returns:
- the dyld base address
-
getCodeSignatureOffset
public long getCodeSignatureOffset()Returns the code signature offset.- Returns:
- the code signature offset
-
getCodeSignatureSize
public long getCodeSignatureSize()Returns the code signature size.- Returns:
- the code signature size
-
getSlideInfoOffset
public long getSlideInfoOffset()Returns the slide info offset.- Returns:
- the slide info offset
-
getSlideInfoSize
public long getSlideInfoSize()Returns the slide info size.- Returns:
- the slide info size
-
getLocalSymbolsOffset
public long getLocalSymbolsOffset()Returns the local symbols offset.- Returns:
- the local symbols offset
-
getLocalSymbolsSize
public long getLocalSymbolsSize()Returns the local symbols size.- Returns:
- the local symbols size
-
getUUID
public byte[] getUUID()Returns the UUID, ornullif it is not defined.- Returns:
- the UUID, or
nullif it is not defined
-
getCacheType
public long getCacheType()Returns the cache type.- Returns:
- the cache type
-
getBranchPoolsOffset
public int getBranchPoolsOffset()Returns the branch pools offset.- Returns:
- the branch pools offset
-
getBranchPoolsCount
public int getBranchPoolsCount()Returns the branch pools count.- Returns:
- the branch pools count
-
getAccelerateInfoAddrOrDyldInCacheMH
public long getAccelerateInfoAddrOrDyldInCacheMH()Returns the old accelerate info address or new address of mach header in dyld cache, ornullif it is not defined.- Returns:
- the old accelerate info address or new address of mach header in dyld cache, or
nullif it is not defined
-
getAccelerateInfoSizeOrDyldInCacheEntry
public long getAccelerateInfoSizeOrDyldInCacheEntry()Returns the old accelerate info size or new address of entry point in dyld cache, ornullif it is not defined.- Returns:
- the old accelerate info size or new address of entry point in dyld cache, or
nullif it is not defined
-
getImagesTextOffset
public long getImagesTextOffset()Returns the images text offset.- Returns:
- the images text offset
-
getImagesTextCount
public long getImagesTextCount()Returns the images text count.- Returns:
- the images text count
-
getPatchInfoAddr
public long getPatchInfoAddr()Returns the patch info address.- Returns:
- the patch info address
-
getPatchInfoSize
public long getPatchInfoSize()Returns the patch info size.- Returns:
- the patch info size
-
getOtherImageGroupAddrUnused
public long getOtherImageGroupAddrUnused()Returns the other image group address (unused).- Returns:
- the other image group address (unused)
-
getOtherImageGroupSizeUnused
public long getOtherImageGroupSizeUnused()Returns the other image group size (unused).- Returns:
- the other image group size (unused)
-
getProgClosuresAddr
public long getProgClosuresAddr()Returns the program launch closures address.- Returns:
- the program launch closures address
-
getProgClosuresSize
public long getProgClosuresSize()Returns the program launch closures size.- Returns:
- the program launch closures size
-
getProgClosuresTrieAddr
public long getProgClosuresTrieAddr()Returns the program launch closures trie address.- Returns:
- the program launch closures trie address
-
getProgClosuresTrieSize
public long getProgClosuresTrieSize()Returns the program launch closures trie size.- Returns:
- the program launch closures trie size
-
getPlatform
public int getPlatform()Returns the platform.- Returns:
- the platform
-
getDyldInfo
public int getDyldInfo()Returns the dyld info.- Returns:
- the dyld info
-
getFormatVersion
public int getFormatVersion()Returns the format version.- Returns:
- the format version
-
getDylibsExpectedOnDisk
public boolean getDylibsExpectedOnDisk()Returns the dylibs expected on disk value.- Returns:
- the dylibs expected on disk value
-
getSimulator
public boolean getSimulator()Returns the simulator value.- Returns:
- the simulator value
-
getLocallyBuildCache
public boolean getLocallyBuildCache()Returns the locally built cache value.- Returns:
- the locally built cache value
-
getBuiltFromChainedFixups
public boolean getBuiltFromChainedFixups()Returns the built from chained fixups value.- Returns:
- the built from chained fixups value
-
getMaxSlide
public long getMaxSlide()Returns the max slide.- Returns:
- the max slide
-
getDylibsImageArrayAddr
public long getDylibsImageArrayAddr()Returns the dylibs image array address.- Returns:
- the dylibs image array address
-
getDylibsImageArraySize
public long getDylibsImageArraySize()Returns the dylibs image array size.- Returns:
- the dylibs image array size
-
getDylibsTriAddr
public long getDylibsTriAddr()Returns the dylibs trie address.- Returns:
- the dylibs trie address
-
getDylibsTrieSize
public long getDylibsTrieSize()Returns the dylibs trie size.- Returns:
- the dylibs trie size
-
getOtherImageArrayAddr
public long getOtherImageArrayAddr()Returns the other image array address.- Returns:
- the other image array address
-
getOtherImageArraySize
public long getOtherImageArraySize()Returns the other image array size.- Returns:
- the other image array size
-
getOtherTriAddr
public long getOtherTriAddr()Returns the other trie address.- Returns:
- the other trie address
-
getOtherTrieSize
public long getOtherTrieSize()Returns the other trie size.- Returns:
- the other trie size
-
getMappingWithSlideOffset
public int getMappingWithSlideOffset()Returns the mapping with slide offset.- Returns:
- the mapping with slide offset
-
getMappingWithSlideCount
public int getMappingWithSlideCount()Returns the mapping with slide count.- Returns:
- the mapping with slide count
-
getDylibsPBLStateArrayAddrUnused
public long getDylibsPBLStateArrayAddrUnused()Returns the dylibs PrebuildLoaderSet state array address (unused), ornullif it is not defined.- Returns:
- the dylibs PrebuildLoaderSet state array address (unused), or
nullif it is not defined
-
getDylibsPBLSetAddr
public long getDylibsPBLSetAddr()Returns the dylibs PrebuildLoaderSet set address.- Returns:
- the dylibs PrebuildLoaderSet set address
-
getProgramsPBLSetPoolAddr
public long getProgramsPBLSetPoolAddr()Returns the programs PrebuildLoaderSet set pool address, ornullif it is not defined.- Returns:
- the programs PrebuildLoaderSet set pool address, or
nullif it is not defined
-
getProgramsPBLSetPoolSize
public long getProgramsPBLSetPoolSize()Returns the programs PrebuildLoaderSet set pool size.- Returns:
- the programs PrebuildLoaderSet set pool size
-
getProgramTrieAddr
public long getProgramTrieAddr()Returns the program trie address.- Returns:
- the program trie address
-
getProgramTrieSize
public int getProgramTrieSize()Returns the program trie size.- Returns:
- the program trie size
-
getOsVersion
public int getOsVersion()Returns the OS version.- Returns:
- the OS version
-
getAltPlatform
public int getAltPlatform()Returns the alt platform.- Returns:
- the alt platform
-
getAltOsVersion
public int getAltOsVersion()Returns the alt OS version.- Returns:
- the alt OS version
-
getSwiftOptsOffset
public long getSwiftOptsOffset()Returns the swift opts offset.- Returns:
- the swift opts offset
-
getSwiftOptsSize
public long getSwiftOptsSize()Returns the swift opts size.- Returns:
- the swift opts size
-
getSubCacheArrayOffset
public int getSubCacheArrayOffset()Returns the subcache array offset.- Returns:
- the subcache array offset
-
getSubCacheArrayCount
Returns the subcache array count, ornullif it is not defined.- Returns:
- the subcache array count, or
nullif it is not defined
-
getSymbolFileUUID
public byte[] getSymbolFileUUID()Returns the symbol file UUID, ornullif it is not defined.- Returns:
- the symbol file UUID, or
nullif it is not defined
-
getRosettaReadOnlyAddr
public long getRosettaReadOnlyAddr()Returns the rosetta read-only address.- Returns:
- the rosetta read-only address
-
getRosettaReadOnlySize
public long getRosettaReadOnlySize()Returns the rosetta read-only size.- Returns:
- the rosetta read-only size
-
getRosettaReadWriteAddr
public long getRosettaReadWriteAddr()Returns the rosetta read-write address.- Returns:
- the rosetta read-write address
-
getRosettaReadWriteSize
public long getRosettaReadWriteSize()Returns the rosetta read-write size.- Returns:
- the rosetta read-write size
-
getImagesOffset
public int getImagesOffset()Returns the images offset.- Returns:
- the images offset
-
getImagesCount
public int getImagesCount()Returns the images count.- Returns:
- the images count
-
getCacheSubType
Returns the cache subtype, ornullif it is not defined.- Returns:
- the cache subtype, or
nullif it is not defined
-
getObjcOptsOffset
public long getObjcOptsOffset()Returns the ObjC opts offset.- Returns:
- the ObjC opts offset
-
getObjcOptsSize
public long getObjcOptsSize()Returns the ObjC opts size.- Returns:
- the ObjC opts size
-
getCacheAtlasOffset
public long getCacheAtlasOffset()Returns the cache atlas offset.- Returns:
- the cache atlas offset
-
getCacheAtlasSize
public long getCacheAtlasSize()Returns the cache atlas size.- Returns:
- the cache atlas size
-
getDynamicDataOffset
public long getDynamicDataOffset()Returns the dynamic data offset.- Returns:
- the dynamic data offset
-
getDynamicDataMaxSize
public long getDynamicDataMaxSize()Returns the dynamic data max size.- Returns:
- the dynamic data max size
-
getTproMappingsOffset
public int getTproMappingsOffset()Returns the tpro mappings offset.- Returns:
- the tpro mappings offset
-
getTproMappingsCount
public int getTproMappingsCount()Returns the tpro mappings count.- Returns:
- the tpro mappings count
-
getFunctionVariantInfoAddr
public long getFunctionVariantInfoAddr()Returns the function variant info address.- Returns:
- the function variant info address
-
getFunctionVariantInfoSize
public long getFunctionVariantInfoSize()Returns the function variant info size.- Returns:
- the function variant info size
-
getPreWarmingDataOffset
public long getPreWarmingDataOffset()Returns the pre-warming data offset.- Returns:
- the pre-warming data offset
-
getPreWarmingDataSize
public long getPreWarmingDataSize()Returns the pre-warming data size.- Returns:
- the pre-warming data size
-
getReader
Returns the reader associated with the header.- Returns:
- the reader associated with the header
-
getBaseAddress
public long getBaseAddress()Returns 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
-
getMappingInfos
Gets theListofDyldCacheMappingInfos. Requires header to have been parsed.- Returns:
- The
ListofDyldCacheMappingInfos
-
getImageInfos
Gets theListofDyldCacheImageInfos. Requires header to have been parsed.- Returns:
- The
ListofDyldCacheImageInfos
-
getSubcacheEntries
Gets theListofDyldSubcacheEntrys. Requires header to have been parsed.- Returns:
- The
ListofDyldSubcacheEntrys
-
getCacheMappingAndSlideInfos
Gets theListofDyldCacheMappingAndSlideInfos. Requires header to have been parsed.- Returns:
- The
ListofDyldCacheMappingAndSlideInfos
-
getLocalSymbolsInfo
Gets theDyldCacheLocalSymbolsInfo.- Returns:
- The
DyldCacheLocalSymbolsInfo. Could be null if it didn't parse.
-
getSlideInfos
Gets theListofDyldCacheSlideInfoCommons.- Returns:
- the
ListofDyldCacheSlideInfoCommons.
-
getBranchPoolAddresses
Gets theListof branch pool address. Requires header to have been parsed.- Returns:
- The
Listof branch pool address
-
getArchitecture
Gets architecture information.- Returns:
- architecture information
-
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:
-
parseLocalSymbolsInfo
public void parseLocalSymbolsInfo(boolean shouldParse, MessageLog log, TaskMonitor monitor) throws CancelledException - Throws:
CancelledException
-
setFileBlock
Sets theMemoryBlockassociated with this header's FILE block.- Parameters:
block- TheMemoryBlockassociated with this header's FILE block
-
hasSlideInfo
public boolean hasSlideInfo()Checks to see if any slide info exists- Returns:
- True if any slide info exists; otherwise, false
-
unslidLoadAddress
public long unslidLoadAddress()Get the original unslid load address. This is found in the first mapping infos.- Returns:
- the original unslid load address
-
isSubcache
public boolean isSubcache()Checks to see whether or not this is a subcache- Returns:
- True if this is a subcache; otherwise, false if it's a base cache
-
hasAccelerateInfo
public boolean hasAccelerateInfo()Checks to see whether or not the old accelerate info fields are being used- Returns:
- True if the old accelerate info fields are being used; otherwise, false if the new dyldInCache fields are being used
-