Files
OpenCore-Legacy-Patcher/payloads/Kexts/Bluetooth/BlueToolFixup-2070.patch
2021-09-16 10:06:59 -06:00

27 lines
1.3 KiB
Diff

diff --git a/BrcmPatchRAM/BlueToolFixup.cpp b/BrcmPatchRAM/BlueToolFixup.cpp
index 0fa891a..6a9d2f3 100644
--- a/BrcmPatchRAM/BlueToolFixup.cpp
+++ b/BrcmPatchRAM/BlueToolFixup.cpp
@@ -50,7 +50,11 @@ bool BlueToolFixup::start(IOService *provider) {
static const uint8_t kSkipUpdateFilePathOriginal[] = "/etc/bluetool/SkipBluetoothAutomaticFirmwareUpdate";
static const uint8_t kSkipUpdateFilePathPatched[] = "/System/Library/CoreServices/boot.efi";
+static const uint8_t kBluetoothUSBNameOriginal[] = "Bluetooth USB Host Controller";
+static const uint8_t kBluetoothUSBNamePatched[] = "BRCM2070 Hub Host Controller";
+
static const char *blueToolPath = "/usr/sbin/BlueTool";
+static const char *bluetoothdPath = "/usr/sbin/bluetoothd";
static mach_vm_address_t orig_cs_validate {};
@@ -74,6 +78,9 @@ static void patched_cs_validate_page(vnode_t vp, memory_object_t pager, memory_o
if (vn_getpath(vp, path, &pathlen) == 0 && UNLIKELY(strcmp(path, blueToolPath) == 0)) {
searchAndPatch(data, PAGE_SIZE, path, kSkipUpdateFilePathOriginal, kSkipUpdateFilePathPatched);
}
+ if (vn_getpath(vp, path, &pathlen) == 0 && UNLIKELY(strcmp(path, bluetoothdPath) == 0)) {
+ searchAndPatch(data, PAGE_SIZE, path, kBluetoothUSBNameOriginal, kBluetoothUSBNamePatched);
+ }
}