How to Decompile an IPA File
Decompiling an iOS IPA file involves unpacking the app archive, selecting the ARM64 Mach-O executable, parsing binary segments and load commands, and executing native decompilation. The ios-reverse-engineering suite automates this entire pipeline in one command and produces 19 structural reports plus C decompiled output.
The One-Command Teardown
Execute the teardown command against an IPA, app bundle, or dynamic library:
bash scripts/teardown.sh app.ipa
The script opens the ZIP archive, finds the Payload/*.app bundle, reads Info.plist, resolves CFBundleExecutable, selects the arm64 slice, and writes the complete report folder.
What You Get
| Report File | Description |
|---|---|
01-mach-header.txt | Mach-O magic, CPU architecture type, flags, and slice offsets |
02-load-commands.txt | Every load command including LC_SEGMENT_64, LC_LOAD_DYLIB, and LC_RPATH |
03-segments.csv | Complete segment and section breakdown (address, size, offset, memory flags) |
04-linked-libraries.txt | Every linked system framework and third-party dynamic library |
05-build-version.txt | Minimum deployment OS target, SDK version, and compiler toolchain |
06-code-signature.txt | Code signature SuperBlob, identity, and team identifier |
07-entitlements.plist | Extracted entitlement keys and security capabilities |
09-encryption.txt | FairPlay encryption cryptid status and encrypted byte ranges |
10-info-plist.json | Parsed bundle metadata, URL schemes, and background modes |
11-frameworks.txt | Embedded frameworks and versions shipped inside the bundle |
14-swift-symbols.txt | Demangled Swift class names, structs, enums, and functions |
16-objc-classes.txt | Objective-C class dump (classes, protocols, methods, and selectors) |
18-strings-main.txt | Extracted string literals from __cstring and __data |
manifest.json | Machine-readable JSON summary of the complete analysis |
Native Decompilation with Ghidra
Because Mach-O contains compiled native ARM64 machine instructions rather than bytecode, native decompilation is required. The suite uses Ghidra in headless mode with bundled automation scripts:
bash scripts/teardown.sh --decompile --decompile-limit 500 app.ipa
The headless step writes one readable C file per function into decompiled/.
Encrypted App Store Binaries
Binaries downloaded from the App Store have an encrypted __TEXT code segment. If cryptid is 1, static decompilers cannot read the instructions. Verify encryption before decompiling:
bash scripts/check-encryption.sh app.ipa
If the output reports ENCRYPTED, read the FairPlay DRM Triage Guide to decrypt the binary using on-device tools like bagbak or frida-ios-dump.
Device and Simulator Slices
Always analyze the arm64 or arm64e slice. The x86_64 slice belongs to the simulator:
bash scripts/teardown.sh --arch arm64 app.ipa
Objective-C Class Headers
To reconstruct class headers (.h) for all Objective-C classes:
bash scripts/teardown.sh --headers app.ipa