Objective-C基本分析法 反编译

Objective-C反编译技术解析
本文深入探讨Objective-C编程语言,重点解析其基本分析法和反编译过程。通过对Objective-C代码的逆向工程,揭示了类、方法和消息传递的底层工作原理,为开发者提供了理解和调试iOS应用的新视角。

以Hello World程序为例:

代码:
#import <foundation/foundation.h>@interface SaySomething :NSObject- (void) sayNSString *)phrase;@end@implementation SaySomething- (void) sayNSString *)phrase{    printf("%s\n", [phrase UTF8String]);}@endint main(){    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];    SaySomething *saySomething = [[SaySomething alloc] init];    [saySomething say"Hello World!"];    [saySomething release];    [pool release];    return 0;}</foundation>
保存为hello.m,使用如下命令编译:

引用:
iMAC:ios$ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -o hello hello.m -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/ -framework Foundation -lobjc 

查看所使用的dylib:


引用:
iMAC:ios$ otool -L hello
hello:
/System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 992.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)    //包含这个文件则为objective-c编译的文件
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 173.8.0)
/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 793.0.0) 

dump文件中的相关数据信息:

引用:
iMAC:ios$ 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值