Search code examples
cmacoskernel-extensionxnu

load kernel extension through C API?


Is it possible to load a kernel extension (kext) through a C API instead of using the system() call?


Solution

  • Yes, you want the KextManager API. In particular, KextManagerLoadKextWithIdentifier() is probably the function you'll want to use to load an installed kext, versus KextManagerLoadKextWithURL() if you want to load a kext that is not in /System/Library/Extensions or /Library/Extensions but e.g. in an .app bundle.