Dyld shared cache: Difference between revisions

From iPhone Development Wiki
(tiny copyedit)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:dyld_shared_cache}}
{{DISPLAYTITLE:dyld_shared_cache}}


Since iPhoneOS 3.1, all default (private and public) libraries have been combined into a big cache file in <tt>/System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv6</tt> (or <tt>_armv7</tt>) to improve performance. The original files are no longer useful for non-on-device-developers, so they are eliminated from the system.
Since iPhoneOS 3.1, all default (private and public) libraries have been combined into a big cache file in <tt>/System/Library/Caches/com.apple.dyld/dyld_shared_cache_armX</tt> (where X can be <tt>v6, v7, v7s</tt> or<tt> 64</tt>) to improve performance. The original files are no longer useful for non-on-device-developers, so they are eliminated from the system.


If you're looking for binaries or libraries inside of <tt>[http://theiphonewiki.com/wiki//System/Library/Frameworks /System/Library/Frameworks]</tt> or <tt>/System/Library/PrivateFrameworks</tt> and you can't find them, this is why.
If you're looking for binaries or libraries inside of <tt>[http://theiphonewiki.com/wiki//System/Library/Frameworks /System/Library/Frameworks]</tt> or <tt>/System/Library/PrivateFrameworks</tt> and you can't find them, this is why.

Revision as of 10:50, 1 December 2013


Since iPhoneOS 3.1, all default (private and public) libraries have been combined into a big cache file in /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armX (where X can be v6, v7, v7s or 64) to improve performance. The original files are no longer useful for non-on-device-developers, so they are eliminated from the system.

If you're looking for binaries or libraries inside of /System/Library/Frameworks or /System/Library/PrivateFrameworks and you can't find them, this is why.

Cache extraction

Developers who do not use the SDK cannot link programs on iOS directly due to the missing dylibs. You first need to extract the appropriate dylibs from the dyld_shared_cache.

Options:

  • You could use dyld_decache by KennyTM~ to extract these dylibs.
  • Alternatively, you could use DySlim by comex to mount the whole cache file on Mac OS X.
  • decache by phoenixdev also works quite well.

Cache retrieval

Since ASLR was implemented in iOS, trivial ways to pull the cache off the device have provided a "broken" cache, which can't be processed correctly by the aforementioned tools. This is because when read by processes in which ASLR is enabled, some offsetting is applied to the cache too. In order to circumvent this issue and pull a "valid" shared cache off the device, there are different options:

  • Copy the cache off the device using a program on which ASLR has been explicitly disabled, using the -mdynamic-no-pic compile flag.
  • Read the cache explicitly from the filesystem by setting the F_NOCACHE flag on the cache's file descriptor.
  • Copy the cache through AFC (filesystem browsers which use an AFC connection are fine).
  • Pull the cache off a decrypted root filesystem DMG which you can find inside the IPSW.

References

  • Cache or Check? — an analysis of the dyld_shared_cache system by D. Howett.