[
  {
    "path": ".github/workflows/main.yml",
    "content": "name: CI\n\non:\n  push:\n  pull_request:\n  workflow_dispatch:\n  release:\n    types: [published]\n\nenv:\n  PROJECT_TYPE: KEXT\n\njobs:\n  build:\n    name: Build\n    runs-on: macos-latest\n    env:\n      JOB_TYPE: BUILD\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/checkout@v4\n        with:\n          repository: acidanthera/MacKernelSDK\n          path: MacKernelSDK\n      - name: CI Bootstrap\n        run: |\n          src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/ocbuild/master/ci-bootstrap.sh) && eval \"$src\" || exit 1\n\n      - run: xcodebuild -jobs 1 -configuration Debug\n      - run: xcodebuild -jobs 1 -configuration Release\n\n      - name: Upload to Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: Artifacts\n          path: build/*/*.zip\n      - name: Upload to Release\n        if: github.event_name == 'release'\n        uses: svenstaro/upload-release-action@v2\n        with:\n          repo_token: ${{ secrets.GITHUB_TOKEN }}\n          file: build/*/*.zip\n          tag: ${{ github.ref }}\n          file_glob: true\n"
  },
  {
    "path": ".gitignore",
    "content": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## User settings\nxcuserdata/\n\n## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)\n*.xcscmblueprint\n*.xccheckout\n\n## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)\nbuild/\nDerivedData/\n*.moved-aside\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\n\n## Gcc Patch\n/*.gcno\n\n# General\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Icon must end with two \\r\nIcon\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n.com.apple.timemachine.donotpresent\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\nLilu.kext\nMacKernelSDK/"
  },
  {
    "path": "README.md",
    "content": "# USBToolBoxᵇᵉᵗᵃ\n\n*Making USB mapping simple(r)*\n\nThe USBToolBox kext is a kext intended to make common actions for USB mapping easier. It supports El Capitan and up, although only Catalina and up have been tested.\n\n## Features\n\n* Attach to the controller instance or parent device, allowing for more ways to match\n* Ignore port definitions from ACPI to force macOS to enumerate all ports manually\n  * Bypasses borked ACPI as seen on some Ryzen motherboards and 400 series Intel motherboards\n  * Replaces SSDT-RHUB\n* Override any built-in Apple USB maps attaching based on SMBIOS and controller name\n  * Removes the need for controller renames in ACPI patches\n* Does not require model identifier specified in USB map (if attaching to PCI device)\n* Very compatible with existing USB maps (port format is the same)\n* Does not hardcode any port maps, unlike USBInjectAll\n\nThis does **not** patch the port limit.\n\n## Configuration\n\nUSBToolBox supports configuration using boot arguments, properties, or in the map. You can set the properties on either the PCI device or the `AppleUSBHostController` instance.\n\nProperties can be any type and only existence, not type, is checked, unless otherwise specified.\n\n* `-utboff` (property `utb-off`): Disable USBToolBox completely\n\n* `-utbacpioff` (property `utb-acpi-off`): Disable RHUB removal from ACPI plane (borked ACPI removal)\n\n* `-utbappleoff` (property `utb-apple-off`): Disable existing `ports` and `port-count` removal\n\n* `-utbmapoff` (property `utb-map-off`): Disable custom map (useful for testing)\n\n* `utbwait=XXX` (property `utb-wait`, type number): Custom delay for `waitForMatchingService`, in seconds. Integer between 1-180, inclusive.\n\n## Converting Existing Maps\n\nConverting existing maps is fairly easy.\n\n* For each IOKit personality, change the following:\n  * `CFBundleIdentifier` to `com.dhinakg.USBToolBox.kext`\n  * `IOClass` to `USBToolBox`\n  * `IOMatchCategory` to `USBToolBox`\n* Add a dictionary named `OSBundleLibraries` to the root item. It should contain `com.dhinakg.USBToolBox.kext`, with value `1.0.0`.\n\n## Usage\n\nYou can get the latest release from the GitHub [releases tab](https://github.com/USBToolBox/kext/releases).\n\nThe zip contains 2 kexts: the main `USBToolBox.kext`, and `UTBDefault.kext`, a codeless kext used for attaching USBToolBox to all PCIe USB controllers. This is designed for use before you map, so that you can have all USB ports working (assuming no port limit) before you map. However, it is not needed and must be removed if you choose to map from the start (ie. from Windows, using the USBToolBox [tool](https://github.com/USBToolBox/tool)).\n\nA basic fresh install flow would be as follows:\n\n1. Add `USBToolBox.kext` and `UTBDefault.kext` to your `EFI/OC/Kexts` folder, and make sure to update your `config.plist`.\n2. Install macOS.\n3. Map your ports with the USBToolBox [tool](https://github.com/USBToolBox/tool).\n4. Remove `UTBDefault.kext` and add your newly created `UTBMap.kext` (or whatever your USB map is called) to `EFI/OC/Kexts`.\n5. Reboot and you should have a USB mapped system!\n\n## Credits\n\n@RehabMan for [USBInjectAll](https://github.com/RehabMan/USBInjectAll), an inspiration for this project\n\n@acidanthera for [MacKernelSDK](https://github.com/acidanthera/MacKernelSDK)\n\nMy testing team (you know who you are) for testing\n"
  },
  {
    "path": "Resources/UTBDefault.kext/Contents/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleGetInfoString</key>\n\t<string>v1.0</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.dhinakg.USBToolBox.injector</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>UTBMap</string>\n\t<key>CFBundlePackageType</key>\n\t<string>KEXT</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>IOKitPersonalities</key>\n\t<dict>\n\t\t<key>XHC1</key>\n\t\t<dict>\n\t\t\t<key>CFBundleIdentifier</key>\n\t\t\t<string>com.dhinakg.USBToolBox.kext</string>\n\t\t\t<key>IOClass</key>\n\t\t\t<string>USBToolBox</string>\n\t\t\t<key>IOMatchCategory</key>\n\t\t\t<string>USBToolBox</string>\n\t\t\t<key>IOPCIClassMatch</key>\n\t\t\t<string>0x0c030000&amp;0xffff0000</string>\n\t\t\t<key>IOProviderClass</key>\n\t\t\t<string>IOPCIDevice</string>\n\t\t</dict>\n\t</dict>\n\t<key>OSBundleLibraries</key>\n\t<dict>\n\t\t<key>com.dhinakg.USBToolBox.kext</key>\n\t\t<string>1.0.0</string>\n\t</dict>\n\t<key>OSBundleRequired</key>\n\t<string>Root</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "USBToolBox/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>${MARKETING_VERSION}</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>IOKitPersonalities</key>\n\t<dict/>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2020-2021 Dhinak G. All rights reserved.</string>\n\t<key>OSBundleCompatibleVersion</key>\n\t<string>1.0.0</string>\n\t<key>OSBundleLibraries</key>\n\t<dict>\n\t\t<key>com.apple.driver.AppleUSBHostMergeProperties</key>\n\t\t<string>1.0</string>\n\t\t<key>com.apple.iokit.IOPCIFamily</key>\n\t\t<string>2.9</string>\n\t\t<key>com.apple.kpi.iokit</key>\n\t\t<string>15.0.0</string>\n\t\t<key>com.apple.kpi.libkern</key>\n\t\t<string>15.0.0</string>\n\t</dict>\n\t<key>OSBundleRequired</key>\n\t<string>Root</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "USBToolBox/USBToolBox.cpp",
    "content": "//\n//  USBToolBox.cpp\n//  USBToolBox\n//\n//  Created by Dhinak G on 6/1/20.\n//  Copyright © 2020-2021 Dhinak G. All rights reserved.\n//\n\n#include <IOKit/IOLib.h>\n#include <IOKit/IOKitKeys.h>\n#include <libkern/version.h>\n#include <IOKit/IOPlatformExpert.h>\n#include <IOKit/IODeviceTreeSupport.h>\n#include <libkern/c++/OSMetaClass.h>\n\n#include \"USBToolBox.hpp\"\n\n#define checkProperty(a) (this->pciDevice && this->pciDevice->getProperty(a)) || (this->controllerInstance && this->controllerInstance->getProperty(a)) || getProperty(a)\n\nOSDefineMetaClassAndStructors(USBToolBox, IOService)\n\nOSDictionary* USBToolBox::createMatchingDictionary() {\n    char pciDevicePath[PARENT_PATH_LENGTH] = { 0 };\n    int pciDevicePathLength = sizeof(pciDevicePath);\n    \n    bool pciDevicePathStatus = pciDevice->getPath(pciDevicePath, &pciDevicePathLength, gIOServicePlane);\n    \n    if (!pciDevicePathStatus) {\n        SYSTEMLOGPROV(\"Failed to get PCI device path!\");\n        return NULL;\n    } else {\n        DEBUGLOGPROV(\"Path is %s, length %d\", pciDevicePath, pciDevicePathLength);\n    }\n    \n    OSString* pciDevicePathString = OSString::withCString(pciDevicePath);\n    \n    if (!pciDevicePathString) {\n        SYSTEMLOGPROV(\"Failed to create OSString of PCI device path!\");\n        return NULL;\n    }\n    \n    const OSSymbol* pathMatchKey = OSSymbol::withCString(\"IOPathMatch\");\n    \n    if (!pathMatchKey) {\n        SYSTEMLOGPROV(\"Failed to create path match key!\");\n        OSSafeReleaseNULL(pciDevicePathString);\n        return NULL;\n    }\n    \n    const OSObject* parentMatchObjects[] {pciDevicePathString};\n    const OSSymbol* parentMatchSymbols[] {pathMatchKey};\n    \n    OSDictionary* parentMatch = OSDictionary::withObjects(parentMatchObjects, parentMatchSymbols, 1);\n    \n    OSSafeReleaseNULL(pathMatchKey);\n    OSSafeReleaseNULL(pciDevicePathString);\n    \n    if (!parentMatch) {\n        SYSTEMLOGPROV(\"Failed to create parent match dict!\");\n        return NULL;\n    }\n    \n    OSDictionary* matchingDict = serviceMatching(\"AppleUSBHostController\");\n    \n    if (!matchingDict) {\n        SYSTEMLOGPROV(\"Failed to create matching dict!\");\n        OSSafeReleaseNULL(parentMatch);\n        return NULL;\n    }\n    \n    bool setParentMatchStatus = matchingDict->setObject(\"IOParentMatch\", parentMatch);\n    \n    OSSafeReleaseNULL(parentMatch);\n    \n    if (!setParentMatchStatus) {\n        SYSTEMLOGPROV(\"Failed to set parent match!\");\n        OSSafeReleaseNULL(matchingDict);\n        return NULL;\n    }\n    \n    char modelNameArray[MODEL_NAME_LENGTH] = { 0 };\n    // bool modelNameStatus = PEGetProductName(modelNameArray, MODEL_NAME_LENGTH); Big Sur+\n    bool modelNameStatus = PEGetModelName(modelNameArray, MODEL_NAME_LENGTH);\n    \n    if (!modelNameStatus) {\n        SYSTEMLOGPROV(\"Failed to get model name!\");\n        OSSafeReleaseNULL(matchingDict);\n        return NULL;\n    } else {\n        DEBUGLOGPROV(\"Name is %s\", modelNameArray);\n    }\n    \n    OSString* modelName = OSString::withCString(modelNameArray);\n    \n    if (!modelName) {\n        SYSTEMLOGPROV(\"Could not create OSString with model name!\");\n        OSSafeReleaseNULL(matchingDict);\n        return NULL;\n    }\n    \n    bool setModelStatus = matchingDict->setObject(\"model\", modelName);\n    \n    modelName->release();\n    \n    if (!setModelStatus) {\n        SYSTEMLOGPROV(\"Failed to set model!\");\n        OSSafeReleaseNULL(matchingDict);\n        return NULL;\n    }\n    \n    return matchingDict;\n}\n\nIORegistryEntry* USBToolBox::getControllerViaMatching() {\n    PE_parse_boot_argn(bootargMatchWait, &matchWait, sizeof(matchWait));\n    \n    if (OSObject* matchWaitProperty = pciDevice->getProperty(propertyMatchWait)) {\n        if (OSNumber* matchWaitNumber = OSDynamicCast(OSNumber, matchWaitProperty)) {\n            matchWait = matchWaitNumber->unsigned64BitValue();\n        } else {\n            DEBUGLOGPROV(\"Provider match wait property is incorrect type\");\n        }\n    }\n    \n    if (OSObject* matchWaitProperty = getProperty(propertyMatchWait)) {\n        if (OSNumber* matchWaitNumber = OSDynamicCast(OSNumber, matchWaitProperty)) {\n            matchWait = matchWaitNumber->unsigned64BitValue();\n        } else {\n            DEBUGLOGPROV(\"Match wait property is incorrect type\");\n        }\n    }\n    \n    if (matchWait > MAX_WAIT) {\n        SYSTEMLOGPROV(\"Match wait is too high, ignoring\");\n        matchWait = DEFAULT_WAIT;\n    }\n    \n    OSDictionary* matchingDict = createMatchingDictionary();\n    \n    if (!matchingDict) {\n        SYSTEMLOGPROV(\"Failed to create matching dict!\");\n        return NULL;\n    }\n    \n    DEBUGLOGPROV(\"Starting waitForMatchingService\");\n    IOService* controller = IOService::waitForMatchingService(matchingDict, matchWait * NANOSECONDS);\n    \n    OSSafeReleaseNULL(matchingDict);\n    \n    if (controller) {\n        DEBUGLOGPROV(\"waitForMatchingService successful\");\n    } else {\n        SYSTEMLOGPROV(\"waitForMatchingService failed or timed out\");\n    }\n    return controller;\n}\n\nbool USBToolBox::checkClassHierarchy(IORegistryEntry* entry, const char* className) {\n    const OSSymbol* classSymbol = OSSymbol::withCString(className);\n    \n    if (!classSymbol) {\n        DEBUGLOG(\"Failed to create class symbol for %s!\", className);\n        return false;\n    }\n    \n    const OSMetaClass* entryMetaclass = entry->getMetaClass();\n    while (entryMetaclass) {\n        if (entryMetaclass->getClassNameSymbol() == classSymbol) {\n            OSSafeReleaseNULL(classSymbol);\n            return true;\n        }\n        entryMetaclass = entryMetaclass->getSuperClass();\n    };\n    OSSafeReleaseNULL(classSymbol);\n    return false;\n}\n\nIORegistryEntry* USBToolBox::getControllerViaIteration() {\n    OSIterator* iterator = pciDevice->getChildIterator(gIOServicePlane);\n    if (!iterator) {\n        SYSTEMLOGPROV(\"Failed to create IOService iterator!\");\n        return NULL;\n    }\n    \n    IORegistryEntry* controller = NULL;\n    \n    DEBUGLOGPROV(\"Starting iteration over IOService plane\");\n    while (IORegistryEntry* entry = OSDynamicCast(IORegistryEntry, iterator->getNextObject())) {\n        // DEBUGLOGPROV(\"Object name is %s with class %s\", entry->getName(), entry->getMetaClass()->getClassName());\n        if (checkClassHierarchy(entry, \"AppleUSBHostController\")) {\n            // This is it\n            DEBUGLOGPROV(\"%s is AppleUSBHostController instance\", entry->getName());\n            // Retain before we exit iterator to prevent any races.\n            entry->retain();\n            controller = entry;\n            break;\n        }\n    }\n    DEBUGLOGPROV(\"Iteration over IOService plane finished\");\n    OSSafeReleaseNULL(iterator);\n    \n    return controller;\n}\n\nvoid USBToolBox::deleteProperty(IORegistryEntry* entry, const char* property) {\n    if (entry->getProperty(property)) {\n        DEBUGLOGPROV(\"%s exists, removing\", property);\n        entry->removeProperty(property);\n        DEBUGLOGPROV(\"removed %s\", property);\n    } else {\n        DEBUGLOGPROV(\"%s is null, not removing\", property);\n    }\n}\n\nvoid USBToolBox::mergeProperties(IORegistryEntry* instance) {\n    if (instance) {\n        this->controllerInstance = instance;\n    }\n    DEBUGLOGPROV(\"Merging properties\");\n    \n    if (!(checkKernelArgument(bootargAppleOff) || checkProperty(propertyAppleOff))) {\n        DEBUGLOGPROV(\"Removing any preexisting ports\");\n        deleteProperty(this->controllerInstance, \"ports\");\n        deleteProperty(this->controllerInstance, \"port-count\");\n    } else {\n        SYSTEMLOGPROV(\"Apple off specified, not removing any preexisting ports\");\n    }\n    \n    if (!(checkKernelArgument(bootargMapOff) || checkProperty(propertyMapOff))) {\n        OSDictionary* properties = NULL;\n        if ((properties = OSDynamicCast(OSDictionary, getProperty(\"IOProviderMergeProperties\")))) {\n            DEBUGLOGPROV(\"Applying map\");\n        } else if ((properties = OSDynamicCast(OSDictionary, this->pciDevice->getProperty(\"IOProviderMergeProperties\")))) {\n            DEBUGLOGPROV(\"Applying map from provider\");\n        }\n        \n        if (properties) {\n            if (OSCollectionIterator* propertyIterator = OSCollectionIterator::withCollection(properties)) {\n                DEBUGLOGPROV(\"Starting iteration over properties\");\n                while (OSSymbol* key = OSDynamicCast(OSSymbol, propertyIterator->getNextObject())) {\n                    //DEBUGLOGPROV(\"Applied property %s\", key->getCStringNoCopy());\n                    this->controllerInstance->setProperty(key, properties->getObject(key));\n                }\n                DEBUGLOGPROV(\"Successfully applied map\");\n                OSSafeReleaseNULL(propertyIterator);\n            } else {\n                SYSTEMLOGPROV(\"Failed to create property iterator!\");\n            }\n        } else {\n            DEBUGLOGPROV(\"No properties to apply\");\n        }\n        \n    } else {\n        SYSTEMLOGPROV(\"Map disabled, continuing\");\n    }\n    this->controllerInstance->release();\n}\n\nvoid USBToolBox::removeACPIPorts() {\n    if (!(checkKernelArgument(bootargAcpiOff) || checkProperty(propertyAcpiOff))) {\n        const IORegistryPlane* acpiPlane = IORegistryEntry::getPlane(\"IOACPIPlane\");\n        \n        if (!acpiPlane) {\n            SYSTEMLOGPROV(\"Could not get ACPI plane!\");\n            return;\n        }\n        \n        IORegistryEntry* acpiEntry = OSDynamicCast(IORegistryEntry, pciDevice->getProperty(\"acpi-device\"));\n        \n        if (acpiEntry) {\n            if (OSIterator* acpiIterator = acpiEntry->getChildIterator(acpiPlane)) {\n                DEBUGLOGPROV(\"Starting iteration over ACPI plane\");\n                while (IORegistryEntry* entry = OSDynamicCast(IORegistryEntry, acpiIterator->getNextObject())) {\n                    DEBUGLOGPROV(\"Object name is %s, detatching\", entry->getName());\n                    entry->detachAll(acpiPlane);\n                }\n                DEBUGLOGPROV(\"Iteration over ACPI plane finished\");\n                acpiEntry->setProperty(\"ACPI removed by USBToolBox\", true);\n                OSSafeReleaseNULL(acpiIterator);\n            } else {\n                SYSTEMLOGPROV(\"Failed to create ACPI iterator!\");\n            }\n        } else {\n            SYSTEMLOGPROV(\"Failed to get ACPI entry or none available\");\n        }\n    } else {\n        SYSTEMLOGPROV(\"ACPI fixup disabled, continuing\");\n    }\n}\n\nIOService* USBToolBox::probe(IOService* provider, SInt32* score) {\n    DEBUGLOG(\"%s: probe start\", provider->getName());\n    \n    if (OSDynamicCast(IOPCIDevice, provider)) {\n        // We are attached to the PCI device\n        this->pciDevice = provider;\n    } else if (checkClassHierarchy(provider, \"AppleUSBHostController\")) {\n        // We are already attached to the instance\n        this->controllerInstance = provider;\n        this->controllerInstance->retain();\n        this->pciDevice = this->controllerInstance->getParentEntry(gIOServicePlane); // Should not be released by the caller.\n        if (!(this->pciDevice)) {\n            DEBUGLOG(\"%s: No parent PCI device!\", provider->getName());\n            return NULL;\n        }\n    } else {\n        DEBUGLOG(\"%s: Unknown provider class %s!\", provider->getName(), provider->getMetaClass()->getClassName());\n        return NULL;\n    }\n    \n    if (checkKernelArgument(bootargOff) || checkProperty(propertyOff)) {\n        SYSTEMLOGPROV(\"disable argument specified, exiting\");\n        return NULL;\n    }\n    \n    this->pciDevice->setProperty(\"UTB Version\", versionString);\n    \n    removeACPIPorts();\n    \n    if (!(this->controllerInstance)) {\n        this->controllerInstance = getControllerViaMatching();\n    }\n    if (!(this->controllerInstance)) {\n        DEBUGLOGPROV(\"Failed to obtain via matching in probe\");\n    } else {\n        mergeProperties();\n        DEBUGLOGPROV(\"Probe early finish\");\n        return NULL;\n    }\n    DEBUGLOGPROV(\"Probe end\");\n    return super::probe(provider, score);\n}\n\nbool USBToolBox::matchingCallback(OSDictionary* matchingDict, IOService* newService, IONotifier* notifier) {\n    DEBUGLOGPROV(\"controller callback start\");\n    newService->retain();\n    // These actions are synchronized with invocations of the notification handler, so removing a notification request will guarantee the handler is not being executed.\n    notifier->remove();\n    mergeProperties(newService);\n    // addMatchingNotification does not consume a reference on the matching dictionary when the notification is removed, unlike addNotification.\n    // Should never be null, but better safe than sorry.\n    OSSafeReleaseNULL(matchingDict);\n    \n    DEBUGLOGPROV(\"controller callback end\");\n    terminate();\n    return true;\n}\n\nbool USBToolBox::_matchingCallback(void* target, void* matchingDict, IOService* newService, IONotifier* notifier) {\n    return static_cast<USBToolBox*>(target)->matchingCallback(static_cast<OSDictionary*>(matchingDict), newService, notifier);\n}\n\nbool USBToolBox::start(IOService *provider) {\n    DEBUGLOGPROV(\"start start\");\n    // If we're here we couldn't get the instance in probe\n    DEBUGLOGPROV(\"Trying to obtain via matching\");\n    this->controllerInstance = getControllerViaMatching();\n    \n    if (!(this->controllerInstance)) {\n        DEBUGLOGPROV(\"Failed to obtain via matching, falling back to iteration\");\n        this->controllerInstance = getControllerViaIteration();\n    }\n    \n    if (!(this->controllerInstance)) {\n        DEBUGLOGPROV(\"Failed to obtain via iteration, falling back to notification\");\n        OSDictionary* matchingDict = createMatchingDictionary();\n        \n        if (!matchingDict) {\n            SYSTEMLOGPROV(\"Failed to create matching dict!\");\n            return false;\n        }\n        if (!gIOPublishNotification) {\n            SYSTEMLOGPROV(\"IOPublishNotification null!\");\n            OSSafeReleaseNULL(matchingDict);\n            return false;\n        }\n        // static IONotifier* addMatchingNotification(const OSSymbol* type, OSDictionary* matching, IOServiceMatchingNotificationHandler handler, void* target, void* ref = NULL, SInt32 priority = 0)\n        IONotifier* notifierStatus = addMatchingNotification(gIOMatchedNotification, matchingDict, _matchingCallback, this, matchingDict);\n        DEBUGLOGPROV(\"Installed controller notifier status: %s\", notifierStatus ? \"successful\" : \"failed\");\n    } else {\n        mergeProperties();\n        DEBUGLOGPROV(\"Successfully applied properties, exiting\");\n        return false;\n    }\n    DEBUGLOGPROV(\"start exit\");\n    return super::start(provider);\n}\n"
  },
  {
    "path": "USBToolBox/USBToolBox.hpp",
    "content": "//\n//  PortPopulator.hpp\n//  USBToolBox\n//\n//  Created by Dhinak G on 6/1/20.\n//  Copyright © 2020-2021 Dhinak G. All rights reserved.\n//\n\n#ifndef USBToolBox_hpp\n#define USBToolBox_hpp\n\n#include <IOKit/IOService.h>\n#include <IOKit/pci/IOPCIDevice.h>\n#include <pexpert/pexpert.h>\n\n#define super IOService\n#define PRODUCT_NAME USBToolBox\n\n#ifdef DEBUG\n#define TRACELOG kprintf\n#else\n#define TRACELOG IOLog\n#endif\n\n#define SYSTEMLOG(format, args...) do { TRACELOG(\"USBToolBox: \" format \"\\n\", ##args); } while (false)\n#define SYSTEMLOGPROV(format, args...) do { TRACELOG(\"USBToolBox: %s: \" format \"\\n\", pciDevice->getName(), ##args); } while (false)\n\n// Debug log\n#ifdef DEBUG\n#define DEBUGLOG(format, args...) SYSTEMLOG(format, ##args)\n#define DEBUGLOGPROV(format, args...) SYSTEMLOGPROV(format, ##args)\n#else\n#define DEBUGLOG(format, args...)\n#define DEBUGLOGPROV(format, args...)\n#endif\n\n\nclass USBToolBox : public IOService {\n    OSDeclareDefaultStructors(USBToolBox)\n\n    static constexpr const int PARENT_PATH_LENGTH = 512;\n    static constexpr const int MODEL_NAME_LENGTH = 16;\n\n    static constexpr const uint64_t MAX_WAIT = 180;\n    static constexpr const uint64_t DEFAULT_WAIT = 1;\n    static constexpr const uint64_t NANOSECONDS = 1000000000;\n    // Boot args\n    static constexpr const char *bootargOff {\"-utboff\"};              // Disable the kext\n    static constexpr const char *bootargAcpiOff {\"-utbacpioff\"};      // Disable RHUB removal from ACPI plane\n    static constexpr const char *bootargAppleOff {\"-utbappleoff\"};    // Disable existing `ports` and `ports-count` removal\n    static constexpr const char *bootargMapOff {\"-utbmapoff\"};        // Disable the map\n    static constexpr const char *bootargMatchWait {\"utbwait\"};        // Modify waitForMatchingService delay\n    \n    // Properties\n    static constexpr const char *propertyOff {\"utb-off\"};\n    static constexpr const char *propertyAcpiOff {\"utb-acpi-off\"};\n    static constexpr const char *propertyAppleOff {\"utb-apple-off\"};\n    static constexpr const char *propertyMapOff {\"utb-map-off\"};\n    static constexpr const char *propertyMatchWait {\"utb-wait\"};\n\n    static constexpr const char *versionString =\n#ifdef VERBOSE\n    \"VBS-\"\n#elif defined DEBUG\n    \"DBG-\"\n#else\n    \"REL-\"\n#endif\n     __DATE__ \"-\" __TIME__;\npublic:\n    virtual IOService* probe(IOService* provider, SInt32* score) override;\n    virtual bool start(IOService* provider) override;\nprivate:\n    uint64_t matchWait = DEFAULT_WAIT; // Default timeout in seconds\n\n    IORegistryEntry* pciDevice = NULL;\n    IORegistryEntry* controllerInstance = NULL;\n    \n    void deleteProperty(IORegistryEntry* provider, const char* property);\n    OSDictionary* createMatchingDictionary();\n    bool matchingCallback(OSDictionary* matchingDict, IOService* newService, IONotifier* notifier);\n    static bool _matchingCallback(void* matchingDict, void* refCon, IOService* newService, IONotifier* notifier);\n    IORegistryEntry* getControllerViaMatching();\n    IORegistryEntry* getControllerViaIteration();\n    void mergeProperties(IORegistryEntry* instance = NULL);\n    void removeACPIPorts();\n    \n    static bool checkClassHierarchy(IORegistryEntry* provider, const char* className);\n    static inline bool checkKernelArgument(const char* arg) {\n        uint32_t value = 0;\n        return PE_parse_boot_argn(arg, &value, sizeof(value));\n    };\n};\n\n#endif /* USBToolBox_hpp */\n"
  },
  {
    "path": "USBToolBox.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 50;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t5114BA55263DAE8300D7132C /* UTBDefault.kext in Embed Resources */ = {isa = PBXBuildFile; fileRef = 5114BA4D263DAE2500D7132C /* UTBDefault.kext */; };\n\t\t5114BA5B263DAF7800D7132C /* USBToolBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5114BA58263DAF7800D7132C /* USBToolBox.cpp */; };\n\t\t5114BA5C263DAF7800D7132C /* USBToolBox.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 5114BA59263DAF7800D7132C /* USBToolBox.hpp */; };\n\t\t51D16754264AD26800BC9A2F /* libkmod.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 51D16753264AD26800BC9A2F /* libkmod.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t5114BA3E263DA8C000D7132C /* Embed Resources */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t\t5114BA55263DAE8300D7132C /* UTBDefault.kext in Embed Resources */,\n\t\t\t);\n\t\t\tname = \"Embed Resources\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t5114BA29263DA57C00D7132C /* USBToolBox.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = USBToolBox.kext; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t5114BA30263DA57C00D7132C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t5114BA3A263DA71E00D7132C /* libkmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libkmod.a; path = usr/lib/libkmod.a; sourceTree = SDKROOT; };\n\t\t5114BA4D263DAE2500D7132C /* UTBDefault.kext */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.kernel-extension\"; name = UTBDefault.kext; path = Resources/UTBDefault.kext; sourceTree = \"<group>\"; };\n\t\t5114BA58263DAF7800D7132C /* USBToolBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = USBToolBox.cpp; sourceTree = \"<group>\"; };\n\t\t5114BA59263DAF7800D7132C /* USBToolBox.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = USBToolBox.hpp; sourceTree = \"<group>\"; };\n\t\t51D16753264AD26800BC9A2F /* libkmod.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libkmod.a; path = MacKernelSDK/Library/x86_64/libkmod.a; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t5114BA26263DA57C00D7132C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t51D16754264AD26800BC9A2F /* libkmod.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t5114BA1F263DA57C00D7132C = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5114BA2B263DA57C00D7132C /* USBToolBox */,\n\t\t\t\t5114BA2A263DA57C00D7132C /* Products */,\n\t\t\t\t5114BA4C263DADFD00D7132C /* Resources */,\n\t\t\t\t5114BA39263DA71E00D7132C /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5114BA2A263DA57C00D7132C /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5114BA29263DA57C00D7132C /* USBToolBox.kext */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5114BA2B263DA57C00D7132C /* USBToolBox */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5114BA58263DAF7800D7132C /* USBToolBox.cpp */,\n\t\t\t\t5114BA59263DAF7800D7132C /* USBToolBox.hpp */,\n\t\t\t\t5114BA30263DA57C00D7132C /* Info.plist */,\n\t\t\t);\n\t\t\tpath = USBToolBox;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5114BA39263DA71E00D7132C /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t51D16753264AD26800BC9A2F /* libkmod.a */,\n\t\t\t\t5114BA3A263DA71E00D7132C /* libkmod.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5114BA4C263DADFD00D7132C /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5114BA4D263DAE2500D7132C /* UTBDefault.kext */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t5114BA24263DA57C00D7132C /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5114BA5C263DAF7800D7132C /* USBToolBox.hpp in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t5114BA28263DA57C00D7132C /* USBToolBox */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 5114BA33263DA57C00D7132C /* Build configuration list for PBXNativeTarget \"USBToolBox\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t5114BA24263DA57C00D7132C /* Headers */,\n\t\t\t\t5114BA25263DA57C00D7132C /* Sources */,\n\t\t\t\t5114BA26263DA57C00D7132C /* Frameworks */,\n\t\t\t\t5114BA3E263DA8C000D7132C /* Embed Resources */,\n\t\t\t\t5114BA3F263DA8E100D7132C /* Archive */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = USBToolBox;\n\t\t\tproductName = kext;\n\t\t\tproductReference = 5114BA29263DA57C00D7132C /* USBToolBox.kext */;\n\t\t\tproductType = \"com.apple.product-type.kernel-extension\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t5114BA20263DA57C00D7132C /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 1240;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t5114BA28263DA57C00D7132C = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 12.4;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 5114BA23263DA57C00D7132C /* Build configuration list for PBXProject \"USBToolBox\" */;\n\t\t\tcompatibilityVersion = \"Xcode 9.3\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 5114BA1F263DA57C00D7132C;\n\t\t\tproductRefGroup = 5114BA2A263DA57C00D7132C /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t5114BA28263DA57C00D7132C /* USBToolBox */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t5114BA3F263DA8E100D7132C /* Archive */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = Archive;\n\t\t\toutputFileListPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"cd \\\"${TARGET_BUILD_DIR}\\\"\\n\\ndist=(\\\"$FULL_PRODUCT_NAME\\\")\\nif [ -d \\\"$DWARF_DSYM_FILE_NAME\\\" ]; then dist+=(\\\"$DWARF_DSYM_FILE_NAME\\\"); fi\\ndist+=(\\\"UTBDefault.kext\\\")\\n\\narchive=\\\"${PRODUCT_NAME}-${MODULE_VERSION}-$(echo $CONFIGURATION | tr /a-z/ /A-Z/).zip\\\"\\nrm -rf *.zip\\nif [ \\\"$CONFIGURATION\\\" == \\\"Release\\\" ]; then strip -x -T \\\"${EXECUTABLE_PATH}\\\"; fi\\nzip -qry -FS \\\"${archive}\\\" \\\"${dist[@]}\\\"\\n\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t5114BA25263DA57C00D7132C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5114BA5B263DAF7800D7132C /* USBToolBox.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t5114BA31263DA57C00D7132C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tKERNEL_EXTENSION_HEADER_SEARCH_PATHS = \"$(PROJECT_DIR)/MacKernelSDK/Headers\";\n\t\t\t\tKERNEL_FRAMEWORK_HEADERS = \"$(PROJECT_DIR)/MacKernelSDK/Headers\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t5114BA32263DA57C00D7132C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tKERNEL_EXTENSION_HEADER_SEARCH_PATHS = \"$(PROJECT_DIR)/MacKernelSDK/Headers\";\n\t\t\t\tKERNEL_FRAMEWORK_HEADERS = \"$(PROJECT_DIR)/MacKernelSDK/Headers\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.11;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t5114BA34263DA57C00D7132C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = x86_64;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1.1.1;\n\t\t\t\tINFOPLIST_FILE = USBToolBox/Info.plist;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/MacKernelSDK/Library/x86_64\",\n\t\t\t\t);\n\t\t\t\tMODULE_NAME = com.dhinakg.USBToolBox.kext;\n\t\t\t\tMODULE_VERSION = 1.1.1;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.dhinakg.USBToolBox.kext;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t\tWRAPPER_EXTENSION = kext;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t5114BA35263DA57C00D7132C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = x86_64;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1.1.1;\n\t\t\t\tINFOPLIST_FILE = USBToolBox/Info.plist;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/MacKernelSDK/Library/x86_64\",\n\t\t\t\t);\n\t\t\t\tMODULE_NAME = com.dhinakg.USBToolBox.kext;\n\t\t\t\tMODULE_VERSION = 1.1.1;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.dhinakg.USBToolBox.kext;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tRUN_CLANG_STATIC_ANALYZER = YES;\n\t\t\t\tSTRIP_STYLE = \"non-global\";\n\t\t\t\tWRAPPER_EXTENSION = kext;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t5114BA23263DA57C00D7132C /* Build configuration list for PBXProject \"USBToolBox\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5114BA31263DA57C00D7132C /* Debug */,\n\t\t\t\t5114BA32263DA57C00D7132C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t5114BA33263DA57C00D7132C /* Build configuration list for PBXNativeTarget \"USBToolBox\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5114BA34263DA57C00D7132C /* Debug */,\n\t\t\t\t5114BA35263DA57C00D7132C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 5114BA20263DA57C00D7132C /* Project object */;\n}\n"
  },
  {
    "path": "USBToolBox.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:/Users/dhinak/Documents/Xcode/kext/UTBDefault.kext\">\n   </FileRef>\n   <FileRef\n      location = \"self:/Users/dhinak/Documents/Xcode/kext/USBToolBox.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "USBToolBox.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  }
]