You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_library( # Sets the name of the library.
hooklearn
# Sets the library as a shared library.
SHARED
${DOBBY_DIR}/examples/socket_example.cc
# Provides a relative path to your source file(s).
native-lib.cpp
log.h
my_tool.h
)
Searches for a specified prebuilt library and stores the path as a
variable. Because CMake includes system libraries in the search path by
default, you only need to specify the name of the public NDK library
you want to add. CMake verifies that the library exists before
completing its build.
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
Specifies libraries CMake should link to your target library. You
can link multiple libraries, such as libraries you define in this
build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library.
hooklearn
dobby
# Links the target library to the log library
# included in the NDK.
${log-lib})
但在点击运行android项目时却会报错,报错信息如下:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:buildCMakeDebug'.
Build command failed.
Error while executing process E:\Work\Software\Android\AndroidSDK\Android\Sdk\cmake\3.31.0\bin\ninja.exe with arguments {-C E:\Work\Software\Android\Projects\HookLearn\app.cxx\Debug\1x3x6958\arm64-v8a dobby hooklearn}
ninja: Entering directory `E:\Work\Software\Android\Projects\HookLearn\app.cxx\Debug\1x3x6958\arm64-v8a'
[1/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/core/assembler/assembler-x64.cc.o
[2/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/core/assembler/assembler-arm.cc.o
[3/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/core/assembler/assembler-ia32.cc.o
[4/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InstructionRelocation/arm/InstructionRelocationARM.cc.o
[5/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/core/codegen/codegen-ia32.cc.o
[6/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/core/codegen/codegen-arm.cc.o
[7/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InstructionRelocation/x86/InstructionRelocationX86.cc.o
[8/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc.o
[9/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InstructionRelocation/arm64/InstructionRelocationARM64.cc.o
[10/44] Building C object dobby/CMakeFiles/dobby.dir/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.c.o
[11/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InterceptRouting/InstrumentRouting/instrument_routing_handler.cpp.o
[12/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InstructionRelocation/x64/InstructionRelocationX64.cc.o
[13/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/Trampoline/trampoline_arm64.cc.o
[14/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/Trampoline/trampoline_x86.cc.o
[15/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/Trampoline/trampoline_arm.cc.o
[16/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm/closure_bridge_arm.cc.o
[17/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm/helper_arm.cc.o
[18/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/Trampoline/trampoline_x64.cc.o
[19/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm/ClosureTrampolineARM.cc.o
[20/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/ClosureTrampolineARM64.cc.o
[21/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_bridge_arm64.cc.o
[22/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/helper_arm64.cc.o
[23/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x86/helper_x86.cc.o
[24/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x86/closure_bridge_x86.cc.o
[25/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x86/ClosureTrampolineX86.cc.o
[26/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x64/helper_x64.cc.o
[27/44] Building ASM object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_trampoline_arm64.asm.o
[28/44] Building ASM object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x64/closure_bridge_x64.asm.o
[29/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x64/closure_bridge_x64.cc.o
[30/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x64/ClosureTrampolineX64.cc.o
[31/44] Building ASM object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/x64/closure_trampoline_x64.asm.o
[32/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/dobby.cpp.o
[33/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/ExecMemory/code-patch-tool-posix.cc.o
[34/44] Building C object dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/ExecMemory/clear-cache-tool-all.c.o
[35/44] Building CXX object dobby/CMakeFiles/dobby.dir/external/logging/logging.cc.o
[36/44] Building ASM object dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_bridge_arm64.asm.o
FAILED: dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_bridge_arm64.asm.o
E:\Work\Software\Android\AndroidSDK\Android\Sdk\ndk\28.0.12674087\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe -target aarch64-none-linux-android24 --sysroot=E:/Work/Software/Android/AndroidSDK/Android/Sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DBUILD_WITH_TRAMPOLINE_ASM -DCOMPILE_DEFINITIONS -DDOBBY_DEBUG -DBUILD_WITH_TRAMPOLINE_ASM -D__DOBBY_BUILD_VERSION__="Dobby-20241206" -Ddobby_EXPORTS -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/. -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./include -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/dobby -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external/logging -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./builtin-plugin -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -x assembler-with-cpp -fno-limit-debug-info -fPIC -MD -MT dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_bridge_arm64.asm.o -MF dobby\CMakeFiles\dobby.dir\source\TrampolineBridge\ClosureTrampolineBridge\arm64\closure_bridge_arm64.asm.o.d -o dobby/CMakeFiles/dobby.dir/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_bridge_arm64.asm.o -c E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/TrampolineBridge/ClosureTrampolineBridge/arm64/closure_bridge_arm64.asm
C:/Users/0/AppData/Local/Temp/closure_bridge_arm64-43569c.s:60:1: error: invalid symbol kind for ADRP relocation
adrp x17, common_closure_bridge_handler@PAGE
^
C:/Users/0/AppData/Local/Temp/closure_bridge_arm64-43569c.s:61:1: error: invalid fixup for add (uimm12) instruction
add x17, x17, common_closure_bridge_handler@PAGEOFF
^
[37/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/UnifiedInterface/platform-posix.cc.o
FAILED: dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/UnifiedInterface/platform-posix.cc.o
E:\Work\Software\Android\AndroidSDK\Android\Sdk\ndk\28.0.12674087\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android24 --sysroot=E:/Work/Software/Android/AndroidSDK/Android/Sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DBUILD_WITH_TRAMPOLINE_ASM -DCOMPILE_DEFINITIONS -DDOBBY_DEBUG -DBUILD_WITH_TRAMPOLINE_ASM -D__DOBBY_BUILD_VERSION__="Dobby-20241206" -Ddobby_EXPORTS -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/. -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./include -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/dobby -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external/logging -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./builtin-plugin -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -fomit-frame-pointer -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -std=gnu++17 -fPIC -MD -MT dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/UnifiedInterface/platform-posix.cc.o -MF dobby\CMakeFiles\dobby.dir\source\Backend\UserMode\UnifiedInterface\platform-posix.cc.o.d -o dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/UnifiedInterface/platform-posix.cc.o -c E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/UnifiedInterface/platform-posix.cc
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/UnifiedInterface/platform-posix.cc:27:
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source/PlatformUnifiedInterface/platform.h:3:
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source/dobby/common.h:12:
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:39:44: error: use of undeclared identifier 'OSMemory'
39 | auto page = (void *)ALIGN_FLOOR(address, OSMemory::PageSize());
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:40:8: error: use of undeclared identifier 'OSMemory'
40 | if (!OSMemory::SetPermission(page, OSMemory::PageSize(), kReadExecute)) {
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:40:38: error: use of undeclared identifier 'OSMemory'
40 | if (!OSMemory::SetPermission(page, OSMemory::PageSize(), kReadExecute)) {
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:40:60: error: use of undeclared identifier 'kReadExecute'
40 | if (!OSMemory::SetPermission(page, OSMemory::PageSize(), kReadExecute)) {
^
4 errors generated.
[38/44] Building CXX object dobby/CMakeFiles/dobby.dir/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc.o
FAILED: dobby/CMakeFiles/dobby.dir/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc.o
E:\Work\Software\Android\AndroidSDK\Android\Sdk\ndk\28.0.12674087\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android24 --sysroot=E:/Work/Software/Android/AndroidSDK/Android/Sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DBUILD_WITH_TRAMPOLINE_ASM -DCOMPILE_DEFINITIONS -DDOBBY_DEBUG -DBUILD_WITH_TRAMPOLINE_ASM -D__DOBBY_BUILD_VERSION__="Dobby-20241206" -Ddobby_EXPORTS -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/. -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./include -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/dobby -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external/logging -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./builtin-plugin -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -fomit-frame-pointer -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -std=gnu++17 -fPIC -MD -MT dobby/CMakeFiles/dobby.dir/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc.o -MF dobby\CMakeFiles\dobby.dir\builtin-plugin\SymbolResolver\elf\dobby_symbol_resolver.cc.o.d -o dobby/CMakeFiles/dobby.dir/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc.o -c E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc:173:16: error: no member named 'load_address' in 'RuntimeModule'
173 | if (module.load_address) {
~~~~~~ ^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc:185:59: error: no member named 'load_address' in 'RuntimeModule'
185 | result = (void *)((addr_t)result + (addr_t)module.load_address - ((addr_t)file_mem - (addr_t)ctx.load_bias));
~~~~~~ ^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc:193:18: error: no member named 'load_address' in 'RuntimeModule'
193 | if (module.load_address) {
~~~~~~ ^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver/elf/dobby_symbol_resolver.cc:205:61: error: no member named 'load_address' in 'RuntimeModule'
205 | result = (void *)((addr_t)result + (addr_t)module.load_address - ((addr_t)file_mem - (addr_t)ctx.load_bias));
~~~~~~ ^
4 errors generated.
[39/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/InterceptRouting/NearBranchTrampoline/near_trampoline_arm64.cc.o
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/InterceptRouting/NearBranchTrampoline/near_trampoline_arm64.cc:15:9: warning: 'assert' macro redefined [-Wmacro-redefined]
15 | #define assert(x)
^
E:/Work/Software/Android/AndroidSDK/Android/Sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/assert.h:55:11: note: previous definition is here
55 | # define assert(e) ((e) ? __assert_no_op : assert2(FILE, LINE, PRETTY_FUNCTION, #e))
^
1 warning generated.
[40/44] Building CXX object CMakeFiles/hooklearn.dir/native-lib.cpp.o
[41/44] Building CXX object dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc.o
FAILED: dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc.o
E:\Work\Software\Android\AndroidSDK\Android\Sdk\ndk\28.0.12674087\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android24 --sysroot=E:/Work/Software/Android/AndroidSDK/Android/Sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DBUILD_WITH_TRAMPOLINE_ASM -DCOMPILE_DEFINITIONS -DDOBBY_DEBUG -DBUILD_WITH_TRAMPOLINE_ASM -D__DOBBY_BUILD_VERSION="Dobby-20241206" -Ddobby_EXPORTS -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/. -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./include -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/dobby -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./external/logging -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./builtin-plugin -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/builtin-plugin/SymbolResolver -IE:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -fomit-frame-pointer -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -std=gnu++17 -fPIC -MD -MT dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc.o -MF dobby\CMakeFiles\dobby.dir\source\Backend\UserMode\PlatformUtil\Linux\ProcessRuntime.cc.o.d -o dobby/CMakeFiles/dobby.dir/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc.o -c E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:1:
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source/PlatformUtil/ProcessRuntime.h:3:
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source/MemoryAllocator/MemoryAllocator.h:4:
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source/PlatformUnifiedInterface/platform.h:3:
In file included from E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./source/dobby/common.h:12:
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:39:44: error: use of undeclared identifier 'OSMemory'
39 | auto page = (void *)ALIGN_FLOOR(address, OSMemory::PageSize());
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:40:8: error: use of undeclared identifier 'OSMemory'
40 | if (!OSMemory::SetPermission(page, OSMemory::PageSize(), kReadExecute)) {
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:40:38: error: use of undeclared identifier 'OSMemory'
40 | if (!OSMemory::SetPermission(page, OSMemory::PageSize(), kReadExecute)) {
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/./common/os_arch_features.h:40:60: error: use of undeclared identifier 'kReadExecute'
40 | if (!OSMemory::SetPermission(page, OSMemory::PageSize(), kReadExecute)) {
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:14:9: warning: 'LINE_MAX' macro redefined [-Wmacro-redefined]
14 | #define LINE_MAX 2048
^
E:/Work/Software/Android/AndroidSDK/Android/Sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/limits.h:130:9: note: previous definition is here
130 | #define LINE_MAX _POSIX2_LINE_MAX
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:17:13: error: reference to non-static member function must be called; did you mean to call it with no arguments?
17 | return (a.start < b.start);
~~^~~~~
()
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:17:23: error: reference to non-static member function must be called; did you mean to call it with no arguments?
17 | return (a.start < b.start);
~~^~~~~
()
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:166:12: error: no member named 'load_address' in 'RuntimeModule'
166 | module.load_address = (void *)region_start;
~~~~~~ ^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:194:16: error: no member named 'load_address' in 'RuntimeModule'
194 | module.load_address = (void *)info->dlpi_addr;
~~~~~~ ^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:198:20: error: no member named 'load_address' in 'RuntimeModule'
198 | module.load_address = (void *)((addr_t)module.load_address + load_bias);
~~~~~~ ^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntime.cc:198:59: error: no member named 'load_address' in 'RuntimeModule'
198 | module.load_address = (void *)((addr_t)module.load_address + load_bias);
~~~~~~ ^
1 warning and 10 errors generated.
[42/44] Building CXX object CMakeFiles/hooklearn.dir/Dobby/examples/socket_example.cc.o
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/examples/socket_example.cc:143:17: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
143 | char *hello = "Hello from server";
^
E:/Work/Software/Android/Projects/HookLearn/app/src/main/cpp/Dobby/examples/socket_example.cc:183:17: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
183 | char *hello = "Hello from client";
^
2 warnings generated.
ninja: build stopped: subcommand failed.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
version
dobby版本 当前最新版本
ndk 28.0.12674087
cmake 3.31.0
abiFilters arm64-v8a
minSdkVersion 25
targetSdkVersion 30
我的项目路径如下图:
/
我的主CMakeList配置如下:
For more information about using CMake with Android Studio, read the
documentation: https://d.android.com/studio/projects/add-native-code.html
Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.5)
Declares and names the project.
project("hooklearn")
set(DOBBY_DIR Dobby)
macro(SET_OPTION option value)
set(${option} ${value} CACHE INTERNAL "" FORCE)
endmacro()
SET_OPTION(DOBBY_DEBUG OFF)
SET_OPTION(DOBBY_GENERATE_SHARED OFF)
add_subdirectory(${DOBBY_DIR} dobby)
get_property(DOBBY_INCLUDE_DIRECTORIES
TARGET dobby
PROPERTY INCLUDE_DIRECTORIES)
include_directories(
.
${DOBBY_INCLUDE_DIRECTORIES}
$<TARGET_PROPERTY:dobby,INCLUDE_DIRECTORIES>
)
add_library( # Sets the name of the library.
hooklearn
Searches for a specified prebuilt library and stores the path as a
variable. Because CMake includes system libraries in the search path by
default, you only need to specify the name of the public NDK library
you want to add. CMake verifies that the library exists before
completing its build.
find_library( # Sets the name of the path variable.
log-lib
Specifies libraries CMake should link to your target library. You
can link multiple libraries, such as libraries you define in this
build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library.
hooklearn
但在点击运行android项目时却会报错,报错信息如下:
FAILURE: Build failed with an exception.
Execution failed for task ':app:buildCMakeDebug'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 10s
45 actionable tasks: 2 executed, 43 up-to-date
The text was updated successfully, but these errors were encountered: