Run a virtual iPhone on an Apple Silicon Mac.
Swift
Call it custom firmware, not jb, everywhere the project owns the name
Lakrb323fc4ec761
diff --git a/AGENTS.md b/AGENTS.mdindex 79936ad1..d7c393ac 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -120,7 +120,7 @@ There is none, and adding any is a regression.- All replacement instruction bytes must come from Keystone-backed helpers already used by the project: `ARM64Encoder.encode*` and the `ARM64` constants, which were generated by keystone-engine, verified by Capstone round-trip, and are asserted word for word against keystone in `VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/ARM64EncoderTests.swift`. Never write a literal instruction word at a patch site. A new instruction means a new encoder plus its keystone-checked test case, not a raw `Data`. Keystone is deliberately **not** a project dependency any more — nothing at runtime or in the test suite calls it, and the expected words are frozen constants. To derive a new one, stand keystone up in a throwaway environment **outside this repository** (`brew install keystone`, plus `keystone-engine` in a scratch interpreter somewhere under `/tmp`) and run the one-liner in that test file's header against it. There is no dependency list here to add it to and no environment here to install it into; creating either is the regression the "Python" section above forbids. Do not invent an expected word without checking it.- Prefer source-backed semantic anchors: in-image symbol lookup, string xrefs, local call-flow, and XNU correlation. Do not depend on repo-exported per-kernel symbol dumps at runtime.- When retargeting a patch, write the reveal procedure and validation steps into the relevant research doc or commit notes before handing off for testing. Do not create `TODO.md`.-- For `patchBsdInitAuth` (`Kernel/JailbreakPatches/Storage/KernelJailbreakPatchBsdInitAuth.swift`, named `patch_bsd_init_auth` in the research docs) specifically, the allowed reveal flow is: recover `bsd_init` -> locate rootvp panic block -> find the unique in-function `call` -> `cbnz w0/x0, panic` -> `bl imageboot_needed` site -> patch the branch gate only.+- For `patchBsdInitAuth` (`Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchBsdInitAuth.swift`, named `patch_bsd_init_auth` in the research docs) specifically, the allowed reveal flow is: recover `bsd_init` -> locate rootvp panic block -> find the unique in-function `call` -> `cbnz w0/x0, panic` -> `bl imageboot_needed` site -> patch the branch gate only.## Build & Signdiff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.mdindex ea7d7dd9..9a9a1c85 100644--- a/Research/0_binary_patch_comparison.md+++ b/Research/0_binary_patch_comparison.md@@ -3,7 +3,7 @@> **Patch sets and presets (2026-09-28):** every patch is now *declared*, and> selection happens before any byte is written. The declarations live in nine> bundled patch sets under `VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/`-> (`bootchain`, `kernel.base`, `kernel.jailbreak`, `kernel.hypervisor`,+> (`bootchain`, `kernel.base`, `kernel.cfw`, `kernel.hypervisor`,> `kernel.frida`, `devicetree`, `guest.system`, `guest.display`,> `guest.identity`), listed by `FirmwarePatchSetCatalog`. A declaration's> identifier is the record identifier the patcher already emits, or the commondiff --git a/Research/KernelJailbreakPatches/26.5_jb_hook_fixes.md b/Research/KernelCustomFirmwarePatches/26.5_jb_hook_fixes.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/26.5_jb_hook_fixes.mdrename to Research/KernelCustomFirmwarePatches/26.5_jb_hook_fixes.mddiff --git a/Research/KernelJailbreakPatches/PATCH_DOC_FRAMEWORK.md b/Research/KernelCustomFirmwarePatches/PATCH_DOC_FRAMEWORK.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/PATCH_DOC_FRAMEWORK.mdrename to Research/KernelCustomFirmwarePatches/PATCH_DOC_FRAMEWORK.mddiff --git a/Research/KernelJailbreakPatches/README.md b/Research/KernelCustomFirmwarePatches/README.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/README.mdrename to Research/KernelCustomFirmwarePatches/README.mddiff --git a/Research/KernelJailbreakPatches/RuntimeVerification/README.md b/Research/KernelCustomFirmwarePatches/RuntimeVerification/README.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/RuntimeVerification/README.mdrename to Research/KernelCustomFirmwarePatches/RuntimeVerification/README.mddiff --git a/Research/KernelJailbreakPatches/RuntimeVerification/ida_patch_chain_report.md b/Research/KernelCustomFirmwarePatches/RuntimeVerification/ida_patch_chain_report.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/RuntimeVerification/ida_patch_chain_report.mdrename to Research/KernelCustomFirmwarePatches/RuntimeVerification/ida_patch_chain_report.mddiff --git a/Research/KernelJailbreakPatches/RuntimeVerification/runtime_verification_summary.md b/Research/KernelCustomFirmwarePatches/RuntimeVerification/runtime_verification_summary.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/RuntimeVerification/runtime_verification_summary.mdrename to Research/KernelCustomFirmwarePatches/RuntimeVerification/runtime_verification_summary.mddiff --git a/Research/KernelJailbreakPatches/patch_amfi_cdhash_in_trustcache.md b/Research/KernelCustomFirmwarePatches/patch_amfi_cdhash_in_trustcache.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_amfi_cdhash_in_trustcache.mdrename to Research/KernelCustomFirmwarePatches/patch_amfi_cdhash_in_trustcache.mddiff --git a/Research/KernelJailbreakPatches/patch_amfi_execve_kill_path.md b/Research/KernelCustomFirmwarePatches/patch_amfi_execve_kill_path.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_amfi_execve_kill_path.mdrename to Research/KernelCustomFirmwarePatches/patch_amfi_execve_kill_path.mddiff --git a/Research/KernelJailbreakPatches/patch_bsd_init_auth.md b/Research/KernelCustomFirmwarePatches/patch_bsd_init_auth.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_bsd_init_auth.mdrename to Research/KernelCustomFirmwarePatches/patch_bsd_init_auth.mddiff --git a/Research/KernelJailbreakPatches/patch_convert_port_to_map.md b/Research/KernelCustomFirmwarePatches/patch_convert_port_to_map.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_convert_port_to_map.mdrename to Research/KernelCustomFirmwarePatches/patch_convert_port_to_map.mddiff --git a/Research/KernelJailbreakPatches/patch_cred_label_update_execve.md b/Research/KernelCustomFirmwarePatches/patch_cred_label_update_execve.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_cred_label_update_execve.mdrename to Research/KernelCustomFirmwarePatches/patch_cred_label_update_execve.mddiff --git a/Research/KernelJailbreakPatches/patch_dounmount.md b/Research/KernelCustomFirmwarePatches/patch_dounmount.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_dounmount.mdrename to Research/KernelCustomFirmwarePatches/patch_dounmount.mddiff --git a/Research/KernelJailbreakPatches/patch_hook_cred_label_update_execve.md b/Research/KernelCustomFirmwarePatches/patch_hook_cred_label_update_execve.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_hook_cred_label_update_execve.mdrename to Research/KernelCustomFirmwarePatches/patch_hook_cred_label_update_execve.mddiff --git a/Research/KernelJailbreakPatches/patch_io_secure_bsd_root.md b/Research/KernelCustomFirmwarePatches/patch_io_secure_bsd_root.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_io_secure_bsd_root.mdrename to Research/KernelCustomFirmwarePatches/patch_io_secure_bsd_root.mddiff --git a/Research/KernelJailbreakPatches/patch_iouc_failed_macf.md b/Research/KernelCustomFirmwarePatches/patch_iouc_failed_macf.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_iouc_failed_macf.mdrename to Research/KernelCustomFirmwarePatches/patch_iouc_failed_macf.mddiff --git a/Research/KernelJailbreakPatches/patch_kcall10.md b/Research/KernelCustomFirmwarePatches/patch_kcall10.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_kcall10.mdrename to Research/KernelCustomFirmwarePatches/patch_kcall10.mddiff --git a/Research/KernelJailbreakPatches/patch_load_dylinker.md b/Research/KernelCustomFirmwarePatches/patch_load_dylinker.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_load_dylinker.mdrename to Research/KernelCustomFirmwarePatches/patch_load_dylinker.mddiff --git a/Research/KernelJailbreakPatches/patch_mac_mount.md b/Research/KernelCustomFirmwarePatches/patch_mac_mount.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_mac_mount.mdrename to Research/KernelCustomFirmwarePatches/patch_mac_mount.mddiff --git a/Research/KernelJailbreakPatches/patch_nvram_verify_permission.md b/Research/KernelCustomFirmwarePatches/patch_nvram_verify_permission.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_nvram_verify_permission.mdrename to Research/KernelCustomFirmwarePatches/patch_nvram_verify_permission.mddiff --git a/Research/KernelJailbreakPatches/patch_post_validation_additional.md b/Research/KernelCustomFirmwarePatches/patch_post_validation_additional.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_post_validation_additional.mdrename to Research/KernelCustomFirmwarePatches/patch_post_validation_additional.mddiff --git a/Research/KernelJailbreakPatches/patch_proc_pidinfo.md b/Research/KernelCustomFirmwarePatches/patch_proc_pidinfo.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_proc_pidinfo.mdrename to Research/KernelCustomFirmwarePatches/patch_proc_pidinfo.mddiff --git a/Research/KernelJailbreakPatches/patch_proc_security_policy.md b/Research/KernelCustomFirmwarePatches/patch_proc_security_policy.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_proc_security_policy.mdrename to Research/KernelCustomFirmwarePatches/patch_proc_security_policy.mddiff --git a/Research/KernelJailbreakPatches/patch_sandbox_hooks_extended.md b/Research/KernelCustomFirmwarePatches/patch_sandbox_hooks_extended.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_sandbox_hooks_extended.mdrename to Research/KernelCustomFirmwarePatches/patch_sandbox_hooks_extended.mddiff --git a/Research/KernelJailbreakPatches/patch_shared_region_map.md b/Research/KernelCustomFirmwarePatches/patch_shared_region_map.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_shared_region_map.mdrename to Research/KernelCustomFirmwarePatches/patch_shared_region_map.mddiff --git a/Research/KernelJailbreakPatches/patch_spawn_validate_persona.md b/Research/KernelCustomFirmwarePatches/patch_spawn_validate_persona.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_spawn_validate_persona.mdrename to Research/KernelCustomFirmwarePatches/patch_spawn_validate_persona.mddiff --git a/Research/KernelJailbreakPatches/patch_syscallmask_apply_to_proc.md b/Research/KernelCustomFirmwarePatches/patch_syscallmask_apply_to_proc.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_syscallmask_apply_to_proc.mdrename to Research/KernelCustomFirmwarePatches/patch_syscallmask_apply_to_proc.mddiff --git a/Research/KernelJailbreakPatches/patch_task_conversion_eval_internal.md b/Research/KernelCustomFirmwarePatches/patch_task_conversion_eval_internal.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_task_conversion_eval_internal.mdrename to Research/KernelCustomFirmwarePatches/patch_task_conversion_eval_internal.mddiff --git a/Research/KernelJailbreakPatches/patch_task_for_pid.md b/Research/KernelCustomFirmwarePatches/patch_task_for_pid.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_task_for_pid.mdrename to Research/KernelCustomFirmwarePatches/patch_task_for_pid.mddiff --git a/Research/KernelJailbreakPatches/patch_thid_should_crash.md b/Research/KernelCustomFirmwarePatches/patch_thid_should_crash.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_thid_should_crash.mdrename to Research/KernelCustomFirmwarePatches/patch_thid_should_crash.mddiff --git a/Research/KernelJailbreakPatches/patch_thread_set_state.md b/Research/KernelCustomFirmwarePatches/patch_thread_set_state.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_thread_set_state.mdrename to Research/KernelCustomFirmwarePatches/patch_thread_set_state.mddiff --git a/Research/KernelJailbreakPatches/patch_vm_fault_enter_prepare.md b/Research/KernelCustomFirmwarePatches/patch_vm_fault_enter_prepare.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_vm_fault_enter_prepare.mdrename to Research/KernelCustomFirmwarePatches/patch_vm_fault_enter_prepare.mddiff --git a/Research/KernelJailbreakPatches/patch_vm_map_delete_immutable_code.md b/Research/KernelCustomFirmwarePatches/patch_vm_map_delete_immutable_code.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_vm_map_delete_immutable_code.mdrename to Research/KernelCustomFirmwarePatches/patch_vm_map_delete_immutable_code.mddiff --git a/Research/KernelJailbreakPatches/patch_vm_map_protect.md b/Research/KernelCustomFirmwarePatches/patch_vm_map_protect.mdsimilarity index 100%rename from Research/KernelJailbreakPatches/patch_vm_map_protect.mdrename to Research/KernelCustomFirmwarePatches/patch_vm_map_protect.mddiff --git a/Research/README.md b/Research/README.mdindex cfdfc801..745dfe2e 100644--- a/Research/README.md+++ b/Research/README.md@@ -8,7 +8,7 @@ This directory keeps the evidence behind firmware patches, restore and the self-1. [Patch comparison](0_binary_patch_comparison.md) is the canonical per-component inventory. Its regular/dev/exp columns are historical.2. [Firmware manifest and origins](Firmware/firmware_manifest_and_origins.md) explains the hybrid firmware inputs.-3. [JB kernel patch notes](Kernel/kernel_jb_patch_notes.md) and the [individual patch index](KernelJailbreakPatches/README.md) lead to the kernel evidence.+3. [CFW kernel patch notes](Kernel/kernel_jb_patch_notes.md) and the [individual patch index](KernelCustomFirmwarePatches/README.md) lead to the kernel evidence.4. [Native restore design](Restore/native_restore_architecture.md) and [self-contained runtime](Host/runtime_dependency_tiers.md) explain the host migration.## By subject@@ -16,7 +16,7 @@ This directory keeps the evidence behind firmware patches, restore and the self-| Subject | Notes || --- | --- || Firmware and boot chain | [Manifest and origins](Firmware/firmware_manifest_and_origins.md), [iBoot patches](Firmware/iboot_patches.md), [TXM full chain](Firmware/txm_fullchain_analysis.md), [TXM JB patches](Firmware/txm_jb_patches.md), [selector 24](Firmware/txm_selector24_analysis.md), [variant differences](Firmware/txm_variant_diff.md) |-| Kernel | [JB overview](Kernel/kernel_jb_patch_notes.md), [patcher verification](Kernel/kernel_patcher_verification.md), [FairPlay kexts](Kernel/kernel_fairplay_kexts.md), [base validation 1–5](Kernel/kernel_patch_base_first5_validation.md), [11–15](Kernel/kernel_patch_base_11_15_validation.md), [16–20](Kernel/kernel_patch_base_16_20_validation.md), [sandbox hooks](Kernel/kernel_patch_sandbox_hooks_17_26_validation.md), [individual patch notes](KernelJailbreakPatches/README.md) |+| Kernel | [CFW overview](Kernel/kernel_jb_patch_notes.md), [patcher verification](Kernel/kernel_patcher_verification.md), [FairPlay kexts](Kernel/kernel_fairplay_kexts.md), [base validation 1–5](Kernel/kernel_patch_base_first5_validation.md), [11–15](Kernel/kernel_patch_base_11_15_validation.md), [16–20](Kernel/kernel_patch_base_16_20_validation.md), [sandbox hooks](Kernel/kernel_patch_sandbox_hooks_17_26_validation.md), [individual patch notes](KernelCustomFirmwarePatches/README.md) || Other patches and captures | [Launchd jetsam](Patches/cfw_patch_launchd_jetsam.md), [user-mode hypervisor references](Patches/hv_vmm_present_usermode_xrefs.md), [reference capture](Patches/patch_reference_capture.md) || Restore | [DFU probe](Restore/virtual_dfu_probe.md), [in-process restore](Restore/native_restore_architecture.md) || Host and archives | [Binary split](Host/host_binary_split.md), [runtime dependency tiers](Host/runtime_dependency_tiers.md), [archive extraction contracts](Host/archive_extraction_contracts.md), [libarchive validation](Host/libarchive_xcframework_validation.md) |diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/DyldSharedCacheCodeSignature.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/DyldSharedCacheCodeSignature.swiftindex 0b700c29..6cdc9c04 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/DyldSharedCacheCodeSignature.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/DyldSharedCacheCodeSignature.swift@@ -27,8 +27,8 @@// Side effect, by design// ----------------------// Rewriting slot hashes changes the code directory's contents and therefore its-// cdHash. That is only survivable because the JB kernel patch-// `patch_amfi_cdhash_in_trustcache` — `KernelJailbreakPatchAmfiTrustcache` in this+// cdHash. That is only survivable because the CFW kernel patch+// `patch_amfi_cdhash_in_trustcache` — `KernelCustomFirmwarePatchAmfiTrustcache` in this// repo — short-circuits AMFI's per-image trust-cache lookup to return 1. This// file must not be used on a firmware that does not carry that patch.//diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHypervisorVirtualMachinePatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHypervisorVirtualMachinePatcher.swiftindex 8a70308c..0ce1204e 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHypervisorVirtualMachinePatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHypervisorVirtualMachinePatcher.swift@@ -418,7 +418,7 @@ public enum DyldSharedCacheHypervisorVirtualMachinePatcher {// without a re-hash is a SIGKILL on the first demand-page-in of that// page, with nothing pointing back at this patch. The CD blob's own// cdHash changes as a side effect; that is survivable only because the- // JB kernel patch `KernelJailbreakPatchAmfiTrustcache` short-circuits AMFI's+ // CFW kernel patch `KernelCustomFirmwarePatchAmfiTrustcache` short-circuits AMFI's// per-image trust-cache lookup.//// The write spans come from `DyldSharedCacheChunkSet` itself rather than from a listdiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swiftindex b056bcd5..200097de 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheIOMFBForceKernPatcher.swift@@ -33,7 +33,7 @@// selected the kern fp — every present call now routes through the kern/method-5// implementation regardless of how iOS 27 classified the display.//-// Companion kernel patch: `KernelJailbreakPatcher.patchIomfbSwapEndVariableSize` /+// Companion kernel patch: `KernelCustomFirmwarePatcher.patchIomfbSwapEndVariableSize` /// `…HandlerSize`, which make the 26.4 userclient accept iOS 27's native 0x6e0// SwapEnd struct (26.x sent 0x588). Both halves are required together — forcing// kern without the kernel size-accept makes method 5 returndiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/IBoot/IBootJailbreakPatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/IBoot/IBootCustomFirmwarePatcher.swiftsimilarity index 93%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/IBoot/IBootJailbreakPatcher.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/IBoot/IBootCustomFirmwarePatcher.swiftindex e1bd97ab..e8c3e6eb 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/IBoot/IBootJailbreakPatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/IBoot/IBootCustomFirmwarePatcher.swift@@ -1,16 +1,16 @@-// IBootJailbreakPatcher.swift — JB-variant iBoot patcher (nonce bypass).+// IBootCustomFirmwarePatcher.swift — CFW-variant iBoot patcher (nonce bypass).//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-/// JB-variant patcher for iBoot images.+/// CFW-variant patcher for iBoot images.////// Adds iBSS-only patches:/// 1. patchSkipGenerateNonce — locate "boot-nonce" ADRP+ADD refs, find/// tbz w0, #0, <target> / mov w0, #0 / bl pattern, convert tbz → b <target>-public final class IBootJailbreakPatcher: IBootPatcher {+public final class IBootCustomFirmwarePatcher: IBootPatcher {override public func findAll() throws -> [PatchRecord] {patches = []if mode == .ibss {@@ -19,7 +19,7 @@ public final class IBootJailbreakPatcher: IBootPatcher {return patches}- // MARK: - JB Patches+ // MARK: - CFW Patches@discardableResultfunc patchSkipGenerateNonce() -> Bool {@@ -28,7 +28,7 @@ public final class IBootJailbreakPatcher: IBootPatcher {if stringOffsets.isEmpty {if verbose {- print(" [-] iBSS JB: no refs to 'boot-nonce'")+ print(" [-] iBSS CFW:no refs to 'boot-nonce'")}return false}@@ -46,7 +46,7 @@ public final class IBootJailbreakPatcher: IBootPatcher {if addOffsets.isEmpty {if verbose {- print(" [-] iBSS JB: no ADRP+ADD refs to 'boot-nonce'")+ print(" [-] iBSS CFW:no ADRP+ADD refs to 'boot-nonce'")}return false}@@ -104,7 +104,7 @@ public final class IBootJailbreakPatcher: IBootPatcher {guard let patchBytes = ARM64Encoder.encodeB(from: scan, to: target) else {if verbose {- print(String(format: " [-] iBSS JB: encodeB out of range at 0x%X → 0x%X", scan, target))+ print(String(format: " [-] iBSS CFW:encodeB out of range at 0x%X → 0x%X", scan, target))}scan += 4continue@@ -124,7 +124,7 @@ public final class IBootJailbreakPatcher: IBootPatcher {patchedBytes: patchBytes,beforeDisasm: beforeStr,afterDisasm: afterStr,- description: "JB: skip generate_nonce",+ description: "CFW: skip generate_nonce",)patches.append(record)@@ -141,7 +141,7 @@ public final class IBootJailbreakPatcher: IBootPatcher {}if verbose {- print(" [-] iBSS JB: generate_nonce branch pattern not found")+ print(" [-] iBSS CFW:generate_nonce branch pattern not found")}return false}diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchAmfiExecve.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchAmfiExecve.swiftsimilarity index 95%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchAmfiExecve.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchAmfiExecve.swiftindex 920711d0..e7da98fc 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchAmfiExecve.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchAmfiExecve.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchAmfiExecve.swift — JB kernel patch: AMFI execve kill path bypass (disabled)+// KernelCustomFirmwarePatchAmfiExecve.swift — CFW kernel patch: AMFI execve kill path bypass (disabled)//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -14,7 +14,7 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {// MARK: - AMFI execve kill-path bypass (disabled)/// Bypass AMFI execve kill by patching the shared MOV W0,#1 → MOV W0,#0.@@ -27,7 +27,7 @@ extension KernelJailbreakPatcher {/// main Group C dispatcher (matches Python behaviour where it is disabled).@discardableResultfunc patchAmfiExecveKillPath() -> Bool {- log("\n[JB] AMFI execve kill path: shared MOV W0,#1 → MOV W0,#0")+ log("\n[CFW]AMFI execve kill path: shared MOV W0,#1 → MOV W0,#0")// Find "AMFI: hook..execve() killing" or fallback string.let killStr: Stringdiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchAmfiTrustcache.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchAmfiTrustcache.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchAmfiTrustcache.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchAmfiTrustcache.swiftindex 73808705..f4a9ea5a 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchAmfiTrustcache.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchAmfiTrustcache.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchAmfiTrustcache.swift — JB kernel patch: AMFI trustcache gate bypass+// KernelCustomFirmwarePatchAmfiTrustcache.swift — CFW kernel patch: AMFI trustcache gate bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -18,11 +18,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// AMFI trustcache gate bypass: rewrite AMFIIsCDHashInTrustCache to always return 1.@discardableResultfunc patchAmfiCdhashInTrustcache() -> Bool {- log("\n[JB] AMFIIsCDHashInTrustCache: always allow + store flag")+ log("\n[CFW]AMFIIsCDHashInTrustCache: always allow + store flag")// Determine the AMFI text range. Fall back to full __TEXT_EXEC if no kext split.let amfiRange = amfiTextRange()diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchCredLabel.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchCredLabel.swiftsimilarity index 98%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchCredLabel.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchCredLabel.swiftindex 91bbf685..08ce19a5 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchCredLabel.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchCredLabel.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchCredLabel.swift — JB kernel patch: _cred_label_update_execve C21-v3+// KernelCustomFirmwarePatchCredLabel.swift — CFW kernel patch: _cred_label_update_execve C21-v3//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -17,7 +17,7 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {// MARK: - Constantsprivate static let retInsns: Set<UInt32> = [0xD65F_0FFF, 0xD65F_0BFF, 0xD65F_03C0]@@ -30,7 +30,7 @@ extension KernelJailbreakPatcher {/// C21-v3 split exits + helper bits for _cred_label_update_execve.func patchCredLabelUpdateExecve() {- log("\n[JB] _cred_label_update_execve: C21-v3 split exits + helper bits")+ log("\n[CFW]_cred_label_update_execve: C21-v3 split exits + helper bits")// 1. Locate the function.guard let funcOff = locateCredLabelExecveFunc() else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchHookCredLabel.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchHookCredLabel.swiftsimilarity index 98%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchHookCredLabel.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchHookCredLabel.swiftindex 3ae697d9..60b5c3eb 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchHookCredLabel.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchHookCredLabel.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchHookCredLabel.swift — JB kernel patch: Faithful upstream C23 hook+// KernelCustomFirmwarePatchHookCredLabel.swift — CFW kernel patch: Faithful upstream C23 hook//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -17,7 +17,7 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {// MARK: - Constantsprivate static let hookCredLabelIndex = 18@@ -41,7 +41,7 @@ extension KernelJailbreakPatcher {/// Faithful upstream C23: redirect ops[18] to a vnode-getattr trampoline.@discardableResultfunc patchHookCredLabelUpdateExecve() -> Bool {- log("\n[JB] _hook_cred_label_update_execve: faithful upstream C23")+ log("\n[CFW]_hook_cred_label_update_execve: faithful upstream C23")// 1. Find sandbox ops[18] entry and current wrapper target.guard let (opsTable, entryOff, entryRaw, wrapperOff) = findHookCredLabelWrapper() else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchLoadDylinker.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchLoadDylinker.swiftsimilarity index 93%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchLoadDylinker.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchLoadDylinker.swiftindex 7a60ae2e..f4d24186 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchLoadDylinker.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchLoadDylinker.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchLoadDylinker.swift — JB: bypass load_dylinker policy gate in the dyld path.+// KernelCustomFirmwarePatchLoadDylinker.swift — CFW: bypass load_dylinker policy gate in the dyld path.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -9,11 +9,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Bypass the load_dylinker policy gate in the dyld path.@discardableResultfunc patchLoadDylinker() -> Bool {- log("\n[JB] _load_dylinker: skip dyld policy check")+ log("\n[CFW]_load_dylinker: skip dyld policy check")guard let strOff = buffer.findString("/usr/lib/dyld") else {log(" [-] '/usr/lib/dyld' string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchPostValidation.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchPostValidation.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchPostValidation.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchPostValidation.swiftindex 5a0dda85..df2a996f 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/CodeSigning/KernelJailbreakPatchPostValidation.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/CodeSigning/KernelCustomFirmwarePatchPostValidation.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchPostValidation.swift — JB: additional post-validation cmp w0,w0 bypass.+// KernelCustomFirmwarePatchPostValidation.swift — CFW: additional post-validation cmp w0,w0 bypass.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -9,11 +9,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Patch: rewrite the SHA256-only reject compare in AMFI's post-validation path.@discardableResultfunc patchPostValidationAdditional() -> Bool {- log("\n[JB] postValidation additional: cmp w0,w0")+ log("\n[CFW]postValidation additional: cmp w0,w0")guard let strOff = buffer.findString("AMFI: code signature validation failed") else {log(" [-] string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Drivers/KernelJailbreakPatchIomfbSwap.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchIomfbSwap.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Drivers/KernelJailbreakPatchIomfbSwap.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchIomfbSwap.swiftindex 67eea37b..98c82859 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Drivers/KernelJailbreakPatchIomfbSwap.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchIomfbSwap.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchIomfbSwap.swift — JB kernel patch: make the IOMobileFramebuffer+// KernelCustomFirmwarePatchIomfbSwap.swift — CFW kernel patch: make the IOMobileFramebuffer// SwapEnd userclient accept the caller's native swap-struct size.//// Background: iOS 27's `_kern_SwapEnd` sends a 0x6e0-byte IOMFBSwapRec, but the@@ -29,7 +29,7 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {private static let swapEndExpectedSize: UInt32 = 0x588 // 26.4 kernel's native SwapEnd struct sizeprivate static let swapEndIOS27Size: UInt32 = 0x6E0 // iOS 27's native IOMFBSwapRec sizeprivate static let kIOUCVariableStructureSize: UInt32 = 0xFFFF_FFFF@@ -46,7 +46,7 @@ extension KernelJailbreakPatcher {/// the imm12 field is rewritten, preserving the rest of the instruction.@discardableResultfunc patchIomfbSwapEndHandlerSize() -> Bool {- log("\n[JB] IOMFB swap_submit handler size gate cmp w2,#0x588 -> #0x6e0 (accept iOS 27 native struct)")+ log("\n[CFW]IOMFB swap_submit handler size gate cmp w2,#0x588 -> #0x6e0 (accept iOS 27 native struct)")guard let (ks, ke) = kernTextRange else {log(" [-] no kernel text range")@@ -94,7 +94,7 @@ extension KernelJailbreakPatcher {@discardableResultfunc patchIomfbSwapEndVariableSize() -> Bool {- log("\n[JB] IOMFB SwapEnd dispatch checkStructureInputSize -> variable (accept iOS 27 native struct)")+ log("\n[CFW]IOMFB SwapEnd dispatch checkStructureInputSize -> variable (accept iOS 27 native struct)")guard let seg = segments.first(where: { $0.name == "__DATA_CONST" }), seg.fileSize > 0 else {log(" [-] no __DATA_CONST segment")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Drivers/KernelJailbreakPatchNvram.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchNvram.swiftsimilarity index 92%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Drivers/KernelJailbreakPatchNvram.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchNvram.swiftindex 4432430e..27e60813 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Drivers/KernelJailbreakPatchNvram.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchNvram.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchNvram.swift — JB kernel patch: NVRAM permission bypass+// KernelCustomFirmwarePatchNvram.swift — CFW kernel patch: NVRAM permission bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// NOP the verifyPermission gate in the `krn.` key-prefix path.////// Runtime reveal is string-anchored only: enumerate code refs to `"krn."`,@@ -13,7 +13,7 @@ extension KernelJailbreakPatcher {/// `tbz/tbnz` guard immediately before that key-prefix load sequence.@discardableResultfunc patchNvramVerifyPermission() -> Bool {- log("\n[JB] verifyPermission (NVRAM): NOP")+ log("\n[CFW]verifyPermission (NVRAM): NOP")guard let strOff = buffer.findString("krn.") else {log(" [-] 'krn.' string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Frida/KernelJailbreakPatchThreadSetState.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Frida/KernelCustomFirmwarePatchThreadSetState.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Frida/KernelJailbreakPatchThreadSetState.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Frida/KernelCustomFirmwarePatchThreadSetState.swiftindex 22a608c1..559de7a0 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Frida/KernelJailbreakPatchThreadSetState.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Frida/KernelCustomFirmwarePatchThreadSetState.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchThreadSetState.swift — optional Frida Stalker support.+// KernelCustomFirmwarePatchThreadSetState.swift — optional Frida Stalker support.//// Declared as `kernel-exp-frida_thread_set_state_entitlement_flag`, off in// `standard`.@@ -6,12 +6,12 @@// Frida follows an existing thread via thread_set_state_from_user, whose flags// carry TSSF_CHECK_ENTITLEMENT and trip GUARD_TYPE_MACH_PORT. Clear that bit in the// user setters (`mov w6,#0x201` → `mov w6,#0x1`) rather than the check itself.-// Reveal + validation: Research/KernelJailbreakPatches/patch_thread_set_state.md.+// Reveal + validation: Research/KernelCustomFirmwarePatches/patch_thread_set_state.md.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {private static let tssEntitlement = "com.apple.private.thread-set-state"// TSSF_TRANSLATE_TO_USER (0x1) | TSSF_CHECK_ENTITLEMENT (0x200).private static let tssFlagsFromUser: Int64 = 0x201diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Frida/KernelJailbreakPatchVmMapDelete.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Frida/KernelCustomFirmwarePatchVmMapDelete.swiftsimilarity index 97%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Frida/KernelJailbreakPatchVmMapDelete.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Frida/KernelCustomFirmwarePatchVmMapDelete.swiftindex dc71f8ba..c579adad 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Frida/KernelJailbreakPatchVmMapDelete.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Frida/KernelCustomFirmwarePatchVmMapDelete.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchVmMapDelete.swift — optional Frida Stalker support.+// KernelCustomFirmwarePatchVmMapDelete.swift — optional Frida Stalker support.//// Declared as `kernel-exp-frida_vm_map_delete_immutable_code`, off in `standard`.//@@ -6,12 +6,12 @@// vm_map_delete's immutable-code exception tests current-protection EXECUTE, which// is clear, so re-instrumentation fails with KERN_PROTECTION_FAILURE. Retarget the// test from current-X (packed [entry,#0x38] bit 9) to max-X (bit 13).-// Reveal + validation: Research/KernelJailbreakPatches/patch_vm_map_delete_immutable_code.md.+// Reveal + validation: Research/KernelCustomFirmwarePatches/patch_vm_map_delete_immutable_code.md.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {private struct VmMapDeleteGate {let offset: Intlet register: UInt32diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchPortToMap.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchPortToMap.swiftsimilarity index 92%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchPortToMap.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchPortToMap.swiftindex 92ad0613..10650dfd 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchPortToMap.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchPortToMap.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchPortToMap.swift — JB: skip kernel-map panic in _convert_port_to_map_with_flavor.+// KernelCustomFirmwarePatchPortToMap.swift — CFW: skip kernel-map panic in _convert_port_to_map_with_flavor.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -9,11 +9,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Skip kernel-map panic in _convert_port_to_map_with_flavor.@discardableResultfunc patchConvertPortToMap() -> Bool {- log("\n[JB] _convert_port_to_map_with_flavor: skip panic")+ log("\n[CFW]_convert_port_to_map_with_flavor: skip panic")guard let strOff = buffer.findString("userspace has control access to a kernel map") else {log(" [-] panic string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchSharedRegion.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchSharedRegion.swiftsimilarity index 94%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchSharedRegion.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchSharedRegion.swiftindex c67708a7..53b65105 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchSharedRegion.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchSharedRegion.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchSharedRegion.swift — JB kernel patch: Shared region map bypass+// KernelCustomFirmwarePatchSharedRegion.swift — CFW kernel patch: Shared region map bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Force `cmp x0, x0` in the root-vs-preboot gate of/// `_shared_region_map_and_slide_setup`.///@@ -14,7 +14,7 @@ extension KernelJailbreakPatcher {/// sequence just before the string reference.@discardableResultfunc patchSharedRegionMap() -> Bool {- log("\n[JB] _shared_region_map_and_slide_setup: upstream cmp x0,x0")+ log("\n[CFW]_shared_region_map_and_slide_setup: upstream cmp x0,x0")guard let strOff = buffer.findString("/private/preboot/Cryptexes") else {log(" [-] Cryptexes string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchVmFault.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchVmFault.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchVmFault.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchVmFault.swiftindex 85ea00f8..018f7547 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchVmFault.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchVmFault.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchVmFault.swift — JB kernel patch: VM fault enter prepare bypass+// KernelCustomFirmwarePatchVmFault.swift — CFW kernel patch: VM fault enter prepare bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Force the upstream cs_bypass fast-path in `_vm_fault_enter_prepare`.////// Expected semantic shape:@@ -17,7 +17,7 @@ extension KernelJailbreakPatcher {/// NOPing the TBZ forces the fast-path unconditionally.@discardableResultfunc patchVmFaultEnterPrepare() -> Bool {- log("\n[JB] _vm_fault_enter_prepare: NOP")+ log("\n[CFW]_vm_fault_enter_prepare: NOP")var candidateFuncs: [Int] = []diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchVmProtect.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchVmProtect.swiftsimilarity index 98%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchVmProtect.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchVmProtect.swiftindex 7b16ddbf..da7c7995 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Memory/KernelJailbreakPatchVmProtect.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Memory/KernelCustomFirmwarePatchVmProtect.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchVmProtect.swift — JB kernel patch: VM map protect W^X bypass+// KernelCustomFirmwarePatchVmProtect.swift — CFW kernel patch: VM map protect W^X bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -39,11 +39,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Bypass the vm_map_protect W^X downgrade so write+execute protections are honored.@discardableResultfunc patchVmMapProtect() -> Bool {- log("\n[JB] _vm_map_protect: bypass W^X downgrade")+ log("\n[CFW]_vm_map_protect: bypass W^X downgrade")// Recover the function from the in-kernel "vm_map_protect(" panic string.guard let strOff = buffer.findString("vm_map_protect(") else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchKcall10.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchKcall10.swiftsimilarity index 98%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchKcall10.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchKcall10.swiftindex 52a39526..9c894ef4 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchKcall10.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchKcall10.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchKcall10.swift — JB kernel patch: kcall10 ABI-correct sysent[439] cave+// KernelCustomFirmwarePatchKcall10.swift — CFW kernel patch: kcall10 ABI-correct sysent[439] cave//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -14,7 +14,7 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {// MARK: - Constantsprivate static let sysent_max_entries = 558@@ -32,7 +32,7 @@ extension KernelJailbreakPatcher {/// ABI-correct kcall10 patch: install a sysent[439] cave.@discardableResultfunc patchKcall10() -> Bool {- log("\n[JB] kcall10: ABI-correct sysent[439] cave")+ log("\n[CFW]kcall10: ABI-correct sysent[439] cave")// 1. Find sysent table base (structural; this kernel is symbol-stripped).guard let sysEntOff = findSysentTable() else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchProcPidinfo.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchProcPidinfo.swiftsimilarity index 94%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchProcPidinfo.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchProcPidinfo.swiftindex b6796757..c9d92e95 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchProcPidinfo.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchProcPidinfo.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchProcPidinfo.swift — JB: NOP the two early pid-0 guards in proc_pidinfo.+// KernelCustomFirmwarePatchProcPidinfo.swift — CFW: NOP the two early pid-0 guards in proc_pidinfo.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -20,11 +20,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Bypass the two early pid-0 guards in the inlined proc_pidinfo path.@discardableResultfunc patchProcPidinfo() -> Bool {- log("\n[JB] _proc_pidinfo: NOP pid-0 guard (2 sites)")+ log("\n[CFW]_proc_pidinfo: NOP pid-0 guard (2 sites)")guard let (ks, ke) = kernTextRange else {log(" [-] kernel __TEXT_EXEC range not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchSpawnPersona.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchSpawnPersona.swiftsimilarity index 97%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchSpawnPersona.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchSpawnPersona.swiftindex 8cb79c60..f2ed57c3 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchSpawnPersona.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchSpawnPersona.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchSpawnPersona.swift — JB kernel patch: Spawn validate persona bypass+// KernelCustomFirmwarePatchSpawnPersona.swift — CFW kernel patch: Spawn validate persona bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// NOP the upstream dual-CBZ bypass in the persona helper.////// 1. Recover the outer spawn policy function from@@ -16,7 +16,7 @@ extension KernelJailbreakPatcher {/// 4. NOP both `cbz` guards.@discardableResultfunc patchSpawnValidatePersona() -> Bool {- log("\n[JB] _spawn_validate_persona: upstream dual-CBZ bypass")+ log("\n[CFW]_spawn_validate_persona: upstream dual-CBZ bypass")guard let strOff = buffer.findString("com.apple.private.spawn-panic-crash-behavior") else {log(" [-] spawn entitlement anchor not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchSyscallmask.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchSyscallmask.swiftsimilarity index 98%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchSyscallmask.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchSyscallmask.swiftindex 70504ebe..b4f1c1f1 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchSyscallmask.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchSyscallmask.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchSyscallmask.swift — JB kernel patch: syscallmask C22 apply-to-proc+// KernelCustomFirmwarePatchSyscallmask.swift — CFW kernel patch: syscallmask C22 apply-to-proc//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -18,7 +18,7 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {// MARK: - Constantsprivate static let syscallmaskFFBlobSize = 0x100@@ -28,7 +28,7 @@ extension KernelJailbreakPatcher {/// Retargeted C22 patch: syscallmask apply to proc.@discardableResultfunc patchSyscallmaskApplyToProc() -> Bool {- log("\n[JB] _syscallmask_apply_to_proc: retargeted upstream C22")+ log("\n[CFW]_syscallmask_apply_to_proc: retargeted upstream C22")// 1. Find the low-level apply wrapper.guard let funcOff = findSyscallmaskApplyFunc() else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchTaskConversion.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchTaskConversion.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchTaskConversion.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchTaskConversion.swiftindex f118948b..95e6799b 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchTaskConversion.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchTaskConversion.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchTaskConversion.swift — JB kernel patch: Task conversion eval bypass+// KernelCustomFirmwarePatchTaskConversion.swift — CFW kernel patch: Task conversion eval bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -24,11 +24,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Task conversion eval bypass: patch the guard CMP to always be equal.@discardableResultfunc patchTaskConversionEvalInternal() -> Bool {- log("\n[JB] task_conversion_eval_internal: cmp xzr,xzr")+ log("\n[CFW]task_conversion_eval_internal: cmp xzr,xzr")guard let range = kernTextRange ?? codeRanges.first.map({ ($0.start, $0.end) }) else {return falsediff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchTaskForPid.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchTaskForPid.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchTaskForPid.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchTaskForPid.swiftindex 941a222b..00477354 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchTaskForPid.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchTaskForPid.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchTaskForPid.swift — JB kernel patch: task_for_pid bypass+// KernelCustomFirmwarePatchTaskForPid.swift — CFW kernel patch: task_for_pid bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// NOP the upstream early `pid == 0` reject gate in `task_for_pid`.////// Anchor: `proc_ro_ref_task` string → enclosing function.@@ -22,7 +22,7 @@ extension KernelJailbreakPatcher {/// cbz x0, fail (same fail target)@discardableResultfunc patchTaskForPid() -> Bool {- log("\n[JB] _task_for_pid: upstream pid==0 gate NOP")+ log("\n[CFW]_task_for_pid: upstream pid==0 gate NOP")guard let strOff = buffer.findString("proc_ro_ref_task") else {log(" [-] task_for_pid anchor function not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchThidCrash.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchThidCrash.swiftsimilarity index 93%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchThidCrash.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchThidCrash.swiftindex d38f7432..255d5391 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Process/KernelJailbreakPatchThidCrash.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Process/KernelCustomFirmwarePatchThidCrash.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchThidCrash.swift — JB kernel patch: thid_should_crash bypass+// KernelCustomFirmwarePatchThidCrash.swift — CFW kernel patch: thid_should_crash bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Zero out `_thid_should_crash` via the nearby sysctl metadata.////// The raw PCC 26.1 kernels do not provide a usable runtime symbol table,@@ -13,7 +13,7 @@ extension KernelJailbreakPatcher {/// `thid_should_crash` and the adjacent `sysctl_oid` data.@discardableResultfunc patchThidShouldCrash() -> Bool {- log("\n[JB] _thid_should_crash: zero out")+ log("\n[CFW]_thid_should_crash: zero out")guard let strOff = buffer.findString("thid_should_crash") else {log(" [-] string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchContainerUpcall.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchContainerUpcall.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchContainerUpcall.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchContainerUpcall.swiftindex d01cbea2..4f0f422e 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchContainerUpcall.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchContainerUpcall.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchContainerUpcall.swift — JB kernel patch: force the sandbox exec-time+// KernelCustomFirmwarePatchContainerUpcall.swift — CFW kernel patch: force the sandbox exec-time// container-manager upcall onto its success path (neutralize the autobox / kill).//// At exec, the sandbox hook `_hook_cred_label_update_execve` resolves each process's@@ -40,10 +40,10 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {@discardableResultfunc patchContainerManagerUpcall() -> Bool {- log("\n[JB] container-manager exec upcall: cbz w0 -> b (force success; skip autobox/temporary-sandbox)")+ log("\n[CFW]container-manager exec upcall: cbz w0 -> b (force success; skip autobox/temporary-sandbox)")guard let strOff = buffer.findString("failed to upcall to containermanagerd") else {log(" [-] 'failed to upcall to containermanagerd' string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchExecPolicyKill.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchExecPolicyKill.swiftsimilarity index 95%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchExecPolicyKill.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchExecPolicyKill.swiftindex c6af8886..4316a454 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchExecPolicyKill.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchExecPolicyKill.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchExecPolicyKill.swift — JB kernel patch: neutralize the exec-time+// KernelCustomFirmwarePatchExecPolicyKill.swift — CFW kernel patch: neutralize the exec-time// MAC-verdict (ip_mac_return) security-policy kill.//// After the MAC exec hooks run, XNU's exec path (kern_exec.c) checks:@@ -31,10 +31,10 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {@discardableResultfunc patchExecSecurityPolicyKill() -> Bool {- log("\n[JB] exec ip_mac_return SECURITY_POLICY kill: cbz -> b (allow)")+ log("\n[CFW]exec ip_mac_return SECURITY_POLICY kill: cbz -> b (allow)")guard let (ks, ke) = kernTextRange else {log(" [-] no kernel text range")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchFpfsScopedOpen.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchFpfsScopedOpen.swiftsimilarity index 93%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchFpfsScopedOpen.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchFpfsScopedOpen.swiftindex dd37d0e6..f1967e6c 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchFpfsScopedOpen.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchFpfsScopedOpen.swift@@ -1,21 +1,21 @@-// KernelJailbreakPatchFpfsScopedOpen.swift — iOS 27 only.+// KernelCustomFirmwarePatchFpfsScopedOpen.swift — iOS 27 only.//-// The JB neuters Sandbox vnode_check_open globally so processes can reach /var/jb. But+// The CFW neuters Sandbox vnode_check_open globally so processes can reach /var/jb. But// FileProvider's fpfs parent-walk needs the stock check to deny at the domain-container// boundary; without it the walk climbs unbounded and ResolverService balloons → jetsam →-// respring. KernelJailbreakPatchSandboxExtended therefore leaves ops[267] un-neutered on 27, and+// respring. KernelCustomFirmwarePatchSandboxExtended therefore leaves ops[267] un-neutered on 27, and// this patch retargets it to a trampoline that runs the real check only for the FileProvider// daemons (matched by p_comm) and returns allow for everyone else — preserving the bypass.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {private static let vnodeCheckOpenIndex = 267@discardableResultfunc patchFpfsScopedVnodeOpen() -> Bool {- log("\n[JB] fpfs: scope vnode_check_open to FileProvider daemons")+ log("\n[CFW]fpfs: scope vnode_check_open to FileProvider daemons")guard let opsTable = findSandboxOpsTableFpfs() else {log(" [-] sandbox ops table not found"); return falsediff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchIoucMacf.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchIoucMacf.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchIoucMacf.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchIoucMacf.swiftindex 6de25991..4683473c 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchIoucMacf.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchIoucMacf.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchIoucMacf.swift — JB kernel patch: IOUC MACF gate bypass+// KernelCustomFirmwarePatchIoucMacf.swift — CFW kernel patch: IOUC MACF gate bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -18,11 +18,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// IOUC MACF gate bypass: replace CBZ W0, <allow> with B <allow>.@discardableResultfunc patchIoucFailedMacf() -> Bool {- log("\n[JB] IOUC MACF gate: branch-level deny bypass")+ log("\n[CFW]IOUC MACF gate: branch-level deny bypass")guard let failStrOff = buffer.findString("IOUC %s failed MACF in process %s") else {log(" [-] IOUC failed-MACF format string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchIoucSandbox.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchIoucSandbox.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchIoucSandbox.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchIoucSandbox.swiftindex 2748fd99..ac7265c6 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchIoucSandbox.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchIoucSandbox.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchIoucSandbox.swift — JB kernel patch: IOUC *sandbox* gate bypass.+// KernelCustomFirmwarePatchIoucSandbox.swift — CFW kernel patch: IOUC *sandbox* gate bypass.//// Sibling to patchIoucFailedMacf. The IOKit user-client open path runs TWO// independent MAC gates: a MACF-aggregator check ("IOUC %s failed MACF in@@ -34,10 +34,10 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {@discardableResultfunc patchIoucFailedSandbox() -> Bool {- log("\n[JB] IOUC sandbox gate: deny-block → allow redirect")+ log("\n[CFW]IOUC sandbox gate: deny-block → allow redirect")guard let failStrOff = buffer.findString("IOUC %s failed sandbox in process %s") else {log(" [-] IOUC failed-sandbox format string not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchMacMount.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchMacMount.swiftsimilarity index 97%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchMacMount.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchMacMount.swiftindex 8ebe87b5..a2ec72b1 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchMacMount.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchMacMount.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatchMacMount.swift — JB kernel patch: MAC mount bypass+// KernelCustomFirmwarePatchMacMount.swift — CFW kernel patch: MAC mount bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Apply the upstream twin bypasses in the mount-role wrapper.////// Patches two sites in the wrapper that decides whether execution can@@ -19,7 +19,7 @@ extension KernelJailbreakPatcher {/// 3. Select the unique caller containing both upstream gates.@discardableResultfunc patchMacMount() -> Bool {- log("\n[JB] ___mac_mount: upstream twin bypass")+ log("\n[CFW]___mac_mount: upstream twin bypass")guard let strOff = buffer.findString("mount_common()") else {log(" [-] mount_common anchor function not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchProcSecurity.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchProcSecurity.swiftsimilarity index 78%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchProcSecurity.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchProcSecurity.swiftindex e592848f..c69aaefd 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchProcSecurity.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchProcSecurity.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchProcSecurity.swift — JB: stub _proc_security_policy with mov x0,#0; ret.+// KernelCustomFirmwarePatchProcSecurity.swift — CFW: stub _proc_security_policy with mov x0,#0; ret.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -6,18 +6,18 @@// authorization gate (bsd/kern/proc_info.c). It is located by its unique// reference to PRIV_GLOBAL_PROC_INFO (1002 = 0x3EA, bsd/sys/priv.h) — the// privilege id handed to priv_check_cred(my_cred, PRIV_GLOBAL_PROC_INFO, 0).-// See KernelJailbreakPatcherBase.findProcSecurityPolicy(). Stubbing its entry to+// See KernelCustomFirmwarePatcherBase.findProcSecurityPolicy(). Stubbing its entry to// `mov x0,#0; ret` forces the gate to allow, so proc-info/proc-control paths-// used by jailbreak userland never hit cross-identity authorization denials.+// used by the custom-firmware userland never hit cross-identity authorization denials.import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Stub _proc_security_policy: mov x0,#0; ret.@discardableResultfunc patchProcSecurityPolicy() -> Bool {- log("\n[JB] _proc_security_policy: mov x0,#0; ret")+ log("\n[CFW]_proc_security_policy: mov x0,#0; ret")guard let policy = findProcSecurityPolicy() else {log(" [-] _proc_security_policy not identified (PRIV_GLOBAL_PROC_INFO anchor)")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchSandboxExtended.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchSandboxExtended.swiftsimilarity index 96%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchSandboxExtended.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchSandboxExtended.swiftindex 65242cb5..09fb161b 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Sandbox/KernelJailbreakPatchSandboxExtended.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Sandbox/KernelCustomFirmwarePatchSandboxExtended.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchSandboxExtended.swift — JB kernel patch: Extended sandbox hooks bypass+// KernelCustomFirmwarePatchSandboxExtended.swift — CFW kernel patch: Extended sandbox hooks bypass//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -15,11 +15,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Extended sandbox hooks bypass: retarget ops entries to the allow stub.@discardableResultfunc patchSandboxHooksExtended() -> Bool {- log("\n[JB] Sandbox extended hooks: retarget ops entries to allow stub")+ log("\n[CFW]Sandbox extended hooks: retarget ops entries to allow stub")guard let opsTable = findSandboxOpsTableViaConf() else {return false@@ -83,7 +83,7 @@ extension KernelJailbreakPatcher {hookIndices.append(("proc_check_syscall_unix", 124))}- // On iOS 27, leave ops[267] real so KernelJailbreakPatchFpfsScopedOpen can retarget it to a+ // On iOS 27, leave ops[267] real so KernelCustomFirmwarePatchFpfsScopedOpen can retarget it to a// FileProvider-scoped trampoline (the fpfs walk needs the stock check as its terminus,// else ResolverService balloons → respring). Neuter it as usual on every other base.if !applyIOS27 {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchBsdInitAuth.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchBsdInitAuth.swiftsimilarity index 97%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchBsdInitAuth.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchBsdInitAuth.swiftindex 94b9b27c..8a6f902a 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchBsdInitAuth.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchBsdInitAuth.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchBsdInitAuth.swift — JB: bypass FSIOC_KERNEL_ROOTAUTH failure in _bsd_init.+// KernelCustomFirmwarePatchBsdInitAuth.swift — CFW: bypass FSIOC_KERNEL_ROOTAUTH failure in _bsd_init.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -16,14 +16,14 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {private static let rootvpAuthNeedle = "rootvp not authenticated after mounting"private static let rootvpAltNeedle = "rootvp not authenticated after mounting @%s:%d"/// Bypass the real rootvp auth failure branch inside _bsd_init.@discardableResultfunc patchBsdInitAuth() -> Bool {- log("\n[JB] _bsd_init: ignore FSIOC_KERNEL_ROOTAUTH failure")+ log("\n[CFW]_bsd_init: ignore FSIOC_KERNEL_ROOTAUTH failure")// Step 1: Recover _bsd_init function start.guard let funcStart = resolveBsdInit() else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchDiskImages2.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchDiskImages2.swiftsimilarity index 95%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchDiskImages2.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchDiskImages2.swiftindex fab0a330..4c68c6f0 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchDiskImages2.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchDiskImages2.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchDiskImages2.swift — JB kernel patch: DiskImages2 ABI acceptance.+// KernelCustomFirmwarePatchDiskImages2.swift — CFW kernel patch: DiskImages2 ABI acceptance.//// Productionizes the known-good DiskImages2 pokes that make the 26.4 vphone600// kernel accept the iOS-27 userland's DiskImages2 client (kernel driver ABI v9 vs@@ -7,12 +7,12 @@// "DIDeviceCreatorUserClient::CreateDevice: Incompatible client: expected ABI// version 9 actual 11"), so `pymobiledevice3 mounter auto-mount` fails at attach.//-// Pairs with the sandbox mac_policy_ops[124] allow (KernelJailbreakPatchSandboxExtended)+// Pairs with the sandbox mac_policy_ops[124] allow (KernelCustomFirmwarePatchSandboxExtended)// and the diskimagesiod isMountComplete→YES userland patch (cfw_install) that// together let the attached DDI actually mount at /System/Developer.//// All sites are in the com.apple.driver.AppleDiskImages2 kext inside the MH_FILESET-// kernelcache. The existing JB patches scan the whole kernel text, which covers the+// kernelcache. The existing CFW patches scan the whole kernel text, which covers the// kext; every anchor here is a globally-unique C++ signature / AssertMacros cstring,// or a shape made unique by first pinning the enclosing function — so no DI2-range// restriction is required.@@ -35,8 +35,8 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {- /// Apply all DiskImages2 ABI pokes. Wired into KernelJailbreakPatcher.findAll().+extension KernelCustomFirmwarePatcher {+ /// Apply all DiskImages2 ABI pokes. Wired into KernelCustomFirmwarePatcher.findAll().@discardableResultfunc patchDiskImages2ClientAbi() -> Bool {var ok = true@@ -53,7 +53,7 @@ extension KernelJailbreakPatcher {/// accepted. Function pinned by its unique C++ signature cstring.@discardableResultfunc patchDiskImages2CreateDeviceAbi() -> Bool {- log("\n[JB] DiskImages2 GATE1: CreateDevice controller-ABI b.ne -> nop")+ log("\n[CFW]DiskImages2 GATE1: CreateDevice controller-ABI b.ne -> nop")return nopAbiVersionGate(funcSig: "static IOReturn DIDeviceCreatorUserClient::CreateDevice(OSObject *, void *, IOExternalMethodArguments *)",patchID: "kernel-boot-di2.createdevice_abi",@@ -65,7 +65,7 @@ extension KernelJailbreakPatcher {/// (`cmp wN,#9 ; b.ne <reject>`) != 9. NOP the b.ne. Same shape, different function.@discardableResultfunc patchDiskImages2ConnectAbi() -> Bool {- log("\n[JB] DiskImages2 GATE2b: Connect daemon-ABI b.ne -> nop")+ log("\n[CFW]DiskImages2 GATE2b: Connect daemon-ABI b.ne -> nop")return nopAbiVersionGate(funcSig: "static IOReturn DIDeviceIOUserClient::Connect(OSObject *, void *, IOExternalMethodArguments *)",patchID: "kernel-boot-di2.connect_abi",@@ -126,7 +126,7 @@ extension KernelJailbreakPatcher {/// attach fix.@discardableResultfunc patchDiskImages2NotificationPortArray() -> Bool {- log("\n[JB] DiskImages2 GATE2: widen notification-ports array + bound checks")+ log("\n[CFW]DiskImages2 GATE2: widen notification-ports array + bound checks")guard let allocSite = findDI2AllocPortsSizeSite() else {log(" [~] AllocPortsArray size-shift not present on this kernel — skipping GATE2 (build-specific notif-port codegen; GATE1/GATE2b are the essential fix)")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchDounmount.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchDounmount.swiftsimilarity index 95%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchDounmount.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchDounmount.swiftindex ff008d60..0b79c7c7 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchDounmount.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchDounmount.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchDounmount.swift — JB: NOP the upstream cleanup call in dounmount.+// KernelCustomFirmwarePatchDounmount.swift — CFW: NOP the upstream cleanup call in dounmount.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -9,11 +9,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// NOP the upstream cleanup call in _dounmount.@discardableResultfunc patchDounmount() -> Bool {- log("\n[JB] _dounmount: upstream cleanup-call NOP")+ log("\n[CFW]_dounmount: upstream cleanup-call NOP")guard let foff = findFuncByString("dounmount:") else {log(" [-] 'dounmount:' anchor not found")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchSecureRoot.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchSecureRoot.swiftsimilarity index 97%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchSecureRoot.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchSecureRoot.swiftindex f32e6a4f..12a933ab 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/JailbreakPatches/Storage/KernelJailbreakPatchSecureRoot.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Storage/KernelCustomFirmwarePatchSecureRoot.swift@@ -1,4 +1,4 @@-// KernelJailbreakPatchSecureRoot.swift — JB: force the SecureRootName policy to return success.+// KernelCustomFirmwarePatchSecureRoot.swift — CFW: force the SecureRootName policy to return success.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.//@@ -17,11 +17,11 @@import Foundationimport VPhonePatchKit-extension KernelJailbreakPatcher {+extension KernelCustomFirmwarePatcher {/// Force SecureRootName policy return to success in AppleARMPE::callPlatformFunction.@discardableResultfunc patchIoSecureBsdRoot() -> Bool {- log("\n[JB] _IOSecureBSDRoot: force SecureRootName success")+ log("\n[CFW]_IOSecureBSDRoot: force SecureRootName success")let candidates = findSecureRootFunctions()guard !candidates.isEmpty else {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelJailbreakPatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swiftsimilarity index 93%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelJailbreakPatcher.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swiftindex a019c50f..795f6f2b 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelJailbreakPatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swift@@ -1,11 +1,11 @@-// KernelJailbreakPatcher.swift — JB kernel patcher orchestrator.+// KernelCustomFirmwarePatcher.swift — CFW kernel patcher orchestrator.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-/// JB kernel patcher across 3 groups. Variant- and feature-gated methods can+/// CFW kernel patcher across 3 groups. Variant- and feature-gated methods can/// change the emitted record count; iOS-27-only patches are gated by `applyIOS27`/// and Frida Stalker relaxations by `applyFrida`, which the pipeline sets from the/// plan — the `com.vphone.patchset.kernel.frida` patches, off in `standard`.@@ -13,8 +13,8 @@ import VPhonePatchKit/// Group A: Core gate-bypass methods/// Group B: Pattern/string anchored methods/// Group C: Shellcode/trampoline heavy methods-public final class KernelJailbreakPatcher: KernelJailbreakPatcherBase, BufferedPatcher {- public let component = "kernelcache_jb"+public final class KernelCustomFirmwarePatcher: KernelCustomFirmwarePatcherBase, BufferedPatcher {+ public let component = "kernelcache_cfw"/// Gates the iOS-27-only kernel patches. These target an iOS-27 userland running/// on the 26.4 kernel; on a 26.x base they are unnecessary and some are actively@@ -26,8 +26,8 @@ public final class KernelJailbreakPatcher: KernelJailbreakPatcherBase, BufferedPpublic var applyIOS27 = false/// Opt-in Frida Stalker kernel relaxations. Set from the plan: `standard` blocks- /// both, `extended` and a per-VM checkmark turn them on, and their own- /// cloudOS 26.4+ gate then decides whether they land. Baseline JB/EXP firmware is+ /// both, `experimental` and a per-VM checkmark turn them on, and their own+ /// cloudOS 26.4+ gate then decides whether they land. Baseline CFW/EXP firmware is/// byte-identical when false.public var applyFrida = falsediff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelJailbreakPatcherBase.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcherBase.swiftsimilarity index 98%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelJailbreakPatcherBase.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcherBase.swiftindex 1e770c3e..5db058d4 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelJailbreakPatcherBase.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcherBase.swift@@ -1,24 +1,24 @@-// KernelJailbreakPatcherBase.swift — JB kernel patcher base with extended infrastructure.+// KernelCustomFirmwarePatcherBase.swift — CFW kernel patcher base with extended infrastructure.//// Historical note: derived from the legacy Python firmware patcher during the Swift migration.import Foundationimport VPhonePatchKit-/// Base class for JB kernel patching, extending KernelPatcherBase with:+/// Base class for CFW kernel patching, extending KernelPatcherBase with:/// - Symbol table parsing (nlist64 from LC_SYMTAB + fileset entries)/// - Code cave finder (zeros/0xFF/UDF in executable segments)/// - Function boundary finders (findFuncEnd)/// - String-anchored function finders/// - proc_info anchor cache-public class KernelJailbreakPatcherBase: KernelPatcherBase {+public class KernelCustomFirmwarePatcherBase: KernelPatcherBase {/// Symbol name → file offset map, built from nlist64 entries.var symbols: [String: Int] = [:]/// Cached _proc_security_policy file offset (-1 = scanned, not found).private var procSecurityPolicyOff: Int?- /// JB scan cache for expensive searches.+ /// CFW scan cache for expensive searches.var jbScanCache: [String: Int] = [:]// MARK: - Symbol Tablediff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelExperimentalPatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelExperimentalPatcher.swiftindex a4fb6512..28607e5d 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelExperimentalPatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelExperimentalPatcher.swift@@ -1,6 +1,6 @@// KernelExperimentalPatcher.swift — Experimental kernel patcher orchestrator.//-// Runs after KernelPatcher + KernelJailbreakPatcher for public JB firmware.+// Runs after KernelPatcher + KernelCustomFirmwarePatcher for public CFW firmware.// The internal historical `.exp` variant uses the same patcher.//// Current contents:@@ -13,11 +13,11 @@ import VPhonePatchKit/// Experimental kernel patcher.///-/// Inherits the JB infrastructure (symbol table, ADRP/BL indices, branch+/// Inherits the CFW infrastructure (symbol table, ADRP/BL indices, branch/// encoders, code-cave finder, string-anchored function finders, etc.) from-/// `KernelJailbreakPatcherBase` so EXP-specific patches can use the same helpers-/// as JB ones without duplicating them.-public final class KernelExperimentalPatcher: KernelJailbreakPatcherBase, BufferedPatcher {+/// `KernelCustomFirmwarePatcherBase` so EXP-specific patches can use the same helpers+/// as CFW ones without duplicating them.+public final class KernelExperimentalPatcher: KernelCustomFirmwarePatcherBase, BufferedPatcher {public let component = "kernelcache_exp"public func findAll() throws -> [PatchRecord] {@@ -27,7 +27,7 @@ public final class KernelExperimentalPatcher: KernelJailbreakPatcherBase, BufferbuildSymbolTable()findPanic()- // Former EXP patch, now part of the public JB firmware pipeline.+ // Former EXP patch, now part of the public CFW firmware pipeline.patchHvVmmRename()return patchesdiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelBasePatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelBasePatchSet.swiftindex 0efeafe0..44fde1b6 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelBasePatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelBasePatchSet.swift@@ -1,8 +1,8 @@// FirmwareKernelBasePatchSet.swift — Manifest for the base kernel patches.//// What every research VM needs to mount a patched, unsealed root filesystem and-// run unsigned code from it. `KernelJailbreakPatcher` builds on this set, so the-// jailbreak set requires the capability declared here.+// run unsigned code from it. `KernelCustomFirmwarePatcher` builds on this set, so+// the custom-firmware set requires the capability declared here.//// The Mach port guard patch is the one entry with a version gate. It is required// on an iOS 18 base, where runningboardd trips a flavor-10 guard and crash-loopsdiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelJailbreakPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swiftsimilarity index 94%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelJailbreakPatchSet.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swiftindex 362c528e..baae9aaa 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelJailbreakPatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift@@ -1,7 +1,7 @@-// FirmwareKernelJailbreakPatchSet.swift — Manifest for the jailbreak kernel patches.+// FirmwareKernelCustomFirmwarePatchSet.swift — Manifest for the custom-firmware kernel patches.//-// The patches that make the guest a jailbroken phone rather than a research VM-// that boots: an admitted trust cache, a writable root, task ports, and the+// The patches that make the guest a usable phone rather than a research VM+// that merely boots: an admitted trust cache, a writable root, task ports, and the// syscall surface `vphoned` and the package manager need.//// Version gates here are structural, not preference. The iOS-27 entries target a@@ -12,16 +12,16 @@import Foundationimport VPhonePatchKit-public enum FirmwareKernelJailbreakPatchSet {- public static let identifier = "com.vphone.patchset.kernel.jailbreak"+public enum FirmwareKernelCustomFirmwarePatchSet {+ public static let identifier = "com.vphone.patchset.kernel.cfw"/// Only applies to an iOS 27 userland.private static let ios27 = VPhonePatchApplicability(iOSBase: .major(27))public static let manifest = VPhonePatchSetManifest(identifier: identifier,- name: "Kernel Jailbreak",- summary: "Trust cache admission, writable root, task ports and the jailbreak syscall surface",+ name: "Kernel Custom Firmware",+ summary: "Trust cache admission, writable root, task ports and the guest's extra syscall surface",patches: [// MARK: Trust Cache and Code Signing@@ -34,7 +34,7 @@ public enum FirmwareKernelJailbreakPatchSet {),VPhonePatchDeclaration(identifier: "kernel-boot-post_validation_unsigned",- title: "Jailbreak post-validation",+ title: "Unsigned post-validation",summary: "Completes the base post-validation patch for unsigned pages.",target: .firmware(.kernelcache),bootEssential: true,@@ -175,7 +175,7 @@ public enum FirmwareKernelJailbreakPatchSet {VPhonePatchDeclaration(identifier: "kernel-cfw-nvram_verify_permission",title: "NVRAM permission check",- summary: "Lets the guest write the NVRAM variables the jailbreak reads.",+ summary: "Lets the guest write the NVRAM variables the bootstrap reads.",target: .firmware(.kernelcache),),@@ -209,7 +209,7 @@ public enum FirmwareKernelJailbreakPatchSet {VPhonePatchDeclaration(identifier: "kernel-boot-kcall10",title: "Kernel call syscall",- summary: "Installs the syscall the jailbreak uses to call into the kernel.",+ summary: "Installs the syscall the guest tooling uses to call into the kernel.",target: .firmware(.kernelcache),bootEssential: true,),@@ -265,7 +265,7 @@ public enum FirmwareKernelJailbreakPatchSet {),],requires: ["vphone.kernel.base"],- provides: ["vphone.kernel.jailbreak"],+ provides: ["vphone.kernel.cfw"],after: ["vphone.kernel.base"],)}diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelFridaPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelFridaPatchSet.swiftindex e3a270b1..9d513e09 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelFridaPatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelFridaPatchSet.swift@@ -36,8 +36,8 @@ public enum FirmwareKernelFridaPatchSet {applicability: fridaCapable,),],- requires: ["vphone.kernel.jailbreak"],+ requires: ["vphone.kernel.cfw"],provides: ["vphone.kernel.frida"],- after: ["vphone.kernel.jailbreak"],+ after: ["vphone.kernel.cfw"],)}diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelHypervisorPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelHypervisorPatchSet.swiftindex e87ccaac..84681caa 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelHypervisorPatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelHypervisorPatchSet.swift@@ -17,7 +17,7 @@// `system-watchdogd-exp-hv_vmm_cache`.//// Its own set because it is the one kernel change that is about hiding the-// hypervisor rather than about jailbreaking, so a preset can take it or leave it+// hypervisor rather than about running custom firmware, so a preset can take it or leave it// without giving up the rest.import Foundation@@ -45,6 +45,6 @@ public enum FirmwareKernelHypervisorPatchSet {],requires: ["vphone.kernel.base"],provides: ["vphone.kernel.hypervisor"],- after: ["vphone.kernel.jailbreak"],+ after: ["vphone.kernel.cfw"],)}diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swiftindex 32b0d51c..842d9396 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift@@ -13,7 +13,7 @@ public enum FirmwarePatchSetCatalog {public static let bundled: [VPhonePatchSetManifest] = [FirmwareBootChainPatchSet.manifest,FirmwareKernelBasePatchSet.manifest,- FirmwareKernelJailbreakPatchSet.manifest,+ FirmwareKernelCustomFirmwarePatchSet.manifest,FirmwareKernelHypervisorPatchSet.manifest,FirmwareKernelFridaPatchSet.manifest,FirmwareDeviceTreePatchSet.manifest,@@ -106,7 +106,7 @@ public enum FirmwarePatchSetCatalog {public static let standardPreset = VPhonePatchPreset(identifier: VPhonePatchPreset.standardIdentifier,title: "Standard",- summary: "The patches every vphone VM needs to boot, jailbroken, with a working display and camera.",+ summary: "The patches every vphone VM needs to boot custom firmware, with a working display and camera.",patchSets: bundledReferences,selection: .block(manualOnlyPatches),)@@ -114,9 +114,9 @@ public enum FirmwarePatchSetCatalog {/// Everything the bundle declares, including the Frida relaxations, the/// hypervisor concealment and the iPhone17,3 identity. Each patch's own version/// gate still decides whether it lands.- public static let extendedPreset = VPhonePatchPreset(- identifier: "extended",- title: "Extended",+ public static let experimentalPreset = VPhonePatchPreset(+ identifier: "experimental",+ title: "Experimental",summary: """Every patch this bundle declares, including the Frida Stalker relaxations, \the iPhone17,3 identity rewrites, and the hv_vmm_present concealment that a \@@ -127,5 +127,5 @@ public enum FirmwarePatchSetCatalog {)/// The presets the bundle ships.- public static let builtInPresets: [VPhonePatchPreset] = [standardPreset, extendedPreset]+ public static let builtInPresets: [VPhonePatchPreset] = [standardPreset, experimentalPreset]}diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipeline.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipeline.swiftindex 1e4f6f4f..eb2259db 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipeline.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipeline.swift@@ -7,10 +7,11 @@// Internal variant selection:// .regular — base patchers only// .dev — TXMDevPatcher instead of TXMPatcher-// .jb — TXMDevPatcher + IBootJailbreakPatcher (iBSS) + KernelJailbreakPatcher-// + former EXP kernel and DeviceTree patches.-// .exp — historical internal variant, currently equivalent to JB for-// the boot-chain patcher catalogue. Only JB is public.+// .jb — TXMDevPatcher + IBootCustomFirmwarePatcher (iBSS) + KernelCustomFirmwarePatcher+// + former EXP kernel and DeviceTree patches. The case keeps its old+// spelling because its raw value is recorded in every VM's RestoreInfo.+// .exp — historical internal variant, currently equivalent to CFW for+// the boot-chain patcher catalogue. Only CFW is public.//// The component catalogue lives in FirmwarePipelineComponents.swift and the// Restore-directory/firmware-file lookup in FirmwarePipelineDiscovery.swift.diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipelineComponents.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipelineComponents.swiftindex 2916838a..824e0f0c 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipelineComponents.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Pipeline/FirmwarePipelineComponents.swift@@ -20,7 +20,7 @@ extension FirmwarePipeline {/// - iOSBase: The iPhone base `ProductVersion` read from `iPhone-BuildManifest.plist`,/// or nil when it could not be read. Two patchers still branch on the release/// itself rather than on a patch being selected: the skywalk-netagent boot-arg is- /// 18.x-only, and `KernelJailbreakPatcher.applyIOS27` changes the shapes a patch+ /// 18.x-only, and `KernelCustomFirmwarePatcher.applyIOS27` changes the shapes a patch/// method looks for rather than whether it runs./// - plan: The resolved preset, or nil when there is none. A patcher whose whole/// patch set the preset left out is not built at all: its records would be@@ -44,7 +44,7 @@ extension FirmwarePipeline {let includeBootChain = includesSet(FirmwareBootChainPatchSet.identifier)let includeKernelBase = includesSet(FirmwareKernelBasePatchSet.identifier)- let includeKernelJailbreak = includesSet(FirmwareKernelJailbreakPatchSet.identifier)+ let includeKernelCustomFirmware = includesSet(FirmwareKernelCustomFirmwarePatchSet.identifier)let includeDeviceTree = includesSet(FirmwareDeviceTreePatchSet.identifier)/// Whether the plan turned a patch on. Without a plan, fall back to the@@ -131,7 +131,7 @@ extension FirmwarePipeline {return p},{ data, verbose in- let p = IBootJailbreakPatcher(data: data, mode: .ibss, verbose: verbose)+ let p = IBootCustomFirmwarePatcher(data: data, mode: .ibss, verbose: verbose)p.gate = gatereturn p},@@ -191,8 +191,8 @@ extension FirmwarePipeline {}(),))- // 6. Kernel — the public JB firmware includes the former EXP- // hv_vmm rename after the base and jailbreak patches.+ // 6. Kernel — the public CFW firmware includes the former EXP+ // hv_vmm rename after the base and custom-firmware patches.components.append(ComponentDescriptor(name: "kernelcache",inRestoreDir: true,@@ -219,12 +219,12 @@ extension FirmwarePipeline {return p}] : []case .jb, .exp:- kernelJailbreakFactories(+ kernelCustomFirmwareFactories(applyExcGuard: applyExcGuard,applyIOS27: applyIOS27,applyFrida: applyFrida,includeBase: includeKernelBase,- includeJailbreak: includeKernelJailbreak,+ includeCustomFirmware: includeKernelCustomFirmware,includeHypervisor: includeHypervisor,gate: gate,)@@ -325,16 +325,16 @@ extension FirmwarePipeline {// MARK: - Kernel Factories- /// The kernelcache patcher chain the JB and EXP variants share.+ /// The kernelcache patcher chain the CFW and EXP variants share.////// Each patcher corresponds to one bundled patch set, and a set the preset/// left out drops its patcher rather than being filtered afterwards.- private func kernelJailbreakFactories(+ private func kernelCustomFirmwareFactories(applyExcGuard: Bool,applyIOS27: Bool,applyFrida: Bool,includeBase: Bool,- includeJailbreak: Bool,+ includeCustomFirmware: Bool,includeHypervisor: Bool,gate: VPhonePatchGate,) -> [(Data, Bool) throws -> any Patcher] {@@ -346,9 +346,9 @@ extension FirmwarePipeline {return p}}- if includeJailbreak {+ if includeCustomFirmware {factories.append { data, verbose in- let p = KernelJailbreakPatcher(data: data, verbose: verbose)+ let p = KernelCustomFirmwarePatcher(data: data, verbose: verbose)p.applyIOS27 = applyIOS27p.applyFrida = applyFridap.gate = gatediff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/FirmwarePatcherTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/FirmwarePatcherTests.swiftindex c9e53213..3348c8f8 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/FirmwarePatcherTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/FirmwarePatcherTests.swift@@ -504,7 +504,7 @@ struct IBootPatcherIdempotencyTests {}struct IM4PPayloadParityTests {- @Test func `ibss IM 4 P payload matches raw and JB patcher finds nonce patch`() throws {+ @Test func `ibss IM 4 P payload matches raw and CFW patcher finds nonce patch`() throws {let baseDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent()@@ -520,7 +520,7 @@ struct IM4PPayloadParityTests {#expect(im4pPayload == rawIBSS)- let patcher = IBootJailbreakPatcher(data: im4pPayload, mode: .ibss, verbose: false)+ let patcher = IBootCustomFirmwarePatcher(data: im4pPayload, mode: .ibss, verbose: false)let records = try patcher.findAll()#expect(records.count == 1)}@@ -587,7 +587,7 @@ struct FirmwarePipelineTests {restoreDir: root,iOSBase: VPhoneVersion("27.0"),)- // Base and jailbreak, and no KernelExperimentalPatcher: the hv_vmm_present+ // Base and custom firmware, and no KernelExperimentalPatcher: the hv_vmm_present// concealment is off unless a preset or a checkmark asks for it, and a// patcher that would write nothing is not built. See// FirmwareKernelHypervisorPatchSet for what it does to a 26.4 guest.diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/PatchComparisonTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/PatchComparisonTests.swiftindex 70985ee6..84e0f9a8 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/PatchComparisonTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/PatchComparisonTests.swift@@ -214,12 +214,12 @@ struct KernelcacheComparisonTests {// MARK: - JB Tests@Suite(.enabled(if: hasReferencePatches, referenceMissing))-struct IBSSJailbreakComparisonTests {- @Test func `compare IBSSJailbreak`() throws {+struct IBSSCustomFirmwareComparisonTests {+ @Test func `compare IBSSCustomFirmware`() throws {let data = try loadRawPayload("ibss.bin")- let patcher = IBootJailbreakPatcher(data: data, mode: .ibss, verbose: false)- // IBootJailbreakPatcher only adds JB-specific patches on top of base- // We need to run findAll() first (base patches), then add JB patch+ let patcher = IBootCustomFirmwarePatcher(data: data, mode: .ibss, verbose: false)+ // IBootCustomFirmwarePatcher only adds CFW-specific patches on top of base+ // We need to run findAll() first (base patches), then add the CFW patchpatcher.patches = []patcher.patchSkipGenerateNonce()let refPatches = try loadReference("ibss_jb")@@ -228,10 +228,10 @@ struct IBSSJailbreakComparisonTests {}@Suite(.enabled(if: hasReferencePatches, referenceMissing))-struct KernelcacheJailbreakComparisonTests {- @Test func `compare kernelcache JB`() throws {+struct KernelcacheCustomFirmwareComparisonTests {+ @Test func `compare kernelcache CFW`() throws {let data = try loadRawPayload("kernelcache.bin")- let patcher = KernelJailbreakPatcher(data: data, verbose: false)+ let patcher = KernelCustomFirmwarePatcher(data: data, verbose: false)let swiftPatches = try patcher.findAll()let refPatches = try loadReference("kernelcache_jb")comparePatchRecords(swift: swiftPatches, reference: refPatches, component: "kernelcache_jb")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/VerboseJailbreakDebug.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/VerboseCustomFirmwareDebug.swiftsimilarity index 91%rename from VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/VerboseJailbreakDebug.swiftrename to VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/VerboseCustomFirmwareDebug.swiftindex 80c54c45..7166a54c 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/VerboseJailbreakDebug.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/VerboseCustomFirmwareDebug.swift@@ -2,7 +2,7 @@import Foundationimport Testing-struct VerboseJailbreakDebug {+struct VerboseCustomFirmwareDebug {@Test func `debug failing patches`() throws {let baseDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent()@@ -12,7 +12,7 @@ struct VerboseJailbreakDebug {.deletingLastPathComponent().appendingPathComponent("ipsws/patch_refactor_input")let data = try Data(contentsOf: baseDir.appendingPathComponent("raw_payloads/kernelcache.bin"))- let patcher = KernelJailbreakPatcher(data: data, verbose: true)+ let patcher = KernelCustomFirmwarePatcher(data: data, verbose: true)// Initialize patcher state (same as findAll() but without running patches)try patcher.parseMachO()diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swiftindex aed49b72..23d05d19 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift@@ -141,14 +141,14 @@ struct FirmwarePatchSetCatalogTests {iOSBase: VPhoneVersion("26.4"),cloudOS: VPhoneVersion("26.4"),)- let extended = try VPhonePatchPlan.resolve(- preset: FirmwarePatchSetCatalog.extendedPreset,+ let experimental = try VPhonePatchPlan.resolve(+ preset: FirmwarePatchSetCatalog.experimentalPreset,patchSets: FirmwarePatchSetCatalog.bundled,iOSBase: VPhoneVersion("26.4"),cloudOS: VPhoneVersion("26.4"),)- #expect(extended.enabled.subtracting(standard.enabled) == FirmwarePatchSetCatalog.manualOnlyPatches)- #expect(standard.enabled.subtracting(extended.enabled).isEmpty)+ #expect(experimental.enabled.subtracting(standard.enabled) == FirmwarePatchSetCatalog.manualOnlyPatches)+ #expect(standard.enabled.subtracting(experimental.enabled).isEmpty)}@Test@@ -160,7 +160,7 @@ struct FirmwarePatchSetCatalogTests {for (identifier, requiredMajor) in pinned {for base in [18, 26, 27] {let plan = try VPhonePatchPlan.resolve(- preset: FirmwarePatchSetCatalog.extendedPreset,+ preset: FirmwarePatchSetCatalog.experimentalPreset,patchSets: FirmwarePatchSetCatalog.bundled,iOSBase: VPhoneVersion("\(base).0"),cloudOS: VPhoneVersion("26.4"),@@ -177,7 +177,7 @@ struct FirmwarePatchSetCatalogTests {func `The Frida relaxations need cloudOS 26.4`() throws {for cloud in ["26.1", "26.4"] {let plan = try VPhonePatchPlan.resolve(- preset: FirmwarePatchSetCatalog.extendedPreset,+ preset: FirmwarePatchSetCatalog.experimentalPreset,patchSets: FirmwarePatchSetCatalog.bundled,iOSBase: VPhoneVersion("26.4"),cloudOS: VPhoneVersion(cloud),@@ -190,7 +190,7 @@ struct FirmwarePatchSetCatalogTests {}@Test- func `The hv_vmm_present patches move together, and only extended has them`() throws {+ func `The hv_vmm_present patches move together, and only experimental has them`() throws {// Three patches, one behaviour: the kernel OID rename, the shared-cache// mangle and the watchdogd cache patch. A plan holding some without the// rest is broken — the rename alone breaks the graphics and ML paths anddiff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swiftindex 9c007221..2f9139b2 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift@@ -188,7 +188,7 @@ struct VPhoneCustomFirmwarePatchIOMFBForceKernCommand: ParsableCommand {side file has to be present; without it there would be zero pairs tofind, which would read as "this userland has none".- Pairs with the KernelJailbreakPatchIomfbSwap kernel patches, which make the+ Pairs with the KernelCustomFirmwarePatchIomfbSwap kernel patches, which make theuserclient accept 27's native 0x6e0 SwapEnd struct. Modified pages arere-attested; an already-forced cache is a no-op.""",@@ -264,7 +264,7 @@ struct VPhoneCustomFirmwarePatchDyldSharedCacheMaxSlideCommand: ParsableCommandstruct VPhoneCustomFirmwarePatchLSDEmbeddedRegCommand: ParsableCommand {static let configuration = CommandConfiguration(commandName: "patch-lsd-embedded-reg",- abstract: "Open lsd's embedded-registration path so JB app installs can register",+ abstract: "Open lsd's embedded-registration path so CFW app installs can register",discussion: """On iOS 27, `-[_LSDModifyClientclientIsEntitledForEmbeddedRegistrationOperations]` demands threediff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swiftindex 179afc34..7273916d 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift@@ -202,7 +202,7 @@ struct VPhoneCustomFirmwareInstaller {try mountGuestVolume("\(container)s1", at: system)dataMounted = truetry mountGuestVolume("\(container)s3", at: data)- print("[*] JB system install: \(bundle.lastPathComponent)")+ print("[*] CFW system install: \(bundle.lastPathComponent)")do {// Every descriptor on a guest volume lives in this scope, so none// is left open to hold the volume busy when it is unmounted.@@ -241,7 +241,7 @@ struct VPhoneCustomFirmwareInstaller {work: work,owner: invokingUser.map { ($0.uid, $0.gid) },)- print("[+] JB system install complete; vphoned is installed, no package bootstrap was staged")+ print("[+] CFW system install complete; vphoned is installed, no package bootstrap was staged")}// MARK: - Host inputs@@ -444,7 +444,7 @@ struct VPhoneCustomFirmwareInstaller {try patch("patch-mis-trust-auth", [dsc])}// These former EXP patches pair with the kernel OID rename and the- // camera DeviceTree additions in the public JB firmware pipeline.+ // camera DeviceTree additions in the public CFW firmware pipeline.if on("dyld-exp-hv_vmm") {try patch("patch-hv-vmm-dsc", [dsc])}@@ -1130,7 +1130,7 @@ struct VPhoneCustomFirmwareInstaller {struct VPhoneCustomFirmwareInstallRootCommand: ParsableCommand {static let configuration = CommandConfiguration(- commandName: "install-root", abstract: "Internal privileged JB disk install",+ commandName: "install-root", abstract: "Internal privileged CFW disk install",shouldDisplay: false,)diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareMachOVerbsCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareMachOVerbsCommand.swiftindex c0ad3360..2f56b97a 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareMachOVerbsCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareMachOVerbsCommand.swift@@ -208,7 +208,7 @@ struct VPhoneCustomFirmwarePatchLaunchdJetsamCommand: ParsableCommand {abstract: "Bypass the jetsam panic guard in /sbin/launchd",discussion: """launchd panics when its jetsam configuration does not add up, which a- JB guest's rearranged daemon set reliably triggers. The conditional+ CFW guest's rearranged daemon set reliably triggers. The conditionalbranch that guards the panic is rewritten to an unconditional `b` tothe same target, so the function always takes its return path.diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swiftindex d4e18770..71d9fd1e 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swift@@ -147,7 +147,7 @@ struct VPhoneCustomFirmwareInjectDylibCommand: ParsableCommand {commandName: "inject-dylib",abstract: "Insert a weak LC_LOAD_DYLIB into every slice of a Mach-O",discussion: """- Replaces `insert_dylib --weak --inplace --all-yes`, which is how the JB+ Replaces `insert_dylib --weak --inplace --all-yes`, which is how the CFWand EXP installers get launchd to load /b (the short launchdhook alias)at boot.diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swiftindex db98057c..c356be8b 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swift@@ -344,7 +344,7 @@ struct VPhoneFirmwarePatchCommand: ParsableCommand {}try VPhoneHostFilePermissions.makeAccessible(at: bundle.url)- print("[fw patch] applied \(records.count) JB patches"+ print("[fw patch] applied \(records.count) CFW patches"+ " (preset \(selection.presetIdentifier))")}}diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VPhoneCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VPhoneCommand.swiftindex d07deb26..727c2718 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VPhoneCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VPhoneCommand.swift@@ -75,7 +75,7 @@ struct PatchFirmwareCommand: ParsableCommand {try encoder.encode(records).write(to: url)print("[patch-firmware] wrote \(records.count) patch records to \(url.path)")} else {- print("[patch-firmware] applied \(records.count) JB patches")+ print("[patch-firmware] applied \(records.count) CFW patches")}}}@@ -85,11 +85,11 @@ struct PatchComponentCommand: ParsableCommand {case txmcase kernelBase = "kernel-base"/// TESTING/DIAGNOSTICS ONLY — not part of any production flow.- /// Production JB patching runs through `patch-firmware`; this- /// standalone option runs the JB kernel layer over a single kernelcache+ /// Production CFW patching runs through `patch-firmware`; this+ /// standalone option runs the CFW kernel layer over a single kernelcache/// and dumps records via --records-out./// (txm / kernel-base, by contrast, are standalone single-component patchers.)- case kernelJB = "kernel-jb"+ case kernelCFW = "kernel-cfw"}static let configuration = CommandConfiguration(@@ -125,7 +125,7 @@ struct PatchComponentCommand: ParsableCommand {@Option(name: .customLong("target-os"),- help: "kernel-jb only: base iOS version the kernel will run under (e.g. 27.0). Gates the iOS-27-only JB patches exactly as the pipeline does. Omit to apply the full set (dev/test default).",+ help: "kernel-cfw only: base iOS version the kernel will run under (e.g. 27.0). Gates the iOS-27-only CFW patches exactly as the pipeline does. Omit to apply the full set (dev/test default).",)var targetOS: String?@@ -153,12 +153,12 @@ struct PatchComponentCommand: ParsableCommand {patchedData = patcher.buffer.datarecords = patcher.patches- case .kernelJB:- // Mirrors the pipeline's jb kernel layer. In FirmwarePipeline each kernel+ case .kernelCFW:+ // Mirrors the pipeline's cfw kernel layer. In FirmwarePipeline each kernel// patcher runs on the *original* payload independently, so running- // KernelJailbreakPatcher standalone faithfully reproduces JB hook behavior- // without the base patcher or the rest of the boot chain.- let patcher = KernelJailbreakPatcher(data: payload, verbose: !quiet)+ // KernelCustomFirmwarePatcher standalone faithfully reproduces CFW hook+ // behavior without the base patcher or the rest of the boot chain.+ let patcher = KernelCustomFirmwarePatcher(data: payload, verbose: !quiet)// Mirror the pipeline's per-base gating: apply the iOS-27-only patches when// --target-os is 27.x, skip them for an explicit non-27 target. With no// --target-os, default to applying them so the dev/test tool exercises thediff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swiftindex 24325d65..1d696b0b 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift@@ -7,7 +7,7 @@ struct VPhoneVirtualMachineCreateCommand: ParsableCommand {static let configuration = CommandConfiguration(commandName: "create",abstract: "Create a VM end-to-end (prepare → patch → restore → CFW → first boot)",- discussion: "Runs the full jailbreak pipeline for a new VM. Requires an internet connection to download IPSWs, a macOS host that is not itself a VM, and sudo to install custom firmware.",+ discussion: "Runs the full custom-firmware pipeline for a new VM. Requires an internet connection to download IPSWs, a macOS host that is not itself a VM, and sudo to install custom firmware.",)@OptionGroup var lib: VPhoneLibraryOptiondiff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreator.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreator.swiftindex 99b5c65f..9588fe08 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreator.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreator.swift@@ -191,7 +191,7 @@ public struct VPhoneVirtualMachineCreator {try VPhoneHostFilePermissions.makeDirectoryAccessible(at: VPhoneResources.userDataRoot())permissionsRestored = trueprint("\n=== Done ===")- print("JB VM created; vphoned connected. Guest user environment is untouched.")+ print("CFW VM created; vphoned connected. Guest user environment is untouched.")}// MARK: - trace@@ -274,7 +274,7 @@ public struct VPhoneVirtualMachineCreator {forVM: bundleURL,)}- print("[fw patch] applied \(records.count) JB patches (preset \(presetIdentifier))")+ print("[fw patch] applied \(records.count) CFW patches (preset \(presetIdentifier))")}// MARK: - restore phase@@ -425,10 +425,10 @@ public struct VPhoneVirtualMachineCreator {bundleURL: URL,) throws {let v = options.verbosity- trace("native JB CFW install for \(bundleURL.path)", v)+ trace("native CFW install for \(bundleURL.path)", v)let code = try VPhoneCustomFirmwareInstaller.elevate(bundle: bundleURL, resources: resources)guard code == 0 else { throw VPhoneVirtualMachineCreationError.cfwInstallFailed(code) }- print("[+] JB CFW installed.")+ print("[+] CFW installed.")if let bundle = try? VPhoneBundle.load(at: bundleURL),let info = try? VPhoneRestoreInfo.recordVariant("jb", toBundle: bundle), info.variant != nil{diff --git a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Constants.swift b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Constants.swiftindex ec9590a4..bb5141b6 100644--- a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Constants.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Constants.swift@@ -59,7 +59,7 @@ public enum ARM64 {/// STRB W0, [X20, #0x30]public static let strbW0X20_30 = encodeU32(0x3900_C280)- // MARK: JB Constants+ // MARK: CFW Constants/// CBZ X2, #8 (branch if X2 == 0, skip 2 instructions)public static let cbzX2_8 = encodeU32(0xB400_0042)diff --git a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Disassembler.swift b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Disassembler.swiftindex d9721f21..81460c80 100644--- a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Disassembler.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Disassembler.swift@@ -65,7 +65,7 @@ public final class ARM64Disassembler: @unchecked Sendable {/// (the write target for the moves/loads/branches the patchers match), else nil.////// Replaces the brittle `operandString.components(separatedBy: ",")` parsing that- /// was duplicated across the JB patch files to recover a destination register's+ /// was duplicated across the CFW patch files to recover a destination register's/// width ("w…" vs "x…") and identity.public func firstRegisterName(_ insn: ARM64Instruction) -> String? {guard let first = insn.detail?.operands.first, first.type == .register else { return nil }diff --git a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Inst.swift b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Inst.swiftindex 8f16e2e3..483fc770 100644--- a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Inst.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/ARM64/ARM64Inst.swift@@ -3,8 +3,8 @@// These operate directly on a 4-byte little-endian instruction word so the kernel// patchers can scan megabytes of __TEXT_EXEC without paying Capstone's per-instruction// cost. They are the SINGLE SOURCE OF TRUTH for the opcode masks that were previously-// re-spelled inline in each JB patch file (KernelJailbreakPatchTaskConversion, VmProtect,-// ProcPidinfo, HookCredLabel) and in KernelJailbreakPatcherBase.findProcSecurityPolicy.+// re-spelled inline in each CFW patch file (KernelCustomFirmwarePatchTaskConversion, VmProtect,+// ProcPidinfo, HookCredLabel) and in KernelCustomFirmwarePatcherBase.findProcSecurityPolicy.//// Every mask/value is documented against the ARM64 ISA encoding and round-trip// verified against Capstone in ARM64InstTests. When a Capstone `Instruction` isdiff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/extended.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plistsimilarity index 95%rename from VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/extended.plistrename to VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plistindex 231e6ed4..0f010786 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/extended.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist@@ -19,9 +19,9 @@<plist version="1.0"><dict><key>Identifier</key>- <string>extended</string>+ <string>experimental</string><key>Title</key>- <string>Extended</string>+ <string>Experimental</string><key>Summary</key><string>Every patch this bundle declares, including the Frida Stalker relaxations, the iPhone17,3 identity rewrites, and the hv_vmm_present concealment that a freshly restored 26.4 guest does not survive.</string><key>PatchSets</key>@@ -42,7 +42,7 @@<key>Kind</key><string>Bundled</string><key>Identifier</key>- <string>com.vphone.patchset.kernel.jailbreak</string>+ <string>com.vphone.patchset.kernel.cfw</string></dict><dict><key>Kind</key>diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plistindex d88e6bc8..4ada0ed5 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist@@ -3,7 +3,7 @@<!--The preset every VM gets unless another is named.- It is the JB baseline plus the virtual camera. It draws on every patch set the+ It is the CFW baseline plus the virtual camera. It draws on every patch set thebundle ships and turns on all of their patches bar three groups. The FridaStalker pair widens what any process in the guest may do and nothing needs it inorder to boot. The hv_vmm_present concealment — the kernel OID rename, the@@ -32,7 +32,7 @@<key>Title</key><string>Standard</string><key>Summary</key>- <string>The patches every vphone VM needs to boot, jailbroken, with a working display and camera.</string>+ <string>The patches every vphone VM needs to boot custom firmware, with a working display and camera.</string><key>PatchSets</key><array><dict>@@ -51,7 +51,7 @@<key>Kind</key><string>Bundled</string><key>Identifier</key>- <string>com.vphone.patchset.kernel.jailbreak</string>+ <string>com.vphone.patchset.kernel.cfw</string></dict><dict><key>Kind</key>diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swiftindex 6cd18e78..a43484a6 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift@@ -286,12 +286,12 @@/// and out of the preset, as the real report does.static func patchCatalog(preset: String?) -> VPhoneLaunchpadPatchCatalog? {let active = preset ?? "standard"- let frida = active == "extended"+ let frida = active == "experimental"let json = """{"activePreset":"\(active)","blockedPatches":[],"allowedPatches":[],"presets":[- {"identifier":"standard","title":"Standard","summary":"The patches every vphone VM needs to boot, jailbroken, with a working display and camera.","patchSets":[]},- {"identifier":"extended","title":"Extended","summary":"Every patch this bundle declares, including the Frida Stalker relaxations.","patchSets":[]}+ {"identifier":"standard","title":"Standard","summary":"The patches every vphone VM needs to boot custom firmware, with a working display and camera.","patchSets":[]},+ {"identifier":"experimental","title":"Experimental","summary":"Every patch this bundle declares, including the Frida Stalker relaxations.","patchSets":[]}],"patches":[{"identifier":"avpbooter-boot-dgst_bypass","title":"AVPBooter digest bypass","summary":"Accepts the resealed boot images instead of the stock digests.","patchSet":"com.vphone.patchset.bootchain","patchSetName":"Boot Chain","target":"AVPBooter","applicability":"any","bootEssential":true,"inPreset":true,"enabled":true},diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swiftindex 2b18d04b..7ed7c312 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift@@ -39,6 +39,18 @@ nonisolated struct VPhoneLaunchpadMachine: Decodable, Hashable, Identifiable, Selet cloudOS: OSVersionlet variant: String?let device: String?++ /// The firmware this machine was restored with, named after the patch sets+ /// it carries. `variant` itself is the value recorded at restore time and+ /// keeps its old spelling, so a machine built before the rename still reads+ /// correctly and needs no rebuild.+ var firmwareName: String {+ switch variant {+ case "jb": String(localized: "Standard Custom Firmware")+ case "exp": String(localized: "Experimental Custom Firmware")+ default: String(localized: "Unknown Firmware")+ }+ }}let name: Stringdiff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swiftindex 8132d2f4..b7bfa582 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift@@ -67,8 +67,8 @@ struct VPhoneLaunchpadMachineInspector: View {if let started = library.startedAt[machine.path] {LabeledContent("Started", value: started.formatted(date: .omitted, time: .shortened))}- if let variant = machine.restoreInfo?.variant {- LabeledContent("Variant", value: variant)+ if let restoreInfo = machine.restoreInfo {+ LabeledContent("Firmware", value: restoreInfo.firmwareName)}} header: {Text(machine.name)diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swiftindex d3bf2aed..4a6dfd1d 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift@@ -22,7 +22,7 @@ nonisolated struct VPhoneLaunchpadPatchCatalog: Decodable, Sendable {var displayTitle: String {switch identifier {case "standard": String(localized: "Standard", comment: "The built-in patch preset")- case "extended": String(localized: "Extended", comment: "The built-in patch preset")+ case "experimental": String(localized: "Experimental", comment: "The built-in patch preset")default: title}}@@ -30,7 +30,7 @@ nonisolated struct VPhoneLaunchpadPatchCatalog: Decodable, Sendable {var displaySummary: String {switch identifier {case "standard": String(localized: "Patches every machine needs to start, with a working display and camera.")- case "extended": String(localized: "Every patch in this bundle, including advanced ones that may stop a newly restored 26.4 machine from starting.")+ case "experimental": String(localized: "Every patch in this bundle, including advanced ones that may stop a newly restored 26.4 machine from starting.")default: summary}}