class-dump is a command-line utility for examining the Objective-C segment of Mach-O files. It generates declarations for the classes, categories and protocols. This is the same information provided by using 'otool -ov', but presented as normal Objective-C declarations.ios
這是class-dump的官方解釋,咱們用的最多就是作iOS的逆向工程。class-dump,是能夠把Objective-C運行時的聲明的信息導出來的工具。其實就是能夠導出.h文件。用class-dump能夠把未經加密的app的頭文件導出來。app
官方網址:http://stevenygard.com/projects/class-dump/框架
class-dump的下載地址:http://stevenygard.com/download/class-dump-3.5.tar.gzide
點擊下載後解壓後會有class-dump和源碼文件。將class-dump 複製到/usr/bin/class-dump。若是是OS X 10.11,由於沒有/usr/bin文件夾的寫權限,因此將class-dump複製到/usr/local/bin/class-dump便可。工具
同時打開Terminal,執行命令賦予其執行權限:加密
sudo chmod 777 /usr/bin/class-dumpcode
使用class-dump導出頭文件的命令格式:orm
class-dump -H 須要導出的框架路徑 -o 導出的頭文件存放路徑blog
1)找到DVTKit框架路徑get
2)使用上述的操做命令格式
class-dump AppKit:
class-dump /System/Library/Frameworks/AppKit.framework
class-dump UIKit:
class-dump /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/UIKit.framework
class-dump UIKit and all the frameworks it uses:
class-dump /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/UIKit.framework -r --sdk-ios 4.3
class-dump UIKit (and all the frameworks it uses) from developer tools that have been installed in /Dev42 instead of /Developer:
class-dump /Dev42/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework -r --sdk-root /Dev42/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
以上就是安裝並使用class-dump的所有過程,但願對你們有所幫助。