美文网首页iOS 开发学习成长之路iOS 坑的集中营iOS 开发
逆向工程之当/usr/bin安装不了class-dump怎么办

逆向工程之当/usr/bin安装不了class-dump怎么办

作者: 踩坑小分队 | 来源:发表于2016-10-10 17:40 被阅读1747次

class-dump下载地址:http://stevenygard.com/projects/class-dump/
升级了OSX 10.11在配置class-dump的时候,会发现书上推荐的class-dump存放目录/usr/bin,class-dump存放不进去,并且bin该文件夹的相关的权限也修改不了。

Paste_Image.png
参考网址:http://blog.csdn.net/majiakun1/article/details/52064435
根据上面网址所说整理一下:
跟着下面的步骤走
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,在文件最上方加一行:
export PATH=$HOME/bin/:$PATH,
然后保存并退出(在英文输入法中依次按下esc和:(shift + ;,即冒号),然后输入wq,回车即可);
4、在Terminal中执行source ~/.bash_profile;
5、上面的操作把~/bin路径给加入了环境变量,我们测试一下好不好用;

测试的结果:

localhost:bin zy$ 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, armv6, armv7, armv7s, arm64)
        -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)

有啥错误希望各路大神指点,会尽快修改。

相关文章

网友评论

  • 顺其自然2017:第三步,具体如何执行啊,我弄完之后报错-bash: [: missing `]'
    顺其自然2017:@踩坑小分队 没问题,是我自己出问题了,搞清楚了,新建tweak的时候需要注意填写想要hook的app bundleid 系统的话,就是springBoard ,这个地方我搞错了,刚开始看这个,还不是很清楚,实在抱歉!
    踩坑小分队:跟着步骤走,应该没事吧

本文标题:逆向工程之当/usr/bin安装不了class-dump怎么办

本文链接:https://www.haomeiwen.com/subject/hzkvyttx.html