From fa7619a5940a42acfc934fff98db9ac1899d0b10 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 7 Jan 2023 18:45:29 -0700 Subject: [PATCH] kern_start.cpp: Allow patching upon re-paging Closes https://github.com/acidanthera/bugtracker/issues/2193 --- Changelog.md | 6 +++++- FeatureUnlock/kern_start.cpp | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Changelog.md b/Changelog.md index 589b030..5ac57d0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,8 +1,12 @@ FeatureUnlock Changelog ====================== +### v1.1.3 +- Allow binaries to be patched upon re-paging + - Resolves patches disappearing for small binaries after prolonged period (ex. Control Center.app) + ### v1.1.2 - Added AirPlay to Mac unlocking inside Control Center.app - - Applicable for systems with `kern.hv_vmm_present` set to `1` in macOS Ventura + - Applicable for systems with `kern.hv_vmm_present` set to `1` in macOS Ventura ### v1.1.1 - Resolved Macmini8,1 patch regression from 1.1.0 diff --git a/FeatureUnlock/kern_start.cpp b/FeatureUnlock/kern_start.cpp index a35a916..7eabd3e 100644 --- a/FeatureUnlock/kern_start.cpp +++ b/FeatureUnlock/kern_start.cpp @@ -76,8 +76,6 @@ bool model_is_MacPro_2013; // MacPro6,x bool has_applied_nightshift_patch; bool has_applied_airplay_to_mac_vmm_patch; bool has_applied_iPad_sidecar_patch; -bool has_applied_uc_app_patch; -bool has_applied_cc_app_patch; // Misc variables @@ -316,20 +314,18 @@ static void patched_cs_validate_page(vnode_t vp, memory_object_t pager, memory_o // Individual binary patching else { // Universal Control.app patch - if (!disable_sidecar_mac && os_supports_universal_control && host_needs_universal_control_patch && !has_applied_uc_app_patch) { + if (!disable_sidecar_mac && os_supports_universal_control && host_needs_universal_control_patch) { if (UNLIKELY(strcmp(path, universalControlPath) == 0)) { patch_result = searchAndPatch(data, PAGE_SIZE, path, kUniversalControlFind, kUniversalControlReplace, "Universal Control (app)", false); if (patch_result) { - has_applied_uc_app_patch = true; return; } } } - if (!disable_sidecar_mac && !has_applied_cc_app_patch && host_needs_airplay_to_mac_vmm_patch) { + if (!disable_sidecar_mac && host_needs_airplay_to_mac_vmm_patch) { if (UNLIKELY(strcmp(path, controlCenterPath) == 0)) { patch_result = searchAndPatch(data, PAGE_SIZE, path, kGenericVmmOriginal, kGenericVmmPatched, "Control Center (app)", false); if (patch_result) { - has_applied_cc_app_patch = true; return; } }