iOSOpenDev的_MSHookMessageEx,已经替换libsubstrate.dylib


#1

iOSOpendev已经成功安装好了 新建了个简单的项目来进行测试报下面这个错误,我看了论坛上的帖子 都说是没替换libsubstrate.dylib,我已经替换了/opt/iOSOpenDev/lib/libsubstrate.dylib
从手机里复制出来改名字 并且替换的,

Ld /Users/Rick/Library/Developer/Xcode/DerivedData/DMWeChatPlugin-eefeiomqzgiwfuaiijyfzflbgptq/Build/Intermediates/DMWeChatPlugin.build/Release-iphoneos/DMWeChatPlugin.build/Objects-normal/arm64/DMWeChatPlugin.dylib normal arm64
    cd /Users/Rick/Documents/Demo/DMWeChatPlugin
    export IPHONEOS_DEPLOYMENT_TARGET=9.3
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/Rick/Library/Developer/Xcode/DerivedData/DMWeChatPlugin-eefeiomqzgiwfuaiijyfzflbgptq/Build/Products/Release-iphoneos -L/opt/iOSOpenDev/lib -F/Users/Rick/Library/Developer/Xcode/DerivedData/DMWeChatPlugin-eefeiomqzgiwfuaiijyfzflbgptq/Build/Products/Release-iphoneos -F/opt/iOSOpenDev/frameworks -F/Users/Rick/Documents/Demo/DMWeChatPlugin/DMWeChatPlugin -filelist /Users/Rick/Library/Developer/Xcode/DerivedData/DMWeChatPlugin-eefeiomqzgiwfuaiijyfzflbgptq/Build/Intermediates/DMWeChatPlugin.build/Release-iphoneos/DMWeChatPlugin.build/Objects-normal/arm64/DMWeChatPlugin.LinkFileList -install_name /Library/MobileSubstrate/DynamicLibraries/DMWeChatPlugin.dylib -miphoneos-version-min=9.3 -dead_strip -fembed-bitcode-marker -fobjc-link-runtime -framework UIKit -framework Foundation -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/Rick/Library/Developer/Xcode/DerivedData/DMWeChatPlugin-eefeiomqzgiwfuaiijyfzflbgptq/Build/Intermediates/DMWeChatPlugin.build/Release-iphoneos/DMWeChatPlugin.build/Objects-normal/arm64/DMWeChatPlugin_dependency_info.dat -o /Users/Rick/Library/Developer/Xcode/DerivedData/DMWeChatPlugin-eefeiomqzgiwfuaiijyfzflbgptq/Build/Intermediates/DMWeChatPlugin.build/Release-iphoneos/DMWeChatPlugin.build/Objects-normal/arm64/DMWeChatPlugin.dylib

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

tweak里面就这么多代码

#import <UIKit/UIKit.h>
%hook AppDelegate
- (BOOL)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2{
    BOOL supBool = %orig(arg1,arg2);
    NSLog(@"=======测试一下=====");
    return supBool;
}
%end

我测试了下 如果tweak里面只有下面一句

#import <substrate.h>

编译可以通过。。。
/opt/theos/lib/libsubstrate.dylib 也替换了
真不知道哪里还有问题了


#2

#import <substrate.h>
代码里加上这一句看看?


#3

试过了,加上#import <substrate.h>后 编译依旧不通过


#4

以前遇到过,发现是编译的目标忘记选为设备手机了


#5

建议还是强迫自己学下theos和Markfile语法吧

会发现好处多多


#6

你好,我遇到和你一样的问题,请问你搞好了吗?


#7

今天我新建了一个application modern的工程 调用hook的函数就报linker错误 感觉就是库没有被导入 但是不知道该从makefile文件里去如何修改 还请指点一下迷津