Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode12.5 安装 libstdc++.dylib 后, fishhook.c 的106行报“Thread 1: EXC_BAD_ACCESS (code=2, address=0x1f5a926c0)” #283

Closed
KiddoLin opened this issue May 16, 2021 · 3 comments

Comments

@KiddoLin
Copy link

【环境】Mac 11.3.1, Xcode 12.5

【背景】APP在iOS 13.* 是正常的,在iOS 14.5出现闪退。为了调试iOS14,把Mac 10.15升级到了11.3.1,进而把Xcode 11升级到12.5。
刚开始报 “file not found: /usr/lib/libstdc++.dyli” ,按照 #279 中的办法安装了libstdc++。

【问题】安装 libstdc++.dylib 后,一直报“Undefined symbol: _rebind_symbols”。

【报错内容】
Ld /Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Intermediates.noindex/hall.build/Debug-iphoneos/hallDylib.build/Objects-normal/armv7/Binary/libhallDylib.dylib normal armv7 (in target 'hallDylib' from project 'hall')
cd /Users/kid/data/hall
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target armv7-apple-ios8.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -L/Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Products/Debug-iphoneos -L/opt/MonkeyDev/Frameworks -L/opt/theos/vendor/lib -L/opt/theos/vendor/lib/Alderis.framework -L/opt/theos/vendor/lib/Cephei.framework -L/opt/theos/vendor/lib/CepheiPrefs.framework -L/opt/theos/vendor/lib/CepheiUI.framework -L/opt/theos/vendor/lib/Cycript.framework -L/opt/theos/vendor/lib/CydiaSubstrate.framework -L/opt/theos/vendor/lib/Opener.framework -L/opt/theos/vendor/lib/TechSupport.framework -L/opt/theos/vendor/lib/Alderis.framework/Headers -L/opt/theos/vendor/lib/Alderis.framework/Modules -L/opt/theos/vendor/lib/Cephei.framework/Headers -L/opt/theos/vendor/lib/CepheiPrefs.framework/Headers -L/opt/theos/vendor/lib/CepheiUI.framework/Headers -L/opt/theos/vendor/lib/Cycript.framework/Headers -L/opt/theos/vendor/lib/CydiaSubstrate.framework/Headers -L/opt/theos/vendor/lib/Opener.framework/Headers -L/opt/theos/vendor/lib/TechSupport.framework/Headers -L/opt/theos/vendor/lib/Alderis.framework/Modules/Alderis.swiftmodule -F/Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Products/Debug-iphoneos -F/opt/MonkeyDev/Frameworks -F/opt/MonkeyDev/Frameworks/RevealServer.framework -F/opt/MonkeyDev/Frameworks/RevealServer.framework/Headers -F/opt/MonkeyDev/Frameworks/RevealServer.framework/Modules -F/opt/MonkeyDev/Frameworks/RevealServer.framework/Scripts -F/opt/MonkeyDev/Frameworks/RevealServer.framework/_CodeSignature -F/opt/MonkeyDev/Librarys -F/opt/theos/vendor/lib -filelist /Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Intermediates.noindex/hall.build/Debug-iphoneos/hallDylib.build/Objects-normal/armv7/hallDylib.LinkFileList -install_name @executable_path/Frameworks/libhallDylib.dylib/libhallDylib.dylib -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Intermediates.noindex/hall.build/Debug-iphoneos/hallDylib.build/Objects-normal/armv7/hallDylib_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_library /usr/lib/libc++.dylib -weak_library /usr/lib/libstdc++.dylib -weak_library /opt/MonkeyDev/Frameworks/libsubstrate.dylib -lcycript -framework RevealServer -framework JavaScriptCore -framework UIKit -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Intermediates.noindex/hall.build/Debug-iphoneos/hallDylib.build/Objects-normal/armv7/hallDylib_dependency_info.dat -o /Users/kid/Library/Developer/Xcode/DerivedData/hall-aivasnrkxxvnaraxpywfikmgypef/Build/Intermediates.noindex/hall.build/Debug-iphoneos/hallDylib.build/Objects-normal/armv7/Binary/libhallDylib.dylib

Undefined symbols for architecture armv7:
"_rebind_symbols", referenced from:
_entry in AntiAntiDebug.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Undefined symbol: _rebind_symbols

【尝试解决】
参照 #282 把Xcode12卸载,重装,仍无法解决。但本地没有 Specifications 目录

请问这该怎么解决呢?感谢大佬解答。

@KiddoLin
Copy link
Author

【后续】 我把自己的hook代码全部去掉(在AntiAntiDebug.m中),发现可以 build succeeded 了,但是运行时 fishhook.c 的 106 行 indirect_symbol_bindings[i] = cur->rebindings[j].replacement; 报 “Thread 1: EXC_BAD_ACCESS (code=2, address=0x1f5a926c0)”

备注:Xcode的log可以输出
🎉!!!congratulations!!!🎉
👍----------------insert dylib success----------------👍
2021-05-16 19:36:36.036667+0800 hall[6261:1984580] [AntiAntiDebug Init]
(lldb)

@KiddoLin KiddoLin changed the title Xcode12.5 安装 libstdc++.dylib 后,一直报“Undefined symbol: _rebind_symbols” Xcode12.5 安装 libstdc++.dylib 后, fishhook.c 的106行报“Thread 1: EXC_BAD_ACCESS (code=2, address=0x1f5a926c0)” May 16, 2021
@KiddoLin
Copy link
Author

【已解决】重新创建 project ,并把 AntiAntiDebug.m 中 _rebind_symbols 注释掉。

@lsqgithub001
Copy link

我照着你的重新创建project,注释掉rebind——symbols 还是出一样的错误,知道怎么解决吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants