A plugin for loading Mach-O kernelcache and dSYM files into Binary Ninja.
This plugin can load symbols and type information from multiple dSYM files contained in the KDK to the corresponding kernelcache opened in Binary Ninja. It will automatically handle sliding of symbol address, merging of duplicate types and renaming of different types with same name. It can also import function and data symbol names from Mach-O kernel extensions contained in the KDK to the corresponding kernelcache.
- Clone the Binary Ninja API repository along with its submodules
git clone --recursive https://github.com/Vector35/binaryninja-api.git- Set the environment variable
BN_API_PATHto the path of directory containing the cloned Binary Ninja API source code
export BN_API_PATH="$PWD/binaryninja-api"- If the Binary Ninja app is in a non-standard installation location (
/Applicationsfor macOS), set the environment variableBN_INSTALL_DIRto path of the Binary Ninja installation
export BN_INSTALL_DIR="<path-to-binary-ninja-application>"- If you are using the stable version of Binary Ninja app, checkout the
masterbranch of the Binary Ninja API repository
pushd "$BN_API_PATH"
git checkout master
popdbrew install llvm@15
- Clone the BinjaKC repository along with its submodules
git clone --recursive https://github.com/skr0x1c0/binja_kc- Use
cmaketo build the plugin
cd binja_kc
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j$(nproc) install_binja_kcIf everything goes well, the plugin will be installed on the plugins folder in the Binary Ninja user directory. You can verify this by opening the Binary Ninja application. The message [Core] Loaded native plugin binja_kc will be displayed on the log.
NOTE: The kernelcache should be a Mach-O file
- Place the kernelcache in a directory of your choice
mkdir kc
cd kc
cp /private/var/db/KernelExtensionManagement/KernelCollections/BootKernelCollection.kc ./kernelcache- Copy the respective KDK to the same directory with name
<name-of-kernel-cache>.symbols
cp -R /Library/Developer/KDKs/KDK_13.0_22A5331f.kdk ./kernelcache.symbols- Now you can directly open the kernelcache in Binary Ninja application. The symbols and type information from the KDK will be loaded automatically.
Place the dSYM file in the same directory as that of Mach-O binary with name <name-of-binary>.dSYM and open the binary as usual using Binary Ninja application. The symbols and type information will be automatically loaded.
This project is licensed under the MIT License - see the LICENSE file for details
