iOS逆向工程之class-dump
2017-04-23 18:43
393 查看
最近研究一些iOS逆向工程的知识,发现自己对iOS的了解还有很大的局限。逆向工程会用到很多工具,class-dump便是其中之一。
class-dump,顾名思义就是用来dump目标对象的class信息的工具,它利用的是Objective-C语言的runtime特性,将储存在Mach-O文件的头文件信息取出来,并生成对应的.h文件。下面介绍一下它的使用:
首先去点击打开链接下载最新版class-dump,然后将dmg文件里的class-dump复制到“/usr/bin”下,然后在终端里执行"sudo chmod 777/usr/bin/class-dump"命令赋予其执行权限。运行class-dump,即可看到它的一些参数,如下:
1、打开Terminal,输入mkdir~/bin,在当前用户根目录下创建一个bin目录;
2、把class-dump给拷贝到这个目录里,并赋予其可执行权限:
sudo chmod 777/usr/local/bin/class-dump
再执行
mv class-dump ~/bin;chmod +x ~/bin/class-dump;
3、打开~/.bash_profile文件:vi~/.bash_profile,在文件最上方加一行:
exportPATH=$HOME/bin/:$PATH,
然后保存并退出(在英文输入法中依次按下esc和:(shift
+ ;,即冒号),然后输入wq,回车即可);
4、在Terminal中执行source~/.bash_profile;
5、上面的操作把~/bin路径给加入了环境变量,我们测试一下好不好用;
使用方法:
在Terminal中执行:class-dump -H 我的app -o 我的app.h,我的app是你要提取的app的ipa文件,我的app.h是导出的目录,这样就可以去提取一些你想要了解的app的头文件了。
class-dump,顾名思义就是用来dump目标对象的class信息的工具,它利用的是Objective-C语言的runtime特性,将储存在Mach-O文件的头文件信息取出来,并生成对应的.h文件。下面介绍一下它的使用:
首先去点击打开链接下载最新版class-dump,然后将dmg文件里的class-dump复制到“/usr/bin”下,然后在终端里执行"sudo chmod 777/usr/bin/class-dump"命令赋予其执行权限。运行class-dump,即可看到它的一些参数,如下:
class-dump 3.5 (64 bit) Usage: class-dump [options] <mach-o-file> where options are: -a show instance variable offsets -A show implementation addresses --arch <arch> choose a specific architecture from a universal binary (ppc, ppc64, i386, x86_64) -C <regex> only display classes matching regular expression -f <str> find string in method name -H generate header files in current directory, or directory specified with -o -I sort classes, categories, and protocols by inheritance (overrides -s) -o <dir> output directory used for -H -r recursively expand frameworks and fixed VM shared libraries -s sort classes and categories by name -S sort methods by name -t suppress header in output, for testing --list-arches list the arches in the file, then exit --sdk-ios specify iOS SDK version (will look in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS<version>.sdk --sdk-mac specify Mac OS X version (will look in /Developer/SDKs/MacOSX<version>.sdk --sdk-root specify the full SDK root path (or use --sdk-ios/--sdk-mac for a shortcut)但可能因为你的Mac版本过高没有/usr/sin这一项,可以按一下操作:
1、打开Terminal,输入mkdir~/bin,在当前用户根目录下创建一个bin目录;
2、把class-dump给拷贝到这个目录里,并赋予其可执行权限:
sudo chmod 777/usr/local/bin/class-dump
再执行
mv class-dump ~/bin;chmod +x ~/bin/class-dump;
3、打开~/.bash_profile文件:vi~/.bash_profile,在文件最上方加一行:
exportPATH=$HOME/bin/:$PATH,
然后保存并退出(在英文输入法中依次按下esc和:(shift
+ ;,即冒号),然后输入wq,回车即可);
4、在Terminal中执行source~/.bash_profile;
5、上面的操作把~/bin路径给加入了环境变量,我们测试一下好不好用;
使用方法:
在Terminal中执行:class-dump -H 我的app -o 我的app.h,我的app是你要提取的app的ipa文件,我的app.h是导出的目录,这样就可以去提取一些你想要了解的app的头文件了。
相关文章推荐
- Mac使用class-dump进行IOS逆向工程
- iOS逆向工程二:Mac工具集之class-dump的使用
- (iOS逆向工程)class-dump 安装与使用
- (iOS逆向工程)class-dump 安装与使用
- [iOS 通过class-dump] 逆向出方法名/属性列表
- iOS逆向工程(简单利用"dumpdecrypted"给ipa砸壳)
- 通过iclutch、以及class-dump逆向出ios上app的类定义及头文件
- iOS逆向工程(简单利用"dumpdecrypted"给ipa砸壳)
- iOS逆向之class-dump
- iOS逆向 class-dump的安装和使用
- IOS应用逆向工程之App砸壳:通过dumpdecrypted.dylib
- iOS 逆向 - Class-dump 安装和使用方法
- iOS 逆向工具篇(一) class-dump
- iOS逆向工程(简单利用"dumpdecrypted"给ipa砸壳)
- iOS_逆向_使用class dump导出头文件
- iOS逆向与安全 - 2. class-dump 获取头文件
- 关于iOS逆向工程的工具(一)
- class-dump获取iOS私有api
- 我也要学iOS逆向工程--全局变量
- IOS 逆向工程之砸壳