Comments (20)
用下面的生成 Xcode 工程
cmake .. -G Xcode \
-DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake \
-DIOS_PLATFORM=OS \
-DIOS_ARCH=arm64 \
-DENABLE_ARC=FALSE \
-DENABLE_BITCODE=OFF \
-DDEBUG=ON \
-DSHARED=ON \
-DPLATFORM=iOS \
-DARCH=armv8 \
-DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release
from dobby.
我没看到这个是啥操作,直接复制到命令行会提示不能识别cmake这个命令 😳
另外就是,我已经有一个Xcode工程了,如何直接引入你的框架呢?我用monkeyDev去生成这个工程的,如果直接再来一个工程,不知道能不能兼容。。
from dobby.
打错,没看懂这是要怎么操作?
from dobby.
用过 cmake 么?
from dobby.
@jmpews 安装好cmake了,也编译通过了,怎么集成到我的已有的工程呢?
from dobby.
hmm 两个 Xcode 不会集成嘛? :(
from dobby.
我用第一种方式的,编译完了生成了一些文件,不知道怎么用到Xcode工程里
from dobby.
emmmmmm... 建议你先看下 cmake 怎么用.
from dobby.
生成了Xcode工程,尝试做最后一步:make -j4
终端里报错了:
/Users/hufeng/Documents/backup/HookZz/./srcxx/AssemblyClosureTrampoline.h/Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/platform/platform.h::44::1010:: fatal errorfatal error: :
'iostream' 'cstdarg'file filenot notfound found
#include <iostream>#include <cstdarg>
^~~~~~~~~~ ^~~~~~~~~
1 warning generated.
In file included from /Users/hufeng/Documents/backup/HookZz/srcxx/vm_core/arch/cpu.cc:2:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/arch/cpu.h:4:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/globals.h:4:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/macros.h:7:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/logging.h:4:
/Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/platform/platform.h:4:10: fatal error:
'cstdarg' file not found
#include <cstdarg>
^~~~~~~~~
[ 20%] Building CXX object CMakeFiles/hookzz.dir/srcxx/vm_core/objects/code.cc.o
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/hookzz.dir/srcxx/vm_core/logging.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the
command line to use the libc++ standard library instead
[-Wstdlibcxx-not-found]
1 warning and 1 error generated.
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/hookzz.dir/srcxx/vm_core/arch/cpu.cc.o] Error 1
make[2]: *** [CMakeFiles/hookzz.dir/srcxx/intercept_routing_handler.cc.o] Error 1
In file included from /Users/hufeng/Documents/backup/HookZz/srcxx/vm_core/objects/code.cc:1:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/objects/code.h:4:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/globals.h:4:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/macros.h:7:
In file included from /Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/logging.h:4:
/Users/hufeng/Documents/backup/HookZz/./srcxx/vm_core/platform/platform.h:4:10: fatal error:
'cstdarg' file not found
#include <cstdarg>
^~~~~~~~~
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/hookzz.dir/srcxx/vm_core/objects/code.cc.o] Error 1
make[1]: *** [CMakeFiles/hookzz.dir/all] Error 2
make: *** [all] Error 2
大神指教一下?
from dobby.
cstdarg这个文件,在Xcode的工程里,是可以找到的。。
from dobby.
我用这个仓库提供的静态库直接拖到工程里可以运行了 https://github.com/yuzhouheike/HookZz-Learn
虽然自己编译失败了,还是感谢作者~
from dobby.
@kobe1941 @jmpews hookobjc_msgSend
方法的时候,一些系统调用的方法并不会获取到,比如viewDidLoad
是故意屏蔽了吗
from dobby.
@chenzhengxu 你是怎么hook的,截图放一下?
我用旧版本可以hook到所有的函数,不过太耗性能了就去掉了
from dobby.
+ (void)load {
[self hook_objc_msgSend];
}
+ (void)hook_objc_msgSend {
ZzHookGOT(NULL,"objc_msgSend", NULL, NULL, objc_msgSend_pre_call, objc_msgSend_post_call);
}
void objc_msgSend_pre_call(RegState *rs, ThreadStackPublic *ts, CallStackPublic *cs, const HookEntryInfo *info) {
char *selector = (char *)rs->ZREG(1);
id tmpObject = (id)rs->ZREG(0);
Class tmpClass = object_getClass(tmpObject);
if (!tmpClass)
return;
const char *className = class_getName(tmpClass);
long log_time = log_timeInterval();
stack.push({className, selector, log_time, 0});
}
void objc_msgSend_post_call(RegState *rs, ThreadStackPublic *ts, CallStackPublic *cs, const HookEntryInfo *info) {
long log_time = log_timeInterval();
MethodItem *item = &stack.top();
item->post_time = log_time;
printf("end:[thread:|%ld] [%s %s] startTime:[%ld] endTime:[%ld]\n", ts->thread_id, item->className, item->selector, item->pre_time, item->post_time);
stack.pop();
}
与https://github.com/yuzhouheike/HookZz-Learn
的方式一样 @kobe1941
from dobby.
我可以hook到所有的函数的,你看看是不是被过滤掉了
from dobby.
我这边没有过滤操作,https://github.com/everettjf/AppleTrace
这个库也用了hookzz,也不会打印所有函数,你有哪个工程可以hook所有函数的吗,有没有地址给看下
from dobby.
我用旧版本的可以hook,不过用了新版本后就不行了,hook失败,作者也没告诉我怎么用o(╯□╰)o
from dobby.
from dobby.
@jmpews 请问下,hookobjc_msg_send
的时候是如何屏蔽一大堆系统方法的
from dobby.
from dobby.
Related Issues (20)
- Where is the documentation?
- 将此项目用于编写 Magisk Module 时编译不通过 HOT 2
- multiple rules generate dobby/dobby.lib
- RISC-V support
- release file `arm64/libdobby.so` has an incorrect arch caused by mistake in cmake file
- 遍历查询符号时, 非so后缀结尾ELF文件崩溃
- built-in plugin ImportTableReplace cannot be enabled with compile parameter '-DPlugin.ImportTableReplace=ON' HOT 1
- report a problem with the instruction fix
- hook x86_64, crash
- hook一个get_text函数,arm32正常,arm64 奔溃
- `DobbySymbolResolver` cannot find function address
- A compile error on Windows (building for Android) HOT 1
- iOS 16.5 hook unvalid
- Is `DOBBY_GENERATE_SHARED` still recognized?
- fatal error: 'core/arch/Cpu.h' file not found HOT 3
- DOBBY_GENERATE_SHARED配置后不起作用 HOT 2
- iOS error
- How to find out which app is using Dobby?
- closure_bridge_template LR 寄存器保存错误
- 最新master分支hook memcpy crash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dobby.