Skip to content

Commit

Permalink
kern_start.cpp: Allow patching upon re-paging
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Jan 8, 2023
1 parent c5ad8fd commit fa7619a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 2 additions & 6 deletions FeatureUnlock/kern_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit fa7619a

Please sign in to comment.