frida-gum:https://github.com/frida/frida-gum
frida-gum-cmake是基于frida-gum的CMake构建工具。
目前仅对以下系统版本做了适配:
- Android
- Windows
- Linux
- macOS
- iOS
FRIDA-GUM-CMAKE_BUILD_GUMPP
:是否编译gumpp,默认为OFF
。FRIDA-GUM-CMAKE_BUILD_GUM
:是否编译gum,默认为ON
。FRIDA-GUM-CMAKE_BUILD_GUMJS
:是否编译gumjs,默认为OFF
。FRIDA-GUM-CMAKE_BUILD_TEST
:是否编译测试,默认为OFF
。
在父级CMakeLists.txt中添加:
add_directory("path_to/frida-gum-cmake")
target_link_libraries(your_target frida-gum) # frida-gumpp, frida-gum, frida-gumjs
代码例子请看:src/main.cc
输出:
HookListener::on_enter TestHook
listener num_calls: 1
arg00: "Hello, world!"
TestHook called with: "Hello, world! from hook"
HookListener::on_leave TestHook
returnValue: false
TestHook result: true