ios逆向之路之一
class-dump下載地址:http://stevenygard.com/projects/class-dump/
升級了OSX 10.11在配置class-dump的時候掏觉,會發(fā)現書上推薦的class-dump存放目錄/usr/bin,class-dump存放不進去冕臭,并且bin該文件夾的相關的權限也修改不了。
Paste_Image.png
參考網址:http://blog.csdn.net/majiakun1/article/details/52064435
根據上面網址所說整理一下:
跟著下面的步驟走
1版姑、打開Terminal,輸入mkdir ~/bin躺苦,在當前用戶根目錄下創(chuàng)建一個bin目錄痹束;
2、把class-dump給拷貝到這個目錄里九杂,并賦予其可執(zhí)行權限:
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)境變量唱逢,我們測試一下好不好用;
測試的結果:
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)