I want to play with reverse engineering the Apple Neural Engine driver, which is a kernel extensions (com.apple.driver.AppleH11ANEInterface). These used to be in /System/Library/Extensions/, but on my M1 MacBook Pro with Sonoma (14.2.1) the Extensions directory doesn't include the binaries themselves, only metadata and resources.
Instead, all kext binaries are all bundled together in /System/Volumes/Preboot/<...>/System/Library/Caches/com.apple.kernelcaches/kernelcache, as verified by kmutil inspect -v --bundle-identifier com.apple.driver.AppleH11ANEInterface.
How can I extract the binaries out of kernelcache file? Specifically I'm looking for the AppleH11ANEInterface binary.
The kernelcache file seems to be a IMG4 format, but existing tools like pyimg4 are failing to extract it.
Thanks