Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to class-dump iPad apps?

I am trying to run class-dump an iPad app to explore its architecture. I extracted the .ipa file using The Unarchiver and from inside the Payload folder, I ran class-dump on the .app file. However, I get this error:

/*
 *     Generated by class-dump 3.3.3 (64 bit).
 *
 *     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard.
 */

#pragma mark -

/*
 * File: /Users/jason/Desktop/foo/Foo.app/Foo
 * UUID: 1234567890
 * Arch: arm v7 (armv7)
 *
 *       Objective-C Garbage Collection: Unsupported
 *       This file is encrypted:
 *           cryptid: 0x00000001, cryptoff: 0x00001000, cryptsize: 0x00073000
 */

Any ideas?

Thanks.

like image 979
jasonbogd Avatar asked Jan 23 '11 21:01

jasonbogd


People also ask

What is class dump?

Class Dump Dump is a tool for viewing the class definition in the given class file. Unlike the JDK javap tool, Dump works even if the class file is broken. For example, % java javassist.tools.Dump foo.class. prints the contents of the constant pool and the list of methods and fields.

What is the use of class dump?

This is a command-line utility for examining the Objective-C runtime information stored in Mach-O files. It generates declarations for the classes, categories and protocols.


2 Answers

The issue here is that the binary you obtained has been signed and encrypted to be used on the App Store. In order to class dump or disassemble it you will need to obtain an unencrypted binary. The easiest way to get this is to use GDB to dump the executable when it's running (since the iPhone decrypts the binary to run it).

Of course, this will require a jailbroken device.

like image 179
Ben S Avatar answered Oct 21 '22 06:10

Ben S


I have written an article on how you can use gdb and other debugging tools to decrypt an IOS application so you can dump the class info using class-dump-z

http://timourrashed.com/decrypting-ios-app/

like image 26
PhoenixCoder Avatar answered Oct 21 '22 07:10

PhoenixCoder