ios-reverse-engineering-skill iOS Reverse & Tweak Engineering Suite

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.

View on GitHub Install Guide

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 FileDescription
01-mach-header.txtMach-O magic, CPU architecture type, flags, and slice offsets
02-load-commands.txtEvery load command including LC_SEGMENT_64, LC_LOAD_DYLIB, and LC_RPATH
03-segments.csvComplete segment and section breakdown (address, size, offset, memory flags)
04-linked-libraries.txtEvery linked system framework and third-party dynamic library
05-build-version.txtMinimum deployment OS target, SDK version, and compiler toolchain
06-code-signature.txtCode signature SuperBlob, identity, and team identifier
07-entitlements.plistExtracted entitlement keys and security capabilities
09-encryption.txtFairPlay encryption cryptid status and encrypted byte ranges
10-info-plist.jsonParsed bundle metadata, URL schemes, and background modes
11-frameworks.txtEmbedded frameworks and versions shipped inside the bundle
14-swift-symbols.txtDemangled Swift class names, structs, enums, and functions
16-objc-classes.txtObjective-C class dump (classes, protocols, methods, and selectors)
18-strings-main.txtExtracted string literals from __cstring and __data
manifest.jsonMachine-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

Next Steps