code-dump is a cocoa program that decompiles Cocoa programs. See the example here.
It's incorporated into the class-dump source code.
Please read and understand the readme before downloading and using, which is reproduced below:
- The general idea behind decompilation is to reverse the stages of a compiler. Code-dump doesn't do that at all.
- Instead, code-dump relies on the structured nature of Objective-C. It simulates the effect of all PPC instructions and creates Objective-C which should have the same effect.
$ cd src/
$ cd build/Default/
Code-dump is in fact a hacked-up copy of Steve Nygard's class-dump 3.1. Please don't bother him about code-dump. Bother me. I don't know him.
Code-dump operates exactly like class-dump, unless you use the "-d" (decompile) switch, in which case it takes on a crazy life of it's own. This is made clear in the usage.
DECOMPILING TAKES A LONG TIME. Especially because of all the debugging output I haven't gotten around to preprocessoring out. So before you run off to decompile an enormous Objective-C program, be sure to first run code-dump sans -d switch to see the classes. Then use code-dump's -C switch in which you can specify a single class to study. Only decompile ONE class at a time. You will be much happier, I promise.
I don't condone any illegal use of code-dump. DO NOT use it for illegal purposes. Seriously. I only decompile programs that I have compiled. IT IS ONLY INTENDED for recovering source code to your OWN applications, testing on OPEN SOURCE applications, or in certain situations, testing on applications where the AUTHOR HAS GIVEN EXPLICIT PERMISSION DIRECTLY TO YOU. In general, refer to the DMCA if the U.S. is your country of residence (or your country's laws if not). By using code-dump, you are AGREEING to these terms. I take NO RESPONSIBILITY for what you do with code-dump.