1. 程式人生 > >class-dump,分析可執行/app檔案的函式定義

class-dump,分析可執行/app檔案的函式定義

下面是我對自己寫的一個demo程式,GKDemo.app用class-dump解析後得到的結果:

note: /Users/tonys/Library/Developer/Xcode/DerivedData/GKDemo-bgpwxsribkdlyphduyucdubnqbed/Build/Products/Debug-iphoneos/GKDemo.app是app所在的目錄。

nicktest:Work tonys$ ./class-dump  /Users/tonys/Library/Developer/Xcode/DerivedData/GKDemo-bgpwxsribkdlyphduyucdubnqbed/Build/Products/Debug-iphoneos/GKDemo.app
/*
 *     Generated by class-dump 3.3.4 (64 bit).
 *
 *     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
 */


#pragma mark Named Structures


struct CGPoint {
    float _field1;
    float _field2;
};


struct CGRect {
    struct CGPoint _field1;
    struct CGSize _field2;
};


struct CGSize {
    float _field1;
    float _field2;
};


#pragma mark -


/*
 * File: /Users/tonys/Library/Developer/Xcode/DerivedData/GKDemo-bgpwxsribkdlyphduyucdubnqbed/Build/Products/Debug-iphoneos/GKDemo.app/GKDemo
 * UUID: 15E9B62A-A4F6-3717-BE4C-997222F9F9DB
 * Arch: arm v7 (armv7)
 *       Minimum iOS version: 4.3.0
 *
 *       Objective-C Garbage Collection: Unsupported
 */


@protocol GKPeerPickerControllerDelegate <NSObject>


@optional
- (void)peerPickerControllerDidCancel:(id)arg1;
- (void)peerPickerController:(id)arg1 didConnectPeer:(id)arg2 toSession:(id)arg3;
- (id)peerPickerController:(id)arg1 sessionForConnectionType:(unsigned int)arg2;
- (void)peerPickerController:(id)arg1 didSelectConnectionType:(unsigned int)arg2;
@end


@protocol GKSessionDelegate <NSObject>


@optional
- (void)session:(id)arg1 didFailWithError:(id)arg2;
- (void)session:(id)arg1 connectionWithPeerFailed:(id)arg2 withError:(id)arg3;
- (void)session:(id)arg1 didReceiveConnectionRequestFromPeer:(id)arg2;
- (void)session:(id)arg1 peer:(id)arg2 didChangeState:(int)arg3;
@end


@protocol NSObject
- (id)debugDescription;
- (id)description;
- (unsigned int)retainCount;
- (id)autorelease;
- (oneway void)release;
- (id)retain;
- (BOOL)respondsToSelector:(SEL)arg1;
- (BOOL)conformsToProtocol:(id)arg1;
- (BOOL)isMemberOfClass:(Class)arg1;
- (BOOL)isKindOfClass:(Class)arg1;
- (BOOL)isProxy;
- (id)performSelector:(SEL)arg1 withObject:(id)arg2 withObject:(id)arg3;
- (id)performSelector:(SEL)arg1 withObject:(id)arg2;
- (id)performSelector:(SEL)arg1;
- (struct _NSZone *)zone;
- (id)self;
- (Class)class;
- (Class)superclass;
- (unsigned int)hash;
- (BOOL)isEqual:(id)arg1;
@end


@protocol UIApplicationDelegate <NSObject>


@optional
@property(retain, nonatomic) UIWindow *window;
- (void)applicationProtectedDataDidBecomeAvailable:(id)arg1;
- (void)applicationProtectedDataWillBecomeUnavailable:(id)arg1;
- (void)applicationWillEnterForeground:(id)arg1;
- (void)applicationDidEnterBackground:(id)arg1;
- (void)application:(id)arg1 didReceiveLocalNotification:(id)arg2;
- (void)application:(id)arg1 didReceiveRemoteNotification:(id)arg2;
- (void)application:(id)arg1 didFailToRegisterForRemoteNotificationsWithError:(id)arg2;
- (void)application:(id)arg1 didRegisterForRemoteNotificationsWithDeviceToken:(id)arg2;
- (void)application:(id)arg1 didChangeStatusBarFrame:(struct CGRect)arg2;
- (void)application:(id)arg1 willChangeStatusBarFrame:(struct CGRect)arg2;
- (void)application:(id)arg1 didChangeStatusBarOrientation:(int)arg2;
- (void)application:(id)arg1 willChangeStatusBarOrientation:(int)arg2 duration:(double)arg3;
- (void)applicationSignificantTimeChange:(id)arg1;
- (void)applicationWillTerminate:(id)arg1;
- (void)applicationDidReceiveMemoryWarning:(id)arg1;
- (BOOL)application:(id)arg1 openURL:(id)arg2 sourceApplication:(id)arg3 annotation:(id)arg4;
- (BOOL)application:(id)arg1 handleOpenURL:(id)arg2;
- (void)applicationWillResignActive:(id)arg1;
- (void)applicationDidBecomeActive:(id)arg1;
- (BOOL)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2;
- (void)applicationDidFinishLaunching:(id)arg1;
@end


@interface __ARCLite__
{
    Class isa;
}


+ (void)load;


@end


@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
    UIWindow *_window;
    ViewController *_viewController;
}


@property(retain, nonatomic) ViewController *viewController; // @synthesize viewController=_viewController;
@property(retain, nonatomic) UIWindow *window; // @synthesize window=_window;
- (void).cxx_destruct;
- (void)applicationWillTerminate:(id)arg1;
- (void)applicationDidBecomeActive:(id)arg1;
- (void)applicationWillEnterForeground:(id)arg1;
- (void)applicationDidEnterBackground:(id)arg1;
- (void)applicationWillResignActive:(id)arg1;
- (BOOL)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2;


@end


@interface ViewController : UIViewController <GKPeerPickerControllerDelegate, GKSessionDelegate>
{
    NSMutableArray *_touchesValue;
    NSMutableArray *_peerTouchesValue;
    GKPeerPickerController *_gamePickerController;
    GKSession *_gameSession;
}


@property(retain, nonatomic) GKSession *gameSession; // @synthesize gameSession=_gameSession;
@property(retain, nonatomic) GKPeerPickerController *gamePickerController; // @synthesize gamePickerController=_gamePickerController;
@property(retain, nonatomic) NSMutableArray *peerTouchesValue; // @synthesize peerTouchesValue=_peerTouchesValue;
@property(retain, nonatomic) NSMutableArray *touchesValue; // @synthesize touchesValue=_touchesValue;
- (void).cxx_destruct;
- (void)receiveData:(id)arg1 fromPeer:(id)arg2 inSession:(id)arg3 context:(void *)arg4;
- (void)session:(id)arg1 peer:(id)arg2 didChangeState:(int)arg3;
- (void)session:(id)arg1 didReceiveConnectionRequestFromPeer:(id)arg2;
- (void)peerPickerControllerDidCancel:(id)arg1;
- (void)peerPickerController:(id)arg1 didConnectPeer:(id)arg2 toSession:(id)arg3;
- (id)peerPickerController:(id)arg1 sessionForConnectionType:(unsigned int)arg2;
- (void)peerPickerController:(id)arg1 didSelectConnectionType:(unsigned int)arg2;
- (void)startGame:(id)arg1;
- (id)methodSignatureForSelector:(SEL)arg1;
- (void)oneParamMethod:(id)arg1 second:(id)arg2;
- (void)forwardInvocation:(id)arg1;
- (BOOL)shouldAutorotateToInterfaceOrientation:(int)arg1;
- (void)viewDidDisappear:(BOOL)arg1;
- (void)viewWillDisappear:(BOOL)arg1;
- (void)viewDidAppear:(BOOL)arg1;
- (void)viewWillAppear:(BOOL)arg1;
- (void)touchesCancelled:(id)arg1 withEvent:(id)arg2;
- (void)touchesEnded:(id)arg1 withEvent:(id)arg2;
- (void)touchesMoved:(id)arg1 withEvent:(id)arg2;
- (void)touchesBegan:(id)arg1 withEvent:(id)arg2;
- (void)updateTouches;
- (void)addTouchesValue:(struct CGPoint)arg1;
- (void)viewDidUnload;
- (void)viewDidLoad;
- (void)didReceiveMemoryWarning;


@end


@interface MyObject : NSObject
{
}


- (void)didnotexistmethod:(id)arg1 second:(unsigned int)arg2;


@end