Jump to content

dyld cache extractor used by OCLP 


jalavoui
 Share

4 posts in this topic

Recommended Posts

Incomplete macOS 12+ dyld cache extractor. Used by OCLP to support some legacy GPUs and Wi-Fi hardware. 

 

https://github.com/moraea/dsce/tree/better-build

 

this can be used like this to extract extensions, etc

 

./dsce /System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64h /System/Library/Extensions

./dsce /System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64h /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine

 

the result will ber written to the "Out" folder

 

dsce.zip

Edited by jalavoui
Link to comment
Share on other sites

  • 6 months later...
Posted (edited)

 

 

 

usage:

./decompkernelcache /System/Library/KernelCollections/SystemKernelExtensions.kc x -kexts

 

for debugging only

 

this kexts from cache need a lot of corrections for external function calls

 

to get this function call zn11MetaClass

 

image.png.2f0a3a97727b96bbc8c17493407a4227.png

 

the code bytes from kext in cache need tobe "fixed" like this (in orange)

 

image.png.3df7f1efeee2df091c95386ae0fb2571.png

 

original bytes from cache are:

 

image.png.ea1f82d971017fc029b63082fd71d145.png

 

 

so the __got table is imported like this

image.thumb.png.bd05154a05e8812606f1850f812243e0.png

 

and need to fix it to look like this

image.thumb.png.1267963372e26e232768ce2881ff7d28.png

 

and finally patch the wrong calls in code...

 

currently the exported kexts can load in ida pro and ghidra

that was the initial goal

but they can't be used for anything else

 

currently the disasm will produce this for those functions

image.png.a66e1ac235ccb83af2a540522d454b63.png

 

this const refs also need tobe fixed

image.png.0740c9741d2844939986d27af0b75aa9.png

 

ida pro also looks for symbols in bootsystem.kc

image.thumb.png.b1a688007def41804358ef89c861039e.png

Edited by jalavoui
Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...