ipadecrypt
ipadecrypt copied to clipboard
Bug: universal/fat decrypt can still output cryptid != 0 after success
What happens
Decrypt can report success, but final verify still fails with cryptid != 0 for universal/fat binaries.
Reproduction
- Some of the apps that fail to decrypt:
- https://apps.apple.com/us/app/zombiebooth-2-zombie-selfie/id689913130
- https://apps.apple.com/us/app/chubby-booth-plump-you-face/id958811911
- https://apps.apple.com/us/app/hair-styles-haircuts-color-makeover-salon-booth/id1069785796
- https://apps.apple.com/us/app/video-compressor-size-reduce/id1076279145
- https://apps.apple.com/us/app/weaphones-firearms-sim-mini/id539694058
- https://apps.apple.com/us/app/falldown-the-falling-ball-game/id462132333
Likely cause
For fat binaries:
- metadata (
cryptoff/cryptsize/cryptid) can be taken from one slice while runtime bytes come from another slice - encrypted sibling slices can remain in output and trigger final verify failure
Expected fix
- Match the on-disk slice to the runtime-loaded slice using:
cputypecpusubtype(capability bits masked)- 32/64-bit header class
- Support both fat32 and fat64
- Apply consistently across:
- main executable path
- dyld-loaded framework path
- rescue/mmap path
- Ensure final kept output slices are not encrypted:
- thin to matched runtime slice, or
- clear/decrypt
cryptidfor all kept slices
Important edge case
Even when the runtime-loaded slice is already clear (cryptid=0), final output must not retain encrypted sibling slices in the same fat binary (e.g., armv7 cryptid=1), or final verify still fails.
Reference patch
-
helper/helper.chttps://gist.github.com/b1atant/5b27c7fddc51d738ee32863c6505bf7d
Disclosure
- AI was used to generate the reference C patch and I validated behavior/results.
- I do not write or understand C, so I am filing an issue instead of a PR.
- I am documenting the bug and the full reproduction steps, and leaving the final implementation to developers who understand C better.
What is the iOS and jailbreak?
iPhone 11 running iOS 16.1.1 and Dopamine rootless
Addressed in 0.5.3