编译dumpdecrypted遇到问题
kewong@Ke-MBP-16 dumpdecrypted-master % make
xcrun --sdk iphoneos --find gcc -Os -Wimplicit -isysroot xcrun --sdk iphoneos --show-sdk-path -Fxcrun --sdk iphoneos --show-sdk-path/System/Library/Frameworks -Fxcrun --sdk iphoneos --show-sdk-path/System/Library/PrivateFrameworks -arch armv7 -arch armv7s -arch arm64 -c -o dumpdecrypted.o dumpdecrypted.c
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
clang: warning: no such sysroot directory: '-F/System/Library/Frameworks' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '-F/System/Library/Frameworks' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '-F/System/Library/Frameworks' [-Wmissing-sysroot]
dumpdecrypted.c:27:10: fatal error: 'stdio.h' file not found

include <stdio.h>

     ^~~~~~~~~

1 error generated.
make: * [dumpdecrypted.o] Error 1
kewong@Ke-MBP-16 dumpdecrypted-master %

执行
kewong@Ke-MBP-16 dumpdecrypted-master % sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
指定编译xcode即可

kewong@Ke-MBP-16 dumpdecrypted-master % sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/

Password:
kewong@Ke-MBP-16 dumpdecrypted-master % make
xcrun --sdk iphoneos --find gcc -Os -Wimplicit -isysroot xcrun --sdk iphoneos --show-sdk-path -Fxcrun --sdk iphoneos --show-sdk-path/System/Library/Frameworks -Fxcrun --sdk iphoneos --show-sdk-path/System/Library/PrivateFrameworks -arch armv7 -arch armv7s -arch arm64 -c -o dumpdecrypted.o dumpdecrypted.c
xcrun --sdk iphoneos --find gcc -Os -Wimplicit -isysroot xcrun --sdk iphoneos --show-sdk-path -Fxcrun --sdk iphoneos --show-sdk-path/System/Library/Frameworks -Fxcrun --sdk iphoneos --show-sdk-path/System/Library/PrivateFrameworks -arch armv7 -arch armv7s -arch arm64 -dynamiclib -o dumpdecrypted.dylib dumpdecrypted.o
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk/System/Library/PrivateFrameworks'
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk/System/Library/PrivateFrameworks'
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk/System/Library/PrivateFrameworks'
kewong@Ke-MBP-16 dumpdecrypted-master %

macOS 11 Big Sur 使用class-dump时候根据指引需要将文件放到 /usr/bin ,使用cp命令时候提示 Operation not permitted
具体原因不深究了,解决办法如下

第一步,打开Terminal,输入mkdir ~/bin,在当前用户根目录下创建一个bin目录;

命令: mkdir ~/bin

第二步,把class-dump给拷贝到这个目录里,并赋予其可执行权限;

命令一: mv /.../class-dump ~/bin (/.../class-dump是指的class-dump的完整路径)

命令二: chmod +x ~/bin/class-dump

第三步,打开~/.bash_profile文件,配置环境变量

命令一: gedit ~/.bash_profile(如果你没gedit可以 brew install gedit ,几分钟就可以了)

第四步,在Terminal中执行source命令

命令:source ~/.bash_profile

完成以上步骤,在terminal中执行class-dump实验一下,应该就可以了。