Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions checkra1n/kpf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ static void kpf_vm_map_protect_patch(xnu_pf_patchset_t* xnu_text_exec_patchset)
// /x 00061f121f180071010000540000a837:10feffff1ffeffff1f0000ff1000f8ff
// /x e003302a1f041f72010000540000a837:f0fff0ff1ffeffff1f0000ff1000e8ff
// /x e003302a1f041f720100005400000035:f0fff0ff1ffeffff1f0000ff100000ff
// /x 1f00306a010000540000a837:1ffef0ff1f0000ff1000e8ff
// /x 1f00306a010000540000a837:1ffcf0ff1f0000ff1000e8ff
// /x e003302a00041f12:f0fff0ff10feffff
uint64_t matches_old[] = {
0x121f0600, // and w{0-15}, w{16-31}, 6
Expand Down Expand Up @@ -542,12 +542,12 @@ static void kpf_vm_map_protect_patch(xnu_pf_patchset_t* xnu_text_exec_patchset)
xnu_pf_maskmatch(xnu_text_exec_patchset, "vm_map_protect", matches_new, masks_new, sizeof(matches_new)/sizeof(uint64_t), false, (void*)kpf_vm_map_protect_branch_long);

uint64_t matches17[] = {
0x6a30001f, // bics wzr, w{0-15}, w{16-31}
0x6a30001f, // bics wzr, wN, w{16-31}
0x54000001, // b.ne 0x...
0x37a80000, // tbnz w{0-15}, {0x15 | 0x17}, 0x...
};
uint64_t masks17[] = {
0xfff0fe1f,
0xfff0fc1f,
0xff00001f,
0xffe80010,
};
Expand Down Expand Up @@ -1617,7 +1617,10 @@ static void kpf_cmd(const char *cmd, char *args)
#ifdef DEV_BUILD
#if 0
// 15.0 beta 1 onwards, but only iOS/iPadOS
if((livefs_string_match != NULL) != (gKernelVersion.darwinMajor >= 21 && xnu_platform() == PLATFORM_IOS)) panic("livefs panic doesn't match expected Darwin version");
if((livefs_string_match != NULL) != (
(gKernelVersion.darwinMajor >= 21 && xnu_platform() == PLATFORM_IOS) ||
(gKernelVersion.darwinMajor >= 24 && gKernelVersion.darwinMinor >= 2 && xnu_platform() == PLATFORM_TVOS)))
panic("livefs panic doesn't match expected Darwin version");
#endif
#endif

Expand Down
Loading