ios逆向之路之一
class-dump下載地址:http://stevenygard.com/projects/class-dump/
升級了OSX 10.11在配置class-dump的時候,會發(fā)現(xiàn)書上推薦的class-dump存放目錄/usr/bin,class-dump存放不進(jìn)去,并且bin該文件夾的相關(guān)的權(quán)限也修改不了。

Paste_Image.png
參考網(wǎng)址:http://blog.csdn.net/majiakun1/article/details/52064435
根據(jù)上面網(wǎng)址所說整理一下:
跟著下面的步驟走
1、打開Terminal,輸入mkdir ~/bin,在當(dāng)前用戶根目錄下創(chuàng)建一個bin目錄;
2、把class-dump給拷貝到這個目錄里,并賦予其可執(zhí)行權(quán)限:
sudo chmod 777 /usr/local/bin/class-dump
再執(zhí)行
mv class-dump ~/bin; chmod +x ~/bin/class-dump;
3、打開~/.bash_profile文件:vi ~/.bash_profile,在文件最上方加一行:
export PATH=$HOME/bin/:$PATH,
然后保存并退出(在英文輸入法中依次按下esc和:(shift + ;,即冒號),然后輸入wq,回車即可);
4、在Terminal中執(zhí)行source ~/.bash_profile;
5、上面的操作把~/bin路徑給加入了環(huán)境變量,我們測試一下好不好用;
測試的結(jié)果:
localhost:bin zy$ class-dump
class-dump 3.5 (64 bit)
Usage: class-dump [options]
where options are:
-a? ? ? ? ? ? show instance variable offsets
-A? ? ? ? ? ? show implementation addresses
--arch ? choose a specific architecture from a universal binary (ppc, ppc64, i386, x86_64, armv6, armv7, armv7s, arm64)
-C ? ? only display classes matching regular expression
-f ? ? ? 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 ? ? ? 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.sdk
--sdk-mac? ? ? specify Mac OS X version (will look in /Developer/SDKs/MacOSX.sdk
--sdk-root? ? specify the full SDK root path (or use --sdk-ios/--sdk-mac for a shortcut)