Skip to content

Commit

Permalink
Attempt to fix Internal Bluetooth Controller NVRAM checking on macOS 15
Browse files Browse the repository at this point in the history
  • Loading branch information
PMheart committed Oct 2, 2024
1 parent b1fcc13 commit 4d2f0ce
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions BrcmPatchRAM/BlueToolFixup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,22 @@ static const uint8_t kSkipInternalControllerNVRAMCheckMask15[] =

static const uint8_t kSkipInternalControllerNVRAMCheckPatched15[] =
{
0x90, 0x90, 0x90, 0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90,
0x90, 0x90,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x90, 0x90
};

static const uint8_t kSkipInternalControllerNVRAMCheckPatchedMask15[] =
{
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0xFF, 0xFF
};

static bool shouldPatchBoardId = false;
static bool shouldPatchAddress = false;

Expand Down Expand Up @@ -269,7 +278,7 @@ static void patched_cs_validate_page(vnode_t vp, memory_object_t pager, memory_o
searchAndPatchWithMask(data, PAGE_SIZE, path, kBadChipsetCheckOriginal15, sizeof(kBadChipsetCheckOriginal15), kBadChipsetCheckMask15, sizeof(kBadChipsetCheckMask15), kBadChipsetCheckPatched15, sizeof(kBadChipsetCheckPatched15), nullptr, 0);
searchAndPatch(data, PAGE_SIZE, path, kBadChipsetCheckOriginal13_3, kBadChipsetCheckPatched13_3);
searchAndPatchWithMask(data, PAGE_SIZE, path, kSkipInternalControllerNVRAMCheck13_3, sizeof(kSkipInternalControllerNVRAMCheck13_3), kSkipInternalControllerNVRAMCheckMask13_3, sizeof(kSkipInternalControllerNVRAMCheckMask13_3), kSkipInternalControllerNVRAMCheckPatched13_3, sizeof(kSkipInternalControllerNVRAMCheckPatched13_3), nullptr, 0);
searchAndPatchWithMask(data, PAGE_SIZE, path, kSkipInternalControllerNVRAMCheck15, sizeof(kSkipInternalControllerNVRAMCheck15), kSkipInternalControllerNVRAMCheckMask15, sizeof(kSkipInternalControllerNVRAMCheckMask15), kSkipInternalControllerNVRAMCheckPatched15, sizeof(kSkipInternalControllerNVRAMCheckPatched15), nullptr, 0);
searchAndPatchWithMask(data, PAGE_SIZE, path, kSkipInternalControllerNVRAMCheck15, sizeof(kSkipInternalControllerNVRAMCheck15), kSkipInternalControllerNVRAMCheckMask15, sizeof(kSkipInternalControllerNVRAMCheckMask15), kSkipInternalControllerNVRAMCheckPatched15, sizeof(kSkipInternalControllerNVRAMCheckPatched15), kSkipInternalControllerNVRAMCheckPatchedMask15, sizeof(kSkipInternalControllerNVRAMCheckPatchedMask15));
if (shouldPatchBoardId)
searchAndPatch(data, PAGE_SIZE, path, boardIdsWithUSBBluetooth[0], kBoardIdSize, BaseDeviceInfo::get().boardIdentifier, kBoardIdSize);
if (shouldPatchAddress)
Expand Down

0 comments on commit 4d2f0ce

Please sign in to comment.