| name | ipsw |
| description | Use this skill when reverse-engineering Apple platforms with the ipsw CLI — analyzing iOS/macOS Mach-O binaries, disassembling functions inside dyld_shared_cache (DSC), dumping Objective-C/Swift headers from private frameworks, extracting kernelcaches, KEXTs, SEP, iBoot, or DeviceTree from IPSWs/OTAs, decompiling/querying sandbox profiles (SBPL), querying entitlements, symbolicating crashes/panics, diffing two firmware versions, mounting IPSW DMGs, or downloading Apple firmware. Triggers on iOS/macOS internals, kernel research, dyld_shared_cache, KEXT diffing, sandbox/Seatbelt profile analysis (SBPL/SBASM/sandboxd), capability/IOKit queries, entitlement lookup, class-dump, IMG4/AEA handling, or vulnerability research on Apple platforms. |
IPSW - Apple Reverse Engineering Toolkit
Install: brew install blacktop/tap/ipsw (Linux: see https://github.com/blacktop/ipsw#install)
Choose Your Workflow
Firmware Acquisition
ipsw download ipsw --device iPhone16,1 --latest
ipsw download ipsw --device iPhone16,1 --latest --kernel --dyld
ipsw extract --kernel iPhone16,1_18.0_Restore.ipsw
ipsw extract --dyld --dyld-arch arm64e iPhone16,1_18.0_Restore.ipsw
ipsw extract --kernel --remote <IPSW_URL>
See references/download.md for device identifiers and advanced options.
Userspace RE (dyld_shared_cache)
macOS DSC location:
- macOS 14+:
/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_arm64e
- macOS 13 and earlier:
/System/Library/dyld/dyld_shared_cache_arm64e
Examples below assume:
export DSC=/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_arm64e
Essential Commands
| Command | Purpose |
|---|
dyld a2s <DSC> <ADDR> | Address → symbol (triage crash LR/PC) |
dyld symaddr <DSC> <SYM> --image <DYLIB> | Symbol → address |
dyld disass <DSC> --vaddr <ADDR> | Disassemble at address |
dyld disass <DSC> --symbol <SYM> --image <DYLIB> | Disassemble by symbol |
dyld xref <DSC> <ADDR> --all | Find all references to address |
dyld dump <DSC> <ADDR> --size 256 | Dump raw bytes at address |
dyld str <DSC> "pattern" --image <DYLIB> | Search strings |
dyld objc --class <DSC> --image <DYLIB> | List ObjC classes |
dyld extract <DSC> <DYLIB> -o ./out/ | Extract dylib for external tools |
Common Workflow
ipsw dyld a2s $DSC 0x1bc39e1e0
ipsw dyld disass $DSC --vaddr 0x1bc39e1e0
ipsw dyld xref $DSC 0x1bc39e1a0 --all
ipsw dyld dump $DSC 0x1bc39e200 --size 64
See references/dyld.md for complete DSC commands.
Kernel Analysis
ipsw kernel kexts kernelcache.release.iPhone16,1
ipsw kernel extract kernelcache sandbox --output ./kexts/
ipsw kernel syscall kernelcache
ipsw kernel kexts --diff kernelcache_17.0 kernelcache_18.0
See references/kernel.md for KEXT extraction and kernel analysis.
Entitlements
ipsw macho info --ent /path/to/binary
ipsw ent --sqlite ent.db --ipsw iOS18.ipsw
ipsw ent --sqlite ent.db --key "com.apple.private.security.no-sandbox"
ipsw ent --sqlite ent.db --key "platform-application"
ipsw ent --sqlite ent.db --key "com.apple.private.tcc.manager"
See references/entitlements.md for common entitlements and query patterns.
Class Dump
Dump Objective-C headers from binaries or dyld_shared_cache:
ipsw class-dump $DSC SpringBoardServices --headers -o ./headers/
ipsw class-dump $DSC Security --class SecKey
ipsw class-dump $DSC UIKit --class 'UIApplication.*' --headers -o ./headers/
ipsw class-dump $DSC Security --re
ipsw swift-dump $DSC SwiftUI --headers -o ./headers/
See references/class-dump.md for filtering and output options.
Mach-O Analysis
ipsw macho info /path/to/binary
ipsw macho disass /path/to/binary --symbol _main
ipsw macho info --ent /path/to/binary
ipsw macho info --sig /path/to/binary
See references/macho.md for complete Mach-O commands.
Firmware Diffing
Compare two IPSWs, OTAs, or patched OTA directories — surfaces added/removed binaries, entitlement changes, function-starts deltas, and KEXT diffs.
ipsw diff old.ipsw new.ipsw --output ./diff/ --markdown
ipsw diff old.ipsw new.ipsw --fw --launchd --output ./diff/ --markdown
ipsw diff old.ipsw new.ipsw --output ./diff/ --markdown \
--kdk <OLD_KDK>/System/Library/Kernels/kernel.release.t6031 \
--kdk <NEW_KDK>/System/Library/Kernels/kernel.release.t6031
ipsw diff old.ipsw new.ipsw --ent --output ./diff/
ipsw diff old.ota new.ota --key-db keys.json --output ./diff/ --markdown
Symbolication
ipsw symbolicate panic-full-2024-03-21.ips iPhone16,1_18.0_Restore.ipsw
ipsw symbolicate panic.ips firmware.ipsw --peek --peek-count 10
ipsw symbolicate crash.ips $DSC
Firmware Components (IMG4, AEA, iBoot, SEP)
For Apple firmware containers — IMG4/IM4P/IM4M, AEA1-encrypted DMGs, iBoot, SEP, AOP, DCP, baseband, and trust caches:
ipsw img4 info my.img4
ipsw img4 extract --im4p my.img4 --output ./
ipsw img4 extract --im4p --im4m --im4r my.img4 -o ./
ipsw fw iboot iBoot.img4
ipsw fw aea --info encrypted.dmg.aea
ipsw fw aea --key encrypted.dmg.aea
ipsw fw tc TrustCache.img4
See ipsw img4 --help and ipsw fw --help for the full list of subcommands.
Sandbox Profile Analysis (sb)
Decode and query Apple sandbox profiles compiled into a kernelcache. Useful for capability analysis ("which profiles can open IOSurface?"), attack-surface mapping, and tracking sandbox changes between releases.
ipsw sb list kernelcache.release.iPhone18,1
ipsw sb dec kernelcache.release.iPhone18,1 com.apple.WebKit.WebContent -O WebContent.sb
ipsw sb opts --diff kernelcache_old kernelcache_new
ipsw sb graph export kernelcache.release.iPhone18,1 -O graph.json
ipsw sb query iokit-open IOSurfaceRootUserClient --graph graph.json
ipsw sb query path-write /private/var/mobile/tmp --graph graph.json
ipsw sb query syscall mmap --graph graph.json
ipsw sb query mach-lookup com.apple.mobilegestalt.xpc --graph graph.json
Available query subcommands: iokit-open, path-read, path-write, syscall, sysctl, mach-lookup, mach-register, preference, notification, cypher.
See references/sandbox.md for the full sandbox toolkit.
IPSW Inspection
ipsw info iPhone16,1_18.0_Restore.ipsw
ipsw info --list iPhone16,1_18.0_Restore.ipsw
ipsw info --remote <IPSW_URL>
ipsw mount fs iPhone16,1_18.0_Restore.ipsw
ipsw mount sys iPhone16,1_18.0_Restore.ipsw
ipsw mount exc iPhone16,1_18.0_Restore.ipsw
ipsw dtree iPhone16,1_18.0_Restore.ipsw --summary
ipsw dtree iPhone16,1_18.0_Restore.ipsw --json | jq '.["device-tree"]["compatible"]'
For AEA-encrypted DMGs (macOS 14+), pass --key-db keys.json or --pem-db pem.json.
Pitfalls
- Symbol cache must be primed. First
dyld a2s/symaddr on a DSC creates <dsc>.a2s. Until then lookups appear to "find nothing". Run dyld a2s $DSC <any-addr> once before scripting bulk lookups.
- AEA-encrypted IPSWs/OTAs. Modern macOS OTAs can ship as AEA1 archives. Pass
--key-val <base64> or --key-db keys.json to commands that need to read them (diff, extract, fw aea).
- Always pass
--image <DYLIB> for DSC ops. Without it, ipsw walks every dylib map — 10x+ slower.
- Multi-arch DSCs need
--dyld-arch. Without it, extraction may pick the wrong slice (arm64 vs arm64e) silently.
Reference Files
Tips
- JSON output: Most commands support
--json for scripting (e.g. ipsw dyld info --dylibs --json $DSC | jq -r '.images[].name').
- Device IDs:
ipsw device-list lists every known identifier; ipsw device-info iPhone16,1 describes a specific one.