Commit Graph

23 Commits

Author SHA1 Message Date
Lakr
b50b630d19 Isolate multi-VM setup with deterministic device targeting 2026-03-06 12:46:12 +08:00
TastyHeadphones
5c2bce03dd build: preserve swift build failures in make target (#115) 2026-03-06 10:50:21 +08:00
Lakr
5388e0c9c5 Squash merge startup-hang-fix into main
Prefix research patch comparison doc and normalize root markdown names

Rename research root markdown files to scoped topic names
2026-03-06 02:42:12 +08:00
Lakr
4669bfbd17 Update testing_exec.sh
Update testing_exec.sh

Update Makefile
2026-03-05 02:57:49 +08:00
Lakr
fdc3e28ae3 Squash merge JB kernel runtime optimizations and testing workflow 2026-03-05 00:33:18 +08:00
Lakr
cb63ffa3b2 Remove temporary testing scripts and Makefile targets
These were used for per-patch kernel JB debugging (C23 bisect,
single-patch boot test, batch testing). No longer needed now that
A2, C23, and C24 are all boot-tested and fixed.
2026-03-04 21:43:02 +08:00
Lakr
894c2d1551 Fix C23: vnode_getattr string anchor resolved to wrong function (AppleImage4)
Root cause: find_string("vnode_getattr") matched "%s: vnode_getattr: %d"
format string inside an AppleImage4 function. The old code then took that
function as vnode_getattr itself, causing BL to call into AppleImage4 with
wrong arguments → PAC failure on indirect branch at a2+48.

Fix: _find_vnode_getattr_via_string() now scans backward from the string
ref for a BL instruction and extracts its target — the real vnode_getattr
(sub_FFFFFE0007CCD1B4 at foff 0xCC91B4).

Bisection confirmed: variants A (stack frame) and B (+ tpidr_el1) boot OK,
variant C (+ BL vnode_getattr) panics with old resolution, boots OK with fix.

Boot-tested: full C23 patch with corrected vnode_getattr — BOOTS OK.
2026-03-04 21:21:23 +08:00
Lakr
ae599d5b3b Add kernel patch testing scripts and targets
Introduce a set of tools for fast and batch testing of kernel JB patches: add testing_batch.sh, testing_do_patch.sh, testing_do_save.sh and testing_kernel_patch.py (plus a results _summary). Update the Makefile with new targets (testing_do_save, testing_kernel_patch, testing_do_patch, testing_batch) and PHONY entries to wire them into the build/test workflow. Modify kernel_jb.py to enable the amfi cdhash-in-trustcache patch (A1) and mark the amfi execve kill-path patch as causing PANIC (A2). These changes allow restoring a base kernel backup, applying single patches quickly, running per-patch DFU boots (with timeout/panic detection), and collecting logs for batch runs.
2026-03-04 19:51:48 +08:00
Lakr
9bb53b7368 Add testing_do script and Makefile target
Introduce a new zsh helper script (scripts/testing_do.sh) and a Makefile target (testing_do) to automate the testing DFU workflow. The script sets strict error handling, kills any existing vphone-cli, runs fw_prepare, fw_patch_jb and testing_ramdisk_build, sends the ramdisk in the background, boots DFU, and tracks/cleans up child processes on exit. This simplifies and sequences the steps required to prepare, patch, send and boot the test ramdisk.
2026-03-04 19:18:24 +08:00
Lakr
ec2a071fa4 fix testing ramdisk copy: boots fine, no panic 2026-03-04 18:14:37 +08:00
Lakr
4692a9bee4 add testing ramdisk: boot chain only (no rootfs, kernel will panic)
Sign patched firmware components (iBSS/iBEC/SPTM/DeviceTree/SEP/TXM/
kernelcache) into IMG4 without ramdisk or trustcache. Useful for
verifying boot chain patches in isolation.
2026-03-04 17:28:06 +08:00
Lakr
55a53e7179 Merge pull request #73 from p1atdev/ssh-retry
Add SSH retry logic to cfw_install and cfw_install_jb scripts
2026-03-04 11:07:30 +08:00
Lakr
fa054ca719 Add Git LFS instructions and fix Makefile help alignment
- Add git-lfs to brew deps and document git lfs install/pull steps
  in both English and Chinese READMEs
- Fix continuation line alignment in make help (off by one)
- Add missing blank line before VM management section
2026-03-03 13:09:31 +08:00
Lakr
fa65403002 Merge pull request #53 from zqxwce/feature/ipsw-dir
fw_prepare: Move ipsws to dedicated directory to avoid repeated downloads
2026-03-03 02:34:37 +08:00
Lakr
8c7d9911a2 Clean up location passthrough PR: consistent formatting and logging 2026-03-02 19:28:53 +08:00
Lakr
c0f0efa492 Merge pull request #51 from SongXiaoXi/main
feat: add host location passthrough to guest VM
2026-03-02 18:36:38 +08:00
Lakr
e5fdad341f Skip vsock control connection in DFU mode
No guest OS is running in DFU, so attempting to connect causes
endless "Connection reset by peer, retrying..." log spam.
2026-03-02 18:36:12 +08:00
Lakr
4c74692ac2 Merge pull request #48 from SongXiaoXi/main
Add vphoned — vsock-based host↔guest control channel
2026-03-02 13:01:44 +08:00
Lakr
d179b4f6be Merge PR #45 (unlock VM) and PR #46 (tool compat fallbacks)
- Add `unlock` tool: C program dispatching IOHIDEvent to wake/unlock screen
- Rework serial port to pipes for programmatic command injection
- Auto-unlock on non-DFU boot via serial console after 8s delay
- Add "Unlock" menu item, `make unlock`/`make unlock_deploy` targets
- Defer to native VZVirtualMachineView touch on macOS 16+
- Add sshpass resolver with bundled/host fallback and arch checks
- Add gtar resolver with bundled/host/tar fallback and arch checks
- Prevent host-arch mismatches from breaking cfw_install and ramdisk_build

Closes #45, closes #46
Fixes #38, fixes #41

Co-authored-by: webcpu <liang@unchartedworks.com>
Co-authored-by: tastyheadphones <tastyheadphones@icloud.com>
2026-03-02 10:46:20 +08:00
Lakr
1d7ae7fe55 Merge pull request #42 from zqxwce/main 2026-03-02 11:24:30 +09:00
Lakr
154d5064ec Add JB install pipeline and update docs
Add jailbreak extension patchers and targets:
- kernel_jb.py: 22 dynamic kernel patches (trustcache, execve cs_flags,
  sandbox ops, task/VM, kcall10 syscall hook, ~160 total modifications)
- txm_jb.py: 13 TXM patches (CS validation, get-task-allow, debugger
  entitlement, dev mode bypass)
- iboot_jb.py: iBSS nonce generation skip
- cfw.py: launchd jetsam patch, dylib injection commands
- fw_patch_jb.py: orchestrator running base + JB extension patches
- cfw_install_jb.sh: JB install phases (launchd jetsam fix, procursus
  bootstrap + Sileo deployment)

3 kernel patches still WIP (nvram_verify_permission, thid_should_crash,
hook_cred_label_update_execve) — strategies documented in
researchs/kernel_jb_remaining_patches.md.

All base (non-JB) code paths verified unaffected — kernel.py produces
identical 25 patches, cfw.py base commands unchanged.

Add Linux venv setup script; tweak Makefile help

Add scripts/setup_venv_linux.sh to create a Python virtualenv on Debian/Ubuntu (or dnf-based) systems, install system packages and Python requirements, and verify core imports (capstone, keystone, pyimg4). Also update Makefile help text to mark the fw_patch_jb target as WIP. This simplifies local development setup on Linux and clarifies that the JB extension patches are a work in progress.

Update AGENTS.md: mark cfw_install_jb.sh as complete
2026-03-01 15:01:32 +09:00
Lakr
8200cd5a55 Update README.md 2026-03-01 02:47:52 +09:00
Lakr
e65e78d090 Update README.md
Update README.md

Add Simplified Chinese README and link

Add README_zh-Hans.md containing a full Simplified Chinese translation of the project README and update README.md to include a link/badge to the new Chinese README. This makes the documentation accessible to zh-Hans readers.
2026-02-28 03:38:14 +09:00