Package ghidra.app.util.opinion
Class DyldCacheUtils.SplitDyldCache
java.lang.Object
ghidra.app.util.opinion.DyldCacheUtils.SplitDyldCache
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
DyldCacheUtils
Class to store a "split" DYLD Cache, which is split across several subcache files (base file,
.1, .2, .symbols, etc).
-
Constructor Summary
ConstructorsConstructorDescriptionSplitDyldCache(ByteProvider baseProvider, boolean shouldProcessLocalSymbols, MessageLog log, TaskMonitor monitor) Creates a newDyldCacheUtils.SplitDyldCacheSplitDyldCache(List<ByteProvider> providers, List<DyldCacheHeader> headers, List<String> names, MessageLog log, TaskMonitor monitor) Creates a newDyldCacheUtils.SplitDyldCache -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longGets the base address of the split DYLD cache.getDyldCacheHeader(int i) Gets the i'thDyldCacheHeaderin the split DYLD CacheGets all theDyldCacheUtils.DyldCacheImageRecords from the entire cacheGets theDyldCacheLocalSymbolsInfofrom the split DYLD Cache filesgetMacho(DyldCacheUtils.DyldCacheImageRecord imageRecord) Gets the Mach-O of the givenDyldCacheUtils.DyldCacheImageRecord.getName(int i) Gets the i'thnamein the split DYLD CachegetProvider(int i) Gets the i'thByteProviderin the split DYLD Cacheintsize()Gets the number of split DYLD Cache files
-
Constructor Details
-
SplitDyldCache
public SplitDyldCache(ByteProvider baseProvider, boolean shouldProcessLocalSymbols, MessageLog log, TaskMonitor monitor) throws IOException, CancelledException Creates a newDyldCacheUtils.SplitDyldCache- Parameters:
baseProvider- TheByteProviderof the "base" DYLD Cache fileshouldProcessLocalSymbols- True if local symbols should be processed; otherwise, falselog- The logmonitor- A cancelable task monitor- Throws:
IOException- If there was an IO-related issue with processing the split DYLD CacheCancelledException- If the user canceled the operation
-
SplitDyldCache
public SplitDyldCache(List<ByteProvider> providers, List<DyldCacheHeader> headers, List<String> names, MessageLog log, TaskMonitor monitor) Creates a newDyldCacheUtils.SplitDyldCache- Parameters:
providers- The cache's orderedByteProvidersheaders- The cache's orderedDyldCacheHeadersnames- The cache's ordered nameslog- The logmonitor- A cancelable task monitor
-
-
Method Details
-
getProvider
Gets the i'thByteProviderin the split DYLD Cache- Parameters:
i- The index of theByteProviderto get- Returns:
- The i'th
ByteProviderin the split DYLD Cache
-
getDyldCacheHeader
Gets the i'thDyldCacheHeaderin the split DYLD Cache- Parameters:
i- The index of theDyldCacheHeaderto get- Returns:
- The i'th
DyldCacheHeaderin the split DYLD Cache
-
getName
Gets the i'thnamein the split DYLD Cache -
size
public int size()Gets the number of split DYLD Cache files- Returns:
- The number of split DYLD Cache files
-
getBaseAddress
public long getBaseAddress()Gets the base address of the split DYLD cache. This is where the cache should be loaded in memory.- Returns:
- The base address of the split DYLD cache
-
getLocalSymbolInfo
Gets theDyldCacheLocalSymbolsInfofrom the split DYLD Cache files- Returns:
- The
DyldCacheLocalSymbolsInfofrom the split DYLD Cache files, or null if no local symbols are defined
-
getImageRecords
Gets all theDyldCacheUtils.DyldCacheImageRecords from the entire cache- Returns:
- A
ListofDyldCacheUtils.DyldCacheImageRecords from the entire cache
-
getMacho
public MachHeader getMacho(DyldCacheUtils.DyldCacheImageRecord imageRecord) throws MachException, IOException Gets the Mach-O of the givenDyldCacheUtils.DyldCacheImageRecord.NOTE: The returned Mach-O is not yet
parsed.- Parameters:
imageRecord- The desired Mach-O'sDyldCacheUtils.DyldCacheImageRecord- Returns:
- The
DyldCacheUtils.DyldCacheImageRecord's Mach-O - Throws:
MachException- If there was a problem creating theMachHeaderIOException- If there was an IO-related error
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-