The latest installation method of class-dump

When the Mac is upgraded to OSX 10.11, when configuring class-dump, you will find that the class-dump storage directory recommended in the reverse book is /usr/bin .

  • The reason is that a new feature of OSX10.11, Rootless, also called System Integrity Protection (SIP), is similar to SELinux, which restricts the privileges of root users.
    In fact, this feature can be turned off in RecoveryMode, so that you can read and write /usr/bin directly, but it is not recommended.
    (Close method: Press and hold option when booting up to display the interface for selecting the disk, press command + R to enter RecoveryMode, select the utility terminal, enter csrutil disable and press Enter to get it done)

Looking for information on the Internet, the method I currently use is to change the environment variables of class-dump to use.
class-dump download address: http://stevenygard.com/projects/class-dump/

  1. First open Terminal, enter mkdir ~/bin , and create a bin directory in the current user root directory.
  2. Open the downloaded dmg and copy the class-dump in the file to the created bin directory. Give it executable permissions:
    chmod +x ~/bin/class-dump
  3. Open the bash_profile file to configure environment variables:
    vim ~/.bash_profile
    **Press the i key to enter the editing state, add a line at the bottom**
    export PATH=$HOME/bin/:$PATH
    press the esc key, then press shift+: Enter wq to save and exit editing
  4. Execute source ~/.bash_profile in Terminal
  5. Test if the change was successful

The test results are:

MelodydeMBP:~ melody$ 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)
MelodydeMBP:~ melody$

At this point, the installation of class-dump is basically completed ^ ^

Thank you for reading, and welcome to correct mistakes and exchange.

Reference link:
http://bbs.iosre.com/t/10-11-usr-bin-class-dump/1936/8
http://blog.csdn.net/majiakun1/article/details/52064435

 



Author: San Xinliangyi_zhong
Link: https://www.jianshu.com/p/025fa775f3a6
Source: Jianshu
The copyright belongs to the author. For commercial reprints, please contact the author for authorization, and for non-commercial reprints, please indicate the source.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324966910&siteId=291194637