Libcapstone.a 引用问题

看了张总的那个关于MobileGestalt Hook的帖子,自己也试了下,从Github上下载capstone并按照如下方法打包了一个libcapstone.a的静态库

$ CAPSTONE_ARCHS=“arm aarch64 x86” ./make.sh
$ ./make.sh
$ sudo ./make.sh install

然后在make里添加了
MobileGestaltHook_LDFLAGS = -lz -L. -v -force_load ./libcapstone.a

编译后发现出现问题

“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld” -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -dylib -arch armv7 -dylib_install_name /Library/MobileSubstrate/DynamicLibraries/MobileGestaltHook.dylib -force_load ./libcapstone.a -iphoneos_version_min 6.0.0 -multiply_defined suppress -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -ObjC -o /Users/yecongcong/Documents/mobilegestalthook/.theos/obj/debug/armv7/MobileGestaltHook.dylib -L/opt/theos/lib -L/opt/theos/vendor/lib -L. -lobjc -framework Foundation -framework CoreFoundation -framework CydiaSubstrate -segalign 4000 -lz /Users/yecongcong/Documents/mobilegestalthook/.theos/obj/debug/armv7/Tweak.xm.aeaf5e81.o -lstdc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/8.1.0/lib/darwin/libclang_rt.ios.a -F/opt/theos/vendor/lib
ld: warning: ignoring file ./libcapstone.a, missing required architecture armv7 in file ./libcapstone.a (2 slices)
Undefined symbols for architecture armv7:
“_cs_close”, referenced from:
_logosLocalCtor_344ae32b(int, char**, char**) in Tweak.xm.aeaf5e81.o
“_cs_disasm”, referenced from:
_logosLocalCtor_344ae32b(int, char**, char**) in Tweak.xm.aeaf5e81.o
“_cs_errno”, referenced from:
_logosLocalCtor_344ae32b(int, char**, char**) in Tweak.xm.aeaf5e81.o
“_cs_free”, referenced from:
_logosLocalCtor_344ae32b(int, char**, char**) in Tweak.xm.aeaf5e81.o
“_cs_open”, referenced from:
_logosLocalCtor_344ae32b(int, char**, char**) in Tweak.xm.aeaf5e81.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

用lipo -info 查看libcapstone.a

Architectures in the fat file: libcapstone.a are: i386 x86_64

是因为没有支持 armv7吗?还是啥?

新手上路,论坛老司机们多教教呗。:grinning_face_with_smiling_eyes:

……capstone不是你这么编译的

。。。啊:joy:,张总,那是应该怎么编译打包的呢,求解

自己看文档

额。。好吧,文档在这里看吗- - Documentation – Capstone – The Ultimate Disassembler

总感觉ios静态库不应该用xocde打包的吗。。。

repo里有指南。。。。。。。。

自己在xcode上创建了.a静态库工程并把capstone里的文件拖进去成功打包libcapstone.a(不知道这样子有没有问题)
lipo -info 查看为 Architectures in the fat file: libcapstone.a are: armv7 arm64

把静态库拖到tweak编译成功并打开testapp 测试
出现了下面的问题

Jun 28 19:23:04 Loto04 TestMG[51516] : MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/MGHooker.dylib
Jun 28 19:23:04 Loto04 TestMG[51516] : MG: 0x181c40294
Jun 28 19:23:04 Loto04 TestMG[51516] : MGHooker: CSE Failed

是我打包的libcapstone.a出问题了还是啥啊。:sob:

自己调啊我这边Air2 9.3.3是没问题的

我猜测是打的cse包有问题,看看错误代码是啥

谢谢张总耐心回答,现在可以了,是cse打包的问题,3Q :blush:

请问下OS X 10.12怎么打包cse呀,非常感谢了.

clone下来COMPILE.md里有