Improve support for older kernel caches (pre-iOS 16 / MH_FILESET)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cpp, ios, macos
- Domain
- operating-systems, reverse-engineering
Research direction
Reproduce the issue by running the listed ipsw download and ipsw extract commands, then open kernelcache.release.iPhone9,1_3 in Binary Ninja. Compare analysis time and results for the older MH_EXECUTE cache, focusing on the indirect calls and IOKit C++ vtables described in the report; done means these caches receive appropriate analysis without the listed slowdowns and omissions.
Written by the indexing model from the issue text.
Description
Version and Platform (required):
- Binary Ninja Version: 5.3.9417-dev Ultimate, 8f260d72
- OS: macos
- OS Version: 26.3.1
- CPU Architecture: arm64
Bug Description:
macOS 11 / iOS 16 moved their kernel caches to the newer MH_FILESET format. Prior to that, they used MH_EXECUTE. Binary Ninja ends up loading these older kernel caches as if they were any other Mach-O executable.
I see a couple of problems when loading kernelcache.release.iPhone9,1_3 from iOS 19H364:
- Analysis is much slower than I'd expect, even given the relatively large binary size (~43MB). Phases 2 and 3 are particularly slow. The initial phase takes ~3 minutes, with the final two phases taking over 45 minutes as they discover and analyze an additional ~80,000 functions.
- The kernel cache contains indirect calls via pointers in sections the Mach-O headers indicate are writable. These appear to be used for cross-image calls (i.e., kext to kernel). Since the pointer appears to be writable we do not resolve the indirect call target, which severely hampers analysis.
- C++ vtables for IOKit classes are not detected or processed.
Steps To Reproduce:
ipsw download appledb --os iOS --version 15.7.8 --device iPhone9,1
ipsw extract --kernel iPhone_4.7_P3_15.7.8_19H364_Restore.ipsw
Then open 19H364__iPhone9,1_3/kernelcache.release.iPhone9,1_3 and wait.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Vector35/binaryninja-api
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8540 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8516 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Vector35/binaryninja-api#8503 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8446 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8444 ·
All issues in Vector35/binaryninja-api
Similar issues
-
Website Doc Typo Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
automated-analysis bug memory-safety
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100