mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 20:10:14 +10:00
BlueToolFixup: Fix 12.4 Release Bluetooth support
Applicable for BCM2070 and BCM2046 chipsets
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,48 +1,40 @@
|
|||||||
diff --git a/BrcmPatchRAM/BlueToolFixup.cpp b/BrcmPatchRAM/BlueToolFixup.cpp
|
diff --git a/BrcmPatchRAM/BlueToolFixup.cpp b/BrcmPatchRAM/BlueToolFixup.cpp
|
||||||
index a6e3c69..701a9ad 100644
|
index a6e3c69..16fcbcd 100644
|
||||||
--- a/BrcmPatchRAM/BlueToolFixup.cpp
|
--- a/BrcmPatchRAM/BlueToolFixup.cpp
|
||||||
+++ b/BrcmPatchRAM/BlueToolFixup.cpp
|
+++ b/BrcmPatchRAM/BlueToolFixup.cpp
|
||||||
@@ -48,6 +48,35 @@ bool BlueToolFixup::start(IOService *provider) {
|
@@ -48,6 +48,27 @@ bool BlueToolFixup::start(IOService *provider) {
|
||||||
static const uint8_t kSkipUpdateFilePathOriginal[] = "/etc/bluetool/SkipBluetoothAutomaticFirmwareUpdate";
|
static const uint8_t kSkipUpdateFilePathOriginal[] = "/etc/bluetool/SkipBluetoothAutomaticFirmwareUpdate";
|
||||||
static const uint8_t kSkipUpdateFilePathPatched[] = "/System/Library/CoreServices/boot.efi";
|
static const uint8_t kSkipUpdateFilePathPatched[] = "/System/Library/CoreServices/boot.efi";
|
||||||
|
|
||||||
+
|
+
|
||||||
+// Workaround 12.3 Beta 3 bug where macOS will detect the Bluetooth chipset twice
|
+// Workaround 12.3 Beta 3+ bug where macOS will detect the Bluetooth chipset twice
|
||||||
+// Once and internal, and second as external dongle:
|
+// Once and internal, and second as external dongle:
|
||||||
+// 'ERROR -- Third Party Dongle has the same address as the internal module'
|
+// 'ERROR -- Third Party Dongle has the same address as the internal module'
|
||||||
+static const uint8_t kSkipAddressCheckOriginal[] =
|
+static const uint8_t kSkipAddressCheckOriginal[] =
|
||||||
+{
|
+{
|
||||||
+ 0x48, 0x8D, 0x05, 0xC5, 0x97, 0x65, 0x00, // lea rax
|
+ 0x48, 0x89, 0xF3, // mov rbx, rsi
|
||||||
+ 0x8B, 0x48, 0x53, // mov ecx
|
+ 0xE8, 0xE3, 0xF3, 0xFE, 0xFF, // call sub_1000c5bc6
|
||||||
+ 0x33, 0x0B, // xor ecx
|
+ 0x85, 0xC0, // test eax, eax
|
||||||
+ 0x0F, 0xB7, 0x50, 0x57, // movzx edx
|
+ 0x74, 0x1D, // je loc_1000d6804
|
||||||
+ 0x66, 0x33, 0x53, 0x04, // xor dx
|
|
||||||
+ 0x0F, 0xB7, 0xD2, // movzx edx, dx
|
|
||||||
+ 0x09, 0xCA, // or edx, ecx
|
|
||||||
+ 0x74, 0x0E, // je
|
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+static const uint8_t kSkipAddressPatched[] =
|
+static const uint8_t kSkipAddressCheckPatched[] =
|
||||||
+{
|
+{
|
||||||
+ 0x48, 0x8D, 0x05, 0xC5, 0x97, 0x65, 0x00, // lea rax
|
+ 0x48, 0x89, 0xF3, // mov rbx, rsi
|
||||||
+ 0x8B, 0x48, 0x53, // mov ecx
|
+ 0xE8, 0xE3, 0xF3, 0xFE, 0xFF, // call sub_1000c5bc6
|
||||||
+ 0x33, 0x0B, // xor ecx
|
+ 0x85, 0xC0, // test eax, eax
|
||||||
+ 0x0F, 0xB7, 0x50, 0x57, // movzx edx
|
+ 0x75, 0x1D, // jne loc_1000d6804
|
||||||
+ 0x66, 0x33, 0x53, 0x04, // xor dx
|
|
||||||
+ 0x0F, 0xB7, 0xD2, // movzx edx, dx
|
|
||||||
+ 0x09, 0xCA, // or edx, ecx
|
|
||||||
+ 0x75, 0x0E, // jne
|
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
static const uint8_t kVendorCheckOriginal[] =
|
static const uint8_t kVendorCheckOriginal[] =
|
||||||
{
|
{
|
||||||
0x81, 0xFA, // cmp edx
|
0x81, 0xFA, // cmp edx
|
||||||
@@ -131,6 +160,7 @@ static void patched_cs_validate_page(vnode_t vp, memory_object_t pager, memory_o
|
@@ -131,6 +152,7 @@ static void patched_cs_validate_page(vnode_t vp, memory_object_t pager, memory_o
|
||||||
}
|
}
|
||||||
else if (strcmp(path + dirLength, "bluetoothd") == 0) {
|
else if (strcmp(path + dirLength, "bluetoothd") == 0) {
|
||||||
searchAndPatch(data, PAGE_SIZE, path, kVendorCheckOriginal, kVendorCheckPatched);
|
searchAndPatch(data, PAGE_SIZE, path, kVendorCheckOriginal, kVendorCheckPatched);
|
||||||
+ searchAndPatch(data, PAGE_SIZE, path, kSkipAddressCheckOriginal, kSkipAddressPatched);
|
+ searchAndPatch(data, PAGE_SIZE, path, kSkipAddressCheckOriginal, kSkipAddressCheckPatched);
|
||||||
searchAndPatch(data, PAGE_SIZE, path, kBadChipsetCheckOriginal, kBadChipsetCheckPatched);
|
searchAndPatch(data, PAGE_SIZE, path, kBadChipsetCheckOriginal, kBadChipsetCheckPatched);
|
||||||
if (shouldPatchBoardId)
|
if (shouldPatchBoardId)
|
||||||
searchAndPatch(data, PAGE_SIZE, path, boardIdsWithUSBBluetooth[0], kBoardIdSize, BaseDeviceInfo::get().boardIdentifier, kBoardIdSize);
|
searchAndPatch(data, PAGE_SIZE, path, boardIdsWithUSBBluetooth[0], kBoardIdSize, BaseDeviceInfo::get().boardIdentifier, kBoardIdSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user