mirror of
https://github.com/Lakr233/vphone-cli.git
synced 2026-09-05 17:14:28 +00:00
kernel: Introduce EXP variant and hv_vmm_present OID rename (KernelEXPPatcher)
Introduces a new `exp` firmware variant on top of JB and ports the
`hv_vmm_present` sysctl rename to it.
Variant infrastructure
----------------------
- Adds `case exp` to `FirmwarePipeline.Variant`,
`VPhoneCLI.PatchFirmwareCLI.VariantOption`, and
`VPhoneVirtualMachine.Variant`. Every `switch variant` block in
`FirmwarePipeline.buildComponentList` includes the new case.
- Adds `make fw_patch_exp` + `make cfw_install_exp` Makefile targets
and an `EXP=1` flag for `make setup_machine`, mutually exclusive with
`JB=1` / `DEV=1` / `LESS=1`. `SPOOF_BUILD` env var is threaded
through for later use by the build-version step.
- Adds `--exp` to `scripts/setup_machine.sh` alongside `--jb` /
`--dev` / `--less`. The post-install JB-Finalize block also fires
for EXP (since EXP inherits the JB rootfs deployment).
- Adds `scripts/cfw_install_exp.sh` as the EXP install script
starting point: identical phase set to `cfw_install_jb.sh` (JB-1..JB-5)
with banner/header/footer updated for EXP. Subsequent commits in this
branch add the EXP-only experimental phases on top.
- Updates the variants table in `AGENTS.md` / `README.md` and the
three translated READMEs to include the new `Experimental (EXP)`
row, plus a paragraph describing what EXP adds on top of JB.
Kernel patch
------------
- New `KernelEXPPatcher` orchestrator in
`sources/FirmwarePatcher/Kernel/`, chained after `KernelPatcher` +
`KernelJBPatcher` for the `.exp` variant only. Inherits
`KernelJBPatcherBase` to reuse the JB symbol-table / ADRP-BL index /
branch-encoder infrastructure.
- New `KernelEXPPatchHvVmmRename` patch in
`sources/FirmwarePatcher/Kernel/EXPPatches/`. Part A flips byte 0 of
the NUL-delimited `\\0hv_vmm_present\\0` cstring (the sysctl OID's
`oid_name` value) — `'h'` -> `'X'` — so the kernel resolves
`sysctlbyname("kern.hv_vmm_present")` as ENOENT and
`sysctlbyname("kern.Xv_vmm_present")` to the OID's real int value.
Part B mangles byte 5 of every kernel-internal occurrence of
`kern.hv_vmm_present` so callers keep hitting the renamed OID; two
byte-aligned forms are covered (NUL-delimited cstring + sandbox-profile
name-token with trailing `\\x0f`).
- Patch IDs are `kernelcache_exp.hv_vmm_oid_rename` and
`kernelcache_exp.hv_vmm_internal_caller_mangle`. Idempotent.
- `KernelJBPatcher` is unchanged at the call-site level (no
`patchHvVmmRename` call); its docstring is updated to point at
`KernelEXPPatcher` for the EXP-only patch.
JB and other variants are NOT affected: `cfw_install_jb.sh` and
`cfw_install_dev.sh` are untouched in this commit.
This commit is contained in:
+15
-7
@@ -17,17 +17,20 @@ Apple の Virtualization.framework と PCC の研究用 VM インフラを使用
|
||||
|
||||
## ファームウェアバリアント
|
||||
|
||||
セキュリティバイパスのレベルが異なる4つのパッチバリアントが利用可能です:
|
||||
セキュリティバイパスのレベルが異なる5つのパッチバリアントが利用可能です:
|
||||
|
||||
| バリアント | ブートチェーン | CFW | Make ターゲット |
|
||||
| ---------- | :------------: | :---------: | -------------------------------------------- |
|
||||
| **Patchless** | 3 パッチ | 2 フェーズ | `fw_patch_less` + `boot_less` |
|
||||
| **通常版** | 41 パッチ | 10 フェーズ | `fw_patch` + `cfw_install` |
|
||||
| **開発版** | 52 パッチ | 12 フェーズ | `fw_patch_dev` + `cfw_install_dev` |
|
||||
| **脱獄版** | 112 パッチ | 14 フェーズ | `fw_patch_jb` + `cfw_install_jb` |
|
||||
| バリアント | ブートチェーン | CFW | Make ターゲット |
|
||||
| ------------- | :----------------: | :----------: | -------------------------------------------- |
|
||||
| **Patchless** | 3 パッチ | 2 フェーズ | `fw_patch_less` + `boot_less` |
|
||||
| **通常版** | 41 パッチ | 10 フェーズ | `fw_patch` + `cfw_install` |
|
||||
| **開発版** | 52 パッチ | 12 フェーズ | `fw_patch_dev` + `cfw_install_dev` |
|
||||
| **脱獄版** | 112 パッチ | 14 フェーズ | `fw_patch_jb` + `cfw_install_jb` |
|
||||
| **実験版** | 脱獄 + EXP 専用 | 脱獄 + EXP | `fw_patch_exp` + `cfw_install_exp` |
|
||||
|
||||
> JB最終設定(シンボリックリンク、Sileo、apt、TrollStore)は `/cores/vphone_jb_setup.sh` LaunchDaemon により初回起動時に自動実行されます。進捗確認:`/var/log/vphone_jb_setup.log`。
|
||||
|
||||
> **実験版(EXP)** は脱獄版の上位集合で、リサーチブランチの実験的パッチを追加で実行します:カーネルの `hv_vmm_present` sysctl リネーム + カーネル内部呼び出し元の改変(`KernelEXPPatcher`)、サインインブラックリスト付きの DSC バイト5改変 + スロット再認証、watchdogd 精密 2 命令パッチ(EXP-JB-3.5)、fw_patch 時点での DeviceTree アイデンティティプロパティ 8 件、復元後の DT アイデンティティ書き換え(EXP-JB-6)、`SPOOF_BUILD=<id>` によるオプトイン式の `SystemVersion.plist` `ProductBuildVersion` 書き換え(EXP-JB-7)。他のバリアントは意図的に影響を受けません。
|
||||
|
||||
詳細なコンポーネントごとの内訳については [research/0_binary_patch_comparison.md](../research/0_binary_patch_comparison.md) を参照してください。
|
||||
|
||||
## 前提条件
|
||||
@@ -103,6 +106,8 @@ make setup_machine # 初回起動までを完全自動化(復元/
|
||||
# LESS=1 で patchless バリアント(- AMFI, SSV, Img4, TXM バイパス)
|
||||
# DEV=1 で開発バリアント(+ TXM entitlement/デバッグバイパス)
|
||||
# JB=1 で脱獄バリアント(dev + 完全セキュリティバイパス)
|
||||
# EXP=1 で実験バリアント(脱獄 + リサーチパッチ: hv_vmm リネーム、DT アイデンティティ、復元後書き換え)
|
||||
# SPOOF_BUILD=<id>(EXP 限定)SystemVersion.plist の ProductBuildVersion を <id> に書き換え、例: 23F77
|
||||
```
|
||||
|
||||
## 手動セットアップ
|
||||
@@ -117,6 +122,7 @@ make fw_patch # ブートチェーンのパッチ当て(通常
|
||||
# または: sudo make fw_patch_less # patchless バリアント(- AMFI, SSV, Img4, TXM バイパス)
|
||||
# または: make fw_patch_dev # 開発バリアント(+ TXM entitlement/デバッグバイパス)
|
||||
# または: make fw_patch_jb # 脱獄バリアント(dev + 完全セキュリティバイパス)
|
||||
# または: make fw_patch_exp # 実験バリアント(脱獄 + リサーチパッチスタック)
|
||||
```
|
||||
|
||||
### クリーンアップ
|
||||
@@ -186,6 +192,8 @@ python3 -m pymobiledevice3 usbmux forward 2222 22
|
||||
# ターミナル 2
|
||||
make cfw_install
|
||||
# または: make cfw_install_jb # 脱獄バリアント
|
||||
# または: make cfw_install_exp # 実験バリアント(脱獄 + リサーチパッチスタック)
|
||||
# または: SPOOF_BUILD=23F77 make cfw_install_exp # ProductBuildVersion も書き換え
|
||||
```
|
||||
|
||||
## 初回起動
|
||||
|
||||
Reference in New Issue
Block a user