├── .gitignore ├── .idea ├── .gitignore ├── compiler.xml ├── deploymentTargetSelector.xml ├── git_toolbox_blame.xml ├── git_toolbox_prj.xml ├── gradle.xml ├── migrations.xml ├── misc.xml └── vcs.xml ├── README.md ├── app ├── .cxx │ ├── Debug │ │ └── 4lq6t6k1 │ │ │ ├── arm64-v8a │ │ │ ├── .cmake │ │ │ │ └── api │ │ │ │ │ └── v1 │ │ │ │ │ ├── query │ │ │ │ │ └── client-agp │ │ │ │ │ │ ├── cache-v2 │ │ │ │ │ │ ├── cmakeFiles-v1 │ │ │ │ │ │ └── codemodel-v2 │ │ │ │ │ └── reply │ │ │ │ │ ├── cache-v2-f7fd074347f5ccc6f5a9.json │ │ │ │ │ ├── cmakeFiles-v1-7af23b9ff40281ed5838.json │ │ │ │ │ ├── codemodel-v2-fcee9f64cbcefffc26ec.json │ │ │ │ │ ├── directory-.-Debug-f5ebdc15457944623624.json │ │ │ │ │ ├── index-2024-11-07T10-39-57-0445.json │ │ │ │ │ ├── target-imgui-Debug-fe01b39361118dc48f8b.json │ │ │ │ │ └── target-nhook-Debug-2308b745bd60863ce0c9.json │ │ │ ├── .ninja_deps │ │ │ ├── .ninja_log │ │ │ ├── CMakeCache.txt │ │ │ ├── CMakeFiles │ │ │ │ ├── 3.22.1-g37088a8 │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ │ ├── CompilerIdC │ │ │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ │ │ └── CMakeCCompilerId.o │ │ │ │ │ └── CompilerIdCXX │ │ │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ │ │ └── CMakeCXXCompilerId.o │ │ │ │ ├── CMakeOutput.log │ │ │ │ ├── TargetDirectories.txt │ │ │ │ ├── cmake.check_cache │ │ │ │ ├── imgui.dir │ │ │ │ │ └── imgui │ │ │ │ │ │ ├── backends │ │ │ │ │ │ ├── imgui_impl_android.cpp.o │ │ │ │ │ │ └── imgui_impl_opengl3.cpp.o │ │ │ │ │ │ ├── imgui.cpp.o │ │ │ │ │ │ ├── imgui_draw.cpp.o │ │ │ │ │ │ ├── imgui_tables.cpp.o │ │ │ │ │ │ └── imgui_widgets.cpp.o │ │ │ │ ├── nhook.dir │ │ │ │ │ ├── demo │ │ │ │ │ │ ├── il2cpp_dumper.cpp.o │ │ │ │ │ │ ├── modmenu.cpp.o │ │ │ │ │ │ ├── modmenu_native.cpp.o │ │ │ │ │ │ ├── qbdihook.cpp.o │ │ │ │ │ │ └── ytbssl.cpp.o │ │ │ │ │ ├── linker_hook.cpp.o │ │ │ │ │ ├── nhook.cpp.o │ │ │ │ │ ├── utils.cpp.o │ │ │ │ │ └── vm.cpp.o │ │ │ │ └── rules.ninja │ │ │ ├── additional_project_files.txt │ │ │ ├── android_gradle_build.json │ │ │ ├── android_gradle_build_mini.json │ │ │ ├── build.ninja │ │ │ ├── build_file_index.txt │ │ │ ├── cmake_install.cmake │ │ │ ├── compile_commands.json │ │ │ ├── compile_commands.json.bin │ │ │ ├── configure_fingerprint.bin │ │ │ ├── libimgui.a │ │ │ ├── metadata_generation_command.txt │ │ │ ├── prefab_config.json │ │ │ └── symbol_folder_index.txt │ │ │ └── hash_key.txt │ └── tools │ │ └── debug │ │ └── arm64-v8a │ │ └── compile_commands.json ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── xposed_init │ ├── cpp │ ├── CMakeLists.txt │ ├── QBDI.h │ ├── QBDI │ │ ├── Bitmask.h │ │ ├── Callback.h │ │ ├── Config.h │ │ ├── Errors.h │ │ ├── InstAnalysis.h │ │ ├── Logs.h │ │ ├── Memory.h │ │ ├── Memory.hpp │ │ ├── Options.h │ │ ├── Platform.h │ │ ├── Range.h │ │ ├── State.h │ │ ├── VM.h │ │ ├── VM_C.h │ │ └── Version.h │ ├── demo │ │ ├── il2cpp-class.h │ │ ├── il2cpp-tabledefs.h │ │ ├── il2cpp_dumper.cpp │ │ ├── il2cpp_dumper.h │ │ ├── md5.cpp │ │ ├── md5.h │ │ ├── modmenu.cpp │ │ ├── modmenu_native.cpp │ │ ├── modmenu_native.h │ │ ├── qbdihook.cpp │ │ ├── qbdihook.h │ │ ├── sha1.hpp │ │ ├── ytbssl.cpp │ │ └── ytbssl.h │ ├── dobby │ │ └── dobby.h │ ├── elfio │ │ ├── elf_types.hpp │ │ ├── elfio.hpp │ │ ├── elfio_array.hpp │ │ ├── elfio_dump.hpp │ │ ├── elfio_dynamic.hpp │ │ ├── elfio_header.hpp │ │ ├── elfio_modinfo.hpp │ │ ├── elfio_note.hpp │ │ ├── elfio_relocation.hpp │ │ ├── elfio_section.hpp │ │ ├── elfio_segment.hpp │ │ ├── elfio_strings.hpp │ │ ├── elfio_symbols.hpp │ │ ├── elfio_utils.hpp │ │ ├── elfio_version.hpp │ │ └── elfio_versym.hpp │ ├── hexdump.h │ ├── libs │ │ └── arm64-v8a │ │ │ ├── libQBDI.a │ │ │ └── libdobby.a │ ├── linker_hook.cpp │ ├── linker_hook.h │ ├── nhook.cpp │ ├── nhook.h │ ├── utils.cpp │ ├── utils.h │ ├── vm.cpp │ └── vm.h │ ├── java │ └── cn │ │ └── mrack │ │ └── xposed │ │ └── nhook │ │ ├── HookUtils.java │ │ ├── MainHook.java │ │ ├── NHook.java │ │ ├── SettingsActivity.java │ │ └── menu │ │ ├── Config.java │ │ ├── Menu.java │ │ ├── PBoolean.java │ │ ├── PInteger.java │ │ ├── PString.java │ │ ├── PValue.java │ │ └── SurfaceImGUI.java │ └── res │ ├── drawable │ ├── ic_launcher_background.xml │ └── ic_launcher_foreground.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-mdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── values │ ├── colors.xml │ └── strings.xml │ └── xml │ └── settings.xml ├── build.gradle ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /.gradle/ -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /.idea/git_toolbox_blame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/git_toolbox_prj.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XposedNHook 2 | 原地址 https://github.com/Mrack/XposedNHook 3 | Xposed免root注入so方案, 支持android各个版本 4 | 5 | ## demo: 6 | #### qbdi trace 7 | ![image](https://github.com/Mrack/XposedNHook/assets/15072171/87d14b94-736f-4511-bcc2-de14d331f6c4) 8 | 9 | #### android mod menu 10 | [Android-Mod-Menu](https://github.com/LGLTeam/Android-Mod-Menu/) 11 | 12 | #### android mod menu (ImGui) 13 | ![7853106f157ca453cab47600a85de357](https://github.com/Mrack/XposedNHook/assets/15072171/18cb056e-78a6-4430-a0a5-b11e42a9fbfd) 14 | ![91ebff12cf653f23fac0342b1be2adba](https://github.com/Mrack/XposedNHook/assets/15072171/b1c012df-5bfc-4749-8070-3ea3d05c5eb4) 15 | 16 | #### il2cppdumper 17 | ![image](https://github.com/Mrack/XposedNHook/assets/15072171/9092c99f-6b59-481e-892c-0ec6b1a2aae7) 18 | 19 | 20 | #### youtube ssl pinning 21 | ... 22 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-7af23b9ff40281ed5838.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs" : 3 | [ 4 | { 5 | "path" : "CMakeLists.txt" 6 | }, 7 | { 8 | "isGenerated" : true, 9 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake" 10 | }, 11 | { 12 | "isExternal" : true, 13 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake" 14 | }, 15 | { 16 | "isExternal" : true, 17 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/adjust_api_level.cmake" 18 | }, 19 | { 20 | "isExternal" : true, 21 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/platforms.cmake" 22 | }, 23 | { 24 | "isCMake" : true, 25 | "isExternal" : true, 26 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeSystemSpecificInitialize.cmake" 27 | }, 28 | { 29 | "isCMake" : true, 30 | "isExternal" : true, 31 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android-Initialize.cmake" 32 | }, 33 | { 34 | "isExternal" : true, 35 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/hooks/pre/Android-Initialize.cmake" 36 | }, 37 | { 38 | "isGenerated" : true, 39 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake" 40 | }, 41 | { 42 | "isGenerated" : true, 43 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake" 44 | }, 45 | { 46 | "isCMake" : true, 47 | "isExternal" : true, 48 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeSystemSpecificInformation.cmake" 49 | }, 50 | { 51 | "isCMake" : true, 52 | "isExternal" : true, 53 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeGenericSystem.cmake" 54 | }, 55 | { 56 | "isCMake" : true, 57 | "isExternal" : true, 58 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeInitializeConfigs.cmake" 59 | }, 60 | { 61 | "isCMake" : true, 62 | "isExternal" : true, 63 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android.cmake" 64 | }, 65 | { 66 | "isExternal" : true, 67 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/hooks/pre/Android.cmake" 68 | }, 69 | { 70 | "isCMake" : true, 71 | "isExternal" : true, 72 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Linux.cmake" 73 | }, 74 | { 75 | "isCMake" : true, 76 | "isExternal" : true, 77 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/UnixPaths.cmake" 78 | }, 79 | { 80 | "isExternal" : true, 81 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/hooks/post/Android.cmake" 82 | }, 83 | { 84 | "isCMake" : true, 85 | "isExternal" : true, 86 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeCInformation.cmake" 87 | }, 88 | { 89 | "isCMake" : true, 90 | "isExternal" : true, 91 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeLanguageInformation.cmake" 92 | }, 93 | { 94 | "isCMake" : true, 95 | "isExternal" : true, 96 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/Clang-C.cmake" 97 | }, 98 | { 99 | "isCMake" : true, 100 | "isExternal" : true, 101 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/Clang.cmake" 102 | }, 103 | { 104 | "isCMake" : true, 105 | "isExternal" : true, 106 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 107 | }, 108 | { 109 | "isCMake" : true, 110 | "isExternal" : true, 111 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/GNU.cmake" 112 | }, 113 | { 114 | "isCMake" : true, 115 | "isExternal" : true, 116 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 117 | }, 118 | { 119 | "isCMake" : true, 120 | "isExternal" : true, 121 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android-Clang-C.cmake" 122 | }, 123 | { 124 | "isCMake" : true, 125 | "isExternal" : true, 126 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android-Clang.cmake" 127 | }, 128 | { 129 | "isExternal" : true, 130 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/hooks/pre/Android-Clang.cmake" 131 | }, 132 | { 133 | "isExternal" : true, 134 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/flags.cmake" 135 | }, 136 | { 137 | "isCMake" : true, 138 | "isExternal" : true, 139 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android-Common.cmake" 140 | }, 141 | { 142 | "isExternal" : true, 143 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/hooks/post/Android-Clang.cmake" 144 | }, 145 | { 146 | "isCMake" : true, 147 | "isExternal" : true, 148 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeCommonLanguageInclude.cmake" 149 | }, 150 | { 151 | "isCMake" : true, 152 | "isExternal" : true, 153 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeCXXInformation.cmake" 154 | }, 155 | { 156 | "isCMake" : true, 157 | "isExternal" : true, 158 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeLanguageInformation.cmake" 159 | }, 160 | { 161 | "isCMake" : true, 162 | "isExternal" : true, 163 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/Clang-CXX.cmake" 164 | }, 165 | { 166 | "isCMake" : true, 167 | "isExternal" : true, 168 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Compiler/Clang.cmake" 169 | }, 170 | { 171 | "isCMake" : true, 172 | "isExternal" : true, 173 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android-Clang-CXX.cmake" 174 | }, 175 | { 176 | "isCMake" : true, 177 | "isExternal" : true, 178 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/Platform/Android-Clang.cmake" 179 | }, 180 | { 181 | "isCMake" : true, 182 | "isExternal" : true, 183 | "path" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22/Modules/CMakeCommonLanguageInclude.cmake" 184 | } 185 | ], 186 | "kind" : "cmakeFiles", 187 | "paths" : 188 | { 189 | "build" : "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a", 190 | "source" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp" 191 | }, 192 | "version" : 193 | { 194 | "major" : 1, 195 | "minor" : 0 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-fcee9f64cbcefffc26ec.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : 3 | [ 4 | { 5 | "directories" : 6 | [ 7 | { 8 | "build" : ".", 9 | "jsonFile" : "directory-.-Debug-f5ebdc15457944623624.json", 10 | "minimumCMakeVersion" : 11 | { 12 | "string" : "3.6.0" 13 | }, 14 | "projectIndex" : 0, 15 | "source" : ".", 16 | "targetIndexes" : 17 | [ 18 | 0, 19 | 1 20 | ] 21 | } 22 | ], 23 | "name" : "Debug", 24 | "projects" : 25 | [ 26 | { 27 | "directoryIndexes" : 28 | [ 29 | 0 30 | ], 31 | "name" : "nhook", 32 | "targetIndexes" : 33 | [ 34 | 0, 35 | 1 36 | ] 37 | } 38 | ], 39 | "targets" : 40 | [ 41 | { 42 | "directoryIndex" : 0, 43 | "id" : "imgui::@6890427a1f51a3e7e1df", 44 | "jsonFile" : "target-imgui-Debug-fe01b39361118dc48f8b.json", 45 | "name" : "imgui", 46 | "projectIndex" : 0 47 | }, 48 | { 49 | "directoryIndex" : 0, 50 | "id" : "nhook::@6890427a1f51a3e7e1df", 51 | "jsonFile" : "target-nhook-Debug-2308b745bd60863ce0c9.json", 52 | "name" : "nhook", 53 | "projectIndex" : 0 54 | } 55 | ] 56 | } 57 | ], 58 | "kind" : "codemodel", 59 | "paths" : 60 | { 61 | "build" : "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a", 62 | "source" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp" 63 | }, 64 | "version" : 65 | { 66 | "major" : 2, 67 | "minor" : 3 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json: -------------------------------------------------------------------------------- 1 | { 2 | "backtraceGraph" : 3 | { 4 | "commands" : [], 5 | "files" : [], 6 | "nodes" : [] 7 | }, 8 | "installers" : [], 9 | "paths" : 10 | { 11 | "build" : ".", 12 | "source" : "." 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/reply/index-2024-11-07T10-39-57-0445.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake" : 3 | { 4 | "generator" : 5 | { 6 | "multiConfig" : false, 7 | "name" : "Ninja" 8 | }, 9 | "paths" : 10 | { 11 | "cmake" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/cmake", 12 | "cpack" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/cpack", 13 | "ctest" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ctest", 14 | "root" : "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22" 15 | }, 16 | "version" : 17 | { 18 | "isDirty" : false, 19 | "major" : 3, 20 | "minor" : 22, 21 | "patch" : 1, 22 | "string" : "3.22.1-g37088a8", 23 | "suffix" : "g37088a8" 24 | } 25 | }, 26 | "objects" : 27 | [ 28 | { 29 | "jsonFile" : "codemodel-v2-fcee9f64cbcefffc26ec.json", 30 | "kind" : "codemodel", 31 | "version" : 32 | { 33 | "major" : 2, 34 | "minor" : 3 35 | } 36 | }, 37 | { 38 | "jsonFile" : "cache-v2-f7fd074347f5ccc6f5a9.json", 39 | "kind" : "cache", 40 | "version" : 41 | { 42 | "major" : 2, 43 | "minor" : 0 44 | } 45 | }, 46 | { 47 | "jsonFile" : "cmakeFiles-v1-7af23b9ff40281ed5838.json", 48 | "kind" : "cmakeFiles", 49 | "version" : 50 | { 51 | "major" : 1, 52 | "minor" : 0 53 | } 54 | } 55 | ], 56 | "reply" : 57 | { 58 | "client-agp" : 59 | { 60 | "cache-v2" : 61 | { 62 | "jsonFile" : "cache-v2-f7fd074347f5ccc6f5a9.json", 63 | "kind" : "cache", 64 | "version" : 65 | { 66 | "major" : 2, 67 | "minor" : 0 68 | } 69 | }, 70 | "cmakeFiles-v1" : 71 | { 72 | "jsonFile" : "cmakeFiles-v1-7af23b9ff40281ed5838.json", 73 | "kind" : "cmakeFiles", 74 | "version" : 75 | { 76 | "major" : 1, 77 | "minor" : 0 78 | } 79 | }, 80 | "codemodel-v2" : 81 | { 82 | "jsonFile" : "codemodel-v2-fcee9f64cbcefffc26ec.json", 83 | "kind" : "codemodel", 84 | "version" : 85 | { 86 | "major" : 2, 87 | "minor" : 3 88 | } 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/reply/target-imgui-Debug-fe01b39361118dc48f8b.json: -------------------------------------------------------------------------------- 1 | { 2 | "archive" : {}, 3 | "artifacts" : 4 | [ 5 | { 6 | "path" : "libimgui.a" 7 | } 8 | ], 9 | "backtrace" : 1, 10 | "backtraceGraph" : 11 | { 12 | "commands" : 13 | [ 14 | "add_library", 15 | "include_directories" 16 | ], 17 | "files" : 18 | [ 19 | "CMakeLists.txt" 20 | ], 21 | "nodes" : 22 | [ 23 | { 24 | "file" : 0 25 | }, 26 | { 27 | "command" : 0, 28 | "file" : 0, 29 | "line" : 53, 30 | "parent" : 0 31 | }, 32 | { 33 | "command" : 1, 34 | "file" : 0, 35 | "line" : 21, 36 | "parent" : 0 37 | }, 38 | { 39 | "command" : 1, 40 | "file" : 0, 41 | "line" : 32, 42 | "parent" : 0 43 | }, 44 | { 45 | "command" : 1, 46 | "file" : 0, 47 | "line" : 51, 48 | "parent" : 0 49 | } 50 | ] 51 | }, 52 | "compileGroups" : 53 | [ 54 | { 55 | "compileCommandFragments" : 56 | [ 57 | { 58 | "fragment" : "-DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -fno-exceptions -fno-rtti -fvisibility=hidden -Wl,--exclude-libs,ALL -g -fno-limit-debug-info -fPIC" 59 | }, 60 | { 61 | "fragment" : "-std=gnu++20" 62 | } 63 | ], 64 | "includes" : 65 | [ 66 | { 67 | "backtrace" : 2, 68 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/." 69 | }, 70 | { 71 | "backtrace" : 3, 72 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/imgui" 73 | }, 74 | { 75 | "backtrace" : 4, 76 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/./imgui" 77 | } 78 | ], 79 | "language" : "CXX", 80 | "languageStandard" : 81 | { 82 | "backtraces" : 83 | [ 84 | 1 85 | ], 86 | "standard" : "20" 87 | }, 88 | "sourceIndexes" : 89 | [ 90 | 0, 91 | 1, 92 | 2, 93 | 3, 94 | 4, 95 | 5 96 | ], 97 | "sysroot" : 98 | { 99 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot" 100 | } 101 | } 102 | ], 103 | "id" : "imgui::@6890427a1f51a3e7e1df", 104 | "name" : "imgui", 105 | "nameOnDisk" : "libimgui.a", 106 | "paths" : 107 | { 108 | "build" : ".", 109 | "source" : "." 110 | }, 111 | "sourceGroups" : 112 | [ 113 | { 114 | "name" : "Source Files", 115 | "sourceIndexes" : 116 | [ 117 | 0, 118 | 1, 119 | 2, 120 | 3, 121 | 4, 122 | 5 123 | ] 124 | } 125 | ], 126 | "sources" : 127 | [ 128 | { 129 | "backtrace" : 1, 130 | "compileGroupIndex" : 0, 131 | "path" : "imgui/imgui.cpp", 132 | "sourceGroupIndex" : 0 133 | }, 134 | { 135 | "backtrace" : 1, 136 | "compileGroupIndex" : 0, 137 | "path" : "imgui/imgui_draw.cpp", 138 | "sourceGroupIndex" : 0 139 | }, 140 | { 141 | "backtrace" : 1, 142 | "compileGroupIndex" : 0, 143 | "path" : "imgui/imgui_tables.cpp", 144 | "sourceGroupIndex" : 0 145 | }, 146 | { 147 | "backtrace" : 1, 148 | "compileGroupIndex" : 0, 149 | "path" : "imgui/imgui_widgets.cpp", 150 | "sourceGroupIndex" : 0 151 | }, 152 | { 153 | "backtrace" : 1, 154 | "compileGroupIndex" : 0, 155 | "path" : "imgui/backends/imgui_impl_android.cpp", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "compileGroupIndex" : 0, 161 | "path" : "imgui/backends/imgui_impl_opengl3.cpp", 162 | "sourceGroupIndex" : 0 163 | } 164 | ], 165 | "type" : "STATIC_LIBRARY" 166 | } 167 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.cmake/api/v1/reply/target-nhook-Debug-2308b745bd60863ce0c9.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/build/intermediates/cxx/Debug/4lq6t6k1/obj/arm64-v8a/libnhook.so" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_library", 14 | "target_link_libraries", 15 | "include_directories" 16 | ], 17 | "files" : 18 | [ 19 | "CMakeLists.txt" 20 | ], 21 | "nodes" : 22 | [ 23 | { 24 | "file" : 0 25 | }, 26 | { 27 | "command" : 0, 28 | "file" : 0, 29 | "line" : 34, 30 | "parent" : 0 31 | }, 32 | { 33 | "command" : 1, 34 | "file" : 0, 35 | "line" : 64, 36 | "parent" : 0 37 | }, 38 | { 39 | "command" : 2, 40 | "file" : 0, 41 | "line" : 21, 42 | "parent" : 0 43 | }, 44 | { 45 | "command" : 2, 46 | "file" : 0, 47 | "line" : 32, 48 | "parent" : 0 49 | }, 50 | { 51 | "command" : 2, 52 | "file" : 0, 53 | "line" : 51, 54 | "parent" : 0 55 | } 56 | ] 57 | }, 58 | "compileGroups" : 59 | [ 60 | { 61 | "compileCommandFragments" : 62 | [ 63 | { 64 | "fragment" : "-DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -fno-exceptions -fno-rtti -fvisibility=hidden -Wl,--exclude-libs,ALL -g -fno-limit-debug-info -fPIC" 65 | }, 66 | { 67 | "fragment" : "-std=gnu++20" 68 | } 69 | ], 70 | "defines" : 71 | [ 72 | { 73 | "define" : "nhook_EXPORTS" 74 | } 75 | ], 76 | "includes" : 77 | [ 78 | { 79 | "backtrace" : 3, 80 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/." 81 | }, 82 | { 83 | "backtrace" : 4, 84 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/imgui" 85 | }, 86 | { 87 | "backtrace" : 5, 88 | "path" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/./imgui" 89 | } 90 | ], 91 | "language" : "CXX", 92 | "languageStandard" : 93 | { 94 | "backtraces" : 95 | [ 96 | 1 97 | ], 98 | "standard" : "20" 99 | }, 100 | "sourceIndexes" : 101 | [ 102 | 0, 103 | 1, 104 | 2, 105 | 3, 106 | 4, 107 | 5, 108 | 6, 109 | 7, 110 | 8 111 | ], 112 | "sysroot" : 113 | { 114 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot" 115 | } 116 | } 117 | ], 118 | "dependencies" : 119 | [ 120 | { 121 | "backtrace" : 2, 122 | "id" : "imgui::@6890427a1f51a3e7e1df" 123 | } 124 | ], 125 | "id" : "nhook::@6890427a1f51a3e7e1df", 126 | "link" : 127 | { 128 | "commandFragments" : 129 | [ 130 | { 131 | "fragment" : "-Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -L/opt/homebrew/opt/openssl@3/lib", 132 | "role" : "flags" 133 | }, 134 | { 135 | "backtrace" : 2, 136 | "fragment" : "-landroid", 137 | "role" : "libraries" 138 | }, 139 | { 140 | "backtrace" : 2, 141 | "fragment" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/libs/arm64-v8a/libdobby.a", 142 | "role" : "libraries" 143 | }, 144 | { 145 | "backtrace" : 2, 146 | "fragment" : "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/libs/arm64-v8a/libQBDI.a", 147 | "role" : "libraries" 148 | }, 149 | { 150 | "backtrace" : 2, 151 | "fragment" : "-lEGL", 152 | "role" : "libraries" 153 | }, 154 | { 155 | "backtrace" : 2, 156 | "fragment" : "-lGLESv3", 157 | "role" : "libraries" 158 | }, 159 | { 160 | "backtrace" : 2, 161 | "fragment" : "libimgui.a", 162 | "role" : "libraries" 163 | }, 164 | { 165 | "backtrace" : 2, 166 | "fragment" : "-llog", 167 | "role" : "libraries" 168 | }, 169 | { 170 | "fragment" : "-static-libstdc++ -latomic -lm", 171 | "role" : "libraries" 172 | } 173 | ], 174 | "language" : "CXX", 175 | "sysroot" : 176 | { 177 | "path" : "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot" 178 | } 179 | }, 180 | "name" : "nhook", 181 | "nameOnDisk" : "libnhook.so", 182 | "paths" : 183 | { 184 | "build" : ".", 185 | "source" : "." 186 | }, 187 | "sourceGroups" : 188 | [ 189 | { 190 | "name" : "Source Files", 191 | "sourceIndexes" : 192 | [ 193 | 0, 194 | 1, 195 | 2, 196 | 3, 197 | 4, 198 | 5, 199 | 6, 200 | 7, 201 | 8 202 | ] 203 | } 204 | ], 205 | "sources" : 206 | [ 207 | { 208 | "backtrace" : 1, 209 | "compileGroupIndex" : 0, 210 | "path" : "nhook.cpp", 211 | "sourceGroupIndex" : 0 212 | }, 213 | { 214 | "backtrace" : 1, 215 | "compileGroupIndex" : 0, 216 | "path" : "linker_hook.cpp", 217 | "sourceGroupIndex" : 0 218 | }, 219 | { 220 | "backtrace" : 1, 221 | "compileGroupIndex" : 0, 222 | "path" : "vm.cpp", 223 | "sourceGroupIndex" : 0 224 | }, 225 | { 226 | "backtrace" : 1, 227 | "compileGroupIndex" : 0, 228 | "path" : "utils.cpp", 229 | "sourceGroupIndex" : 0 230 | }, 231 | { 232 | "backtrace" : 1, 233 | "compileGroupIndex" : 0, 234 | "path" : "demo/qbdihook.cpp", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "compileGroupIndex" : 0, 240 | "path" : "demo/modmenu.cpp", 241 | "sourceGroupIndex" : 0 242 | }, 243 | { 244 | "backtrace" : 1, 245 | "compileGroupIndex" : 0, 246 | "path" : "demo/ytbssl.cpp", 247 | "sourceGroupIndex" : 0 248 | }, 249 | { 250 | "backtrace" : 1, 251 | "compileGroupIndex" : 0, 252 | "path" : "demo/modmenu_native.cpp", 253 | "sourceGroupIndex" : 0 254 | }, 255 | { 256 | "backtrace" : 1, 257 | "compileGroupIndex" : 0, 258 | "path" : "demo/il2cpp_dumper.cpp", 259 | "sourceGroupIndex" : 0 260 | } 261 | ], 262 | "type" : "SHARED_LIBRARY" 263 | } 264 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/.ninja_deps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/.ninja_deps -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "Clang") 4 | set(CMAKE_C_COMPILER_VERSION "12.0.8") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") 8 | set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") 9 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") 10 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 11 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 12 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 13 | set(CMAKE_C17_COMPILE_FEATURES "c_std_17") 14 | set(CMAKE_C23_COMPILE_FEATURES "c_std_23") 15 | 16 | set(CMAKE_C_PLATFORM_ID "Linux") 17 | set(CMAKE_C_SIMULATE_ID "") 18 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") 19 | set(CMAKE_C_SIMULATE_VERSION "") 20 | 21 | 22 | 23 | 24 | set(CMAKE_AR "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar") 25 | set(CMAKE_C_COMPILER_AR "CMAKE_C_COMPILER_AR-NOTFOUND") 26 | set(CMAKE_RANLIB "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib") 27 | set(CMAKE_C_COMPILER_RANLIB "CMAKE_C_COMPILER_RANLIB-NOTFOUND") 28 | set(CMAKE_LINKER "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld") 29 | set(CMAKE_MT "") 30 | set(CMAKE_COMPILER_IS_GNUCC ) 31 | set(CMAKE_C_COMPILER_LOADED 1) 32 | set(CMAKE_C_COMPILER_WORKS TRUE) 33 | set(CMAKE_C_ABI_COMPILED TRUE) 34 | 35 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 36 | 37 | set(CMAKE_C_COMPILER_ID_RUN 1) 38 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 39 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 40 | set(CMAKE_C_LINKER_PREFERENCE 10) 41 | 42 | # Save compiler ABI information. 43 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 44 | set(CMAKE_C_COMPILER_ABI "ELF") 45 | set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") 46 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 47 | 48 | if(CMAKE_C_SIZEOF_DATA_PTR) 49 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 50 | endif() 51 | 52 | if(CMAKE_C_COMPILER_ABI) 53 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 54 | endif() 55 | 56 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 57 | set(CMAKE_LIBRARY_ARCHITECTURE "") 58 | endif() 59 | 60 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 61 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 62 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 63 | endif() 64 | 65 | 66 | set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") 67 | set(CMAKE_C_ANDROID_TOOLCHAIN_MACHINE "aarch64-linux-android") 68 | set(CMAKE_C_ANDROID_TOOLCHAIN_VERSION "") 69 | set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "") 70 | set(CMAKE_C_ANDROID_TOOLCHAIN_PREFIX "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-") 71 | set(CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX "") 72 | 73 | 74 | 75 | 76 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/local/include;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.8/include;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include") 77 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "atomic;m;-l:libunwind.a;dl;c;-l:libunwind.a;dl") 78 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/opt/homebrew/opt/openssl@3/lib;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.8/lib/linux/aarch64;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/24;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib") 79 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 80 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "Clang") 4 | set(CMAKE_CXX_COMPILER_VERSION "12.0.8") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") 9 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") 10 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 11 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 12 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 13 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 14 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 15 | set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") 16 | 17 | set(CMAKE_CXX_PLATFORM_ID "Linux") 18 | set(CMAKE_CXX_SIMULATE_ID "") 19 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") 20 | set(CMAKE_CXX_SIMULATE_VERSION "") 21 | 22 | 23 | 24 | 25 | set(CMAKE_AR "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar") 26 | set(CMAKE_CXX_COMPILER_AR "CMAKE_CXX_COMPILER_AR-NOTFOUND") 27 | set(CMAKE_RANLIB "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib") 28 | set(CMAKE_CXX_COMPILER_RANLIB "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND") 29 | set(CMAKE_LINKER "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld") 30 | set(CMAKE_MT "") 31 | set(CMAKE_COMPILER_IS_GNUCXX ) 32 | set(CMAKE_CXX_COMPILER_LOADED 1) 33 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 34 | set(CMAKE_CXX_ABI_COMPILED TRUE) 35 | 36 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 37 | 38 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 39 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) 40 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 41 | 42 | foreach (lang C OBJC OBJCXX) 43 | if (CMAKE_${lang}_COMPILER_ID_RUN) 44 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 45 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 46 | endforeach() 47 | endif() 48 | endforeach() 49 | 50 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 51 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 52 | 53 | # Save compiler ABI information. 54 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 55 | set(CMAKE_CXX_COMPILER_ABI "ELF") 56 | set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") 57 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 58 | 59 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 60 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 61 | endif() 62 | 63 | if(CMAKE_CXX_COMPILER_ABI) 64 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 65 | endif() 66 | 67 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 68 | set(CMAKE_LIBRARY_ARCHITECTURE "") 69 | endif() 70 | 71 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 72 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 73 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 74 | endif() 75 | 76 | 77 | set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") 78 | set(CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE "aarch64-linux-android") 79 | set(CMAKE_CXX_ANDROID_TOOLCHAIN_VERSION "") 80 | set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "") 81 | set(CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-") 82 | set(CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX "") 83 | 84 | 85 | 86 | 87 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/local/include;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.8/include;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include") 88 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "atomic;m;c++;m;-l:libunwind.a;dl;c;-l:libunwind.a;dl") 89 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/opt/homebrew/opt/openssl@3/lib;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.8/lib/linux/aarch64;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/24;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android;/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib") 90 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 91 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Darwin-24.0.0") 2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin") 3 | set(CMAKE_HOST_SYSTEM_VERSION "24.0.0") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") 5 | 6 | include("/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake") 7 | 8 | set(CMAKE_SYSTEM "Android-24") 9 | set(CMAKE_SYSTEM_NAME "Android") 10 | set(CMAKE_SYSTEM_VERSION "24") 11 | set(CMAKE_SYSTEM_PROCESSOR "aarch64") 12 | 13 | set(CMAKE_ANDROID_NDK "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620") 14 | set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN "") 15 | set(CMAKE_ANDROID_ARCH "arm64") 16 | set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") 17 | set(CMAKE_ANDROID_ARCH_TRIPLE "aarch64-linux-android") 18 | set(CMAKE_ANDROID_ARCH_LLVM_TRIPLE "aarch64-none-linux-android") 19 | set(CMAKE_ANDROID_NDK_VERSION "23.1") 20 | set(CMAKE_ANDROID_NDK_DEPRECATED_HEADERS "1") 21 | set(CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG "darwin-x86_64") 22 | set(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64") 23 | 24 | # Copyright (C) 2020 The Android Open Source Project 25 | # 26 | # Licensed under the Apache License, Version 2.0 (the "License"); 27 | # you may not use this file except in compliance with the License. 28 | # You may obtain a copy of the License at 29 | # 30 | # http://www.apache.org/licenses/LICENSE-2.0 31 | # 32 | # Unless required by applicable law or agreed to in writing, software 33 | # distributed under the License is distributed on an "AS IS" BASIS, 34 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 35 | # See the License for the specific language governing permissions and 36 | # limitations under the License. 37 | 38 | # Read-only variables for compatibility with the other toolchain file. 39 | # We'll keep these around for the existing projects that still use them. 40 | # TODO: All of the variables here have equivalents in the standard set of 41 | # cmake configurable variables, so we can remove these once most of our 42 | # users migrate to those variables. 43 | 44 | # From legacy toolchain file. 45 | set(ANDROID_NDK "${CMAKE_ANDROID_NDK}") 46 | set(ANDROID_ABI "${CMAKE_ANDROID_ARCH_ABI}") 47 | set(ANDROID_COMPILER_IS_CLANG TRUE) 48 | set(ANDROID_PLATFORM "android-${CMAKE_SYSTEM_VERSION}") 49 | set(ANDROID_PLATFORM_LEVEL "${CMAKE_SYSTEM_VERSION}") 50 | if(CMAKE_ANDROID_STL_TYPE) 51 | set(ANDROID_ARM_NEON TRUE) 52 | else() 53 | set(ANDROID_ARM_NEON FALSE) 54 | endif() 55 | if(CMAKE_ANDROID_ARM_MODE) 56 | set(ANDROID_ARM_MODE "arm") 57 | set(ANDROID_FORCE_ARM_BUILD TRUE) 58 | else() 59 | set(ANDROID_ARM_MODE "thumb") 60 | endif() 61 | set(ANDROID_ARCH_NAME "${CMAKE_ANDROID_ARCH}") 62 | set(ANDROID_LLVM_TRIPLE "${CMAKE_ANDROID_ARCH_LLVM_TRIPLE}${CMAKE_SYSTEM_VERSION}") 63 | set(ANDROID_TOOLCHAIN_ROOT "${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}") 64 | set(ANDROID_HOST_TAG "${CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG}") 65 | set(ANDROID_HOST_PREBUILTS "${CMAKE_ANDROID_NDK}/prebuilt/${CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG}") 66 | set(ANDROID_AR "${CMAKE_AR}") 67 | set(ANDROID_RANLIB "${CMAKE_RANLIB}") 68 | set(ANDROID_STRIP "${CMAKE_STRIP}") 69 | if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") 70 | set(ANDROID_TOOLCHAIN_SUFFIX ".exe") 71 | endif() 72 | 73 | # From other toolchain file. 74 | set(ANDROID_NATIVE_API_LEVEL "${ANDROID_PLATFORM_LEVEL}") 75 | if(ANDROID_ALLOW_UNDEFINED_SYMBOLS) 76 | set(ANDROID_SO_UNDEFINED TRUE) 77 | else() 78 | set(ANDROID_NO_UNDEFINED TRUE) 79 | endif() 80 | set(ANDROID_FUNCTION_LEVEL_LINKING TRUE) 81 | set(ANDROID_GOLD_LINKER TRUE) 82 | set(ANDROID_NOEXECSTACK TRUE) 83 | set(ANDROID_RELRO TRUE) 84 | if(ANDROID_CPP_FEATURES MATCHES "rtti" 85 | AND ANDROID_CPP_FEATURES MATCHES "exceptions") 86 | set(ANDROID_STL_FORCE_FEATURES TRUE) 87 | endif() 88 | if(ANDROID_CCACHE) 89 | set(NDK_CCACHE "${ANDROID_CCACHE}") 90 | endif() 91 | set(ANDROID_NDK_HOST_X64 TRUE) 92 | set(ANDROID_NDK_LAYOUT RELEASE) 93 | if(CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a") 94 | set(ARMEABI_V7A TRUE) 95 | if(ANDROID_ARM_NEON) 96 | set(NEON TRUE) 97 | endif() 98 | elseif(CMAKE_ANDROID_ARCH_ABI STREQUAL "arm64-v8a") 99 | set(ARM64_V8A TRUE) 100 | elseif(CMAKE_ANDROID_ARCH_ABI STREQUAL "x86") 101 | set(X86 TRUE) 102 | elseif(CMAKE_ANDROID_ARCH_ABI STREQUAL "x86_64") 103 | set(X86_64 TRUE) 104 | endif() 105 | set(ANDROID_NDK_HOST_SYSTEM_NAME "${ANDROID_HOST_TAG}") 106 | set(ANDROID_NDK_ABI_NAME "${CMAKE_ANDROID_ARCH_ABI}") 107 | set(ANDROID_NDK_RELEASE "r${ANDROID_NDK_REVISION}") 108 | set(TOOL_OS_SUFFIX "${ANDROID_TOOLCHAIN_SUFFIX}") 109 | 110 | 111 | set(CMAKE_CROSSCOMPILING "TRUE") 112 | 113 | set(CMAKE_SYSTEM_LOADED 1) 114 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir 2 | /Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir 3 | /Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/edit_cache.dir 4 | /Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/rebuild_cache.dir 5 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/backends/imgui_impl_android.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/backends/imgui_impl_android.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/backends/imgui_impl_opengl3.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/backends/imgui_impl_opengl3.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui_draw.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui_draw.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui_tables.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui_tables.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui_widgets.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/imgui.dir/imgui/imgui_widgets.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/il2cpp_dumper.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/il2cpp_dumper.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/modmenu.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/modmenu.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/modmenu_native.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/modmenu_native.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/qbdihook.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/qbdihook.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/ytbssl.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/demo/ytbssl.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/linker_hook.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/linker_hook.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/nhook.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/nhook.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/utils.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/utils.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/vm.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/nhook.dir/vm.cpp.o -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/CMakeFiles/rules.ninja: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Ninja" Generator, CMake Version 3.22 3 | 4 | # This file contains all the rules used to get the outputs files 5 | # built from the input files. 6 | # It is included in the main 'build.ninja'. 7 | 8 | # ============================================================================= 9 | # Project: nhook 10 | # Configurations: Debug 11 | # ============================================================================= 12 | # ============================================================================= 13 | 14 | ############################################# 15 | # Rule for compiling CXX files. 16 | 17 | rule CXX_COMPILER__nhook_Debug 18 | depfile = $DEP_FILE 19 | deps = gcc 20 | command = /Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 21 | description = Building CXX object $out 22 | 23 | 24 | ############################################# 25 | # Rule for linking CXX shared library. 26 | 27 | rule CXX_SHARED_LIBRARY_LINKER__nhook_Debug 28 | command = $PRE_LINK && /Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC $LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS $LINK_FLAGS -shared $SONAME_FLAG$SONAME -o $TARGET_FILE $in $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 29 | description = Linking CXX shared library $TARGET_FILE 30 | restat = $RESTAT 31 | 32 | 33 | ############################################# 34 | # Rule for compiling CXX files. 35 | 36 | rule CXX_COMPILER__imgui_Debug 37 | depfile = $DEP_FILE 38 | deps = gcc 39 | command = /Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 40 | description = Building CXX object $out 41 | 42 | 43 | ############################################# 44 | # Rule for linking CXX static library. 45 | 46 | rule CXX_STATIC_LIBRARY_LINKER__imgui_Debug 47 | command = $PRE_LINK && /Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/cmake -E rm -f $TARGET_FILE && /Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar qc $TARGET_FILE $LINK_FLAGS $in && /Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib $TARGET_FILE && /Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/cmake -E touch $TARGET_FILE && $POST_BUILD 48 | description = Linking CXX static library $TARGET_FILE 49 | restat = $RESTAT 50 | 51 | 52 | ############################################# 53 | # Rule for running custom commands. 54 | 55 | rule CUSTOM_COMMAND 56 | command = $COMMAND 57 | description = $DESC 58 | 59 | 60 | ############################################# 61 | # Rule for re-running cmake. 62 | 63 | rule RERUN_CMAKE 64 | command = /Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/cmake --regenerate-during-build -S/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp -B/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a 65 | description = Re-running CMake... 66 | generator = 1 67 | 68 | 69 | ############################################# 70 | # Rule for cleaning all built files. 71 | 72 | rule CLEAN 73 | command = /Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja $FILE_ARG -t clean $TARGETS 74 | description = Cleaning all built files... 75 | 76 | 77 | ############################################# 78 | # Rule for printing all primary targets available. 79 | 80 | rule HELP 81 | command = /Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja -t targets 82 | description = All primary targets available: 83 | 84 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/additional_project_files.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/additional_project_files.txt -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/android_gradle_build.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildFiles": [ 3 | "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/CMakeLists.txt" 4 | ], 5 | "cleanCommandsComponents": [ 6 | [ 7 | "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja", 8 | "-C", 9 | "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a", 10 | "clean" 11 | ] 12 | ], 13 | "buildTargetsCommandComponents": [ 14 | "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja", 15 | "-C", 16 | "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a", 17 | "{LIST_OF_TARGETS_TO_BUILD}" 18 | ], 19 | "libraries": { 20 | "imgui::@6890427a1f51a3e7e1df": { 21 | "toolchain": "toolchain", 22 | "abi": "arm64-v8a", 23 | "artifactName": "imgui", 24 | "output": "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/libimgui.a" 25 | }, 26 | "nhook::@6890427a1f51a3e7e1df": { 27 | "toolchain": "toolchain", 28 | "abi": "arm64-v8a", 29 | "artifactName": "nhook", 30 | "output": "/Users/ligoudan/Desktop/XposedNHook/app/build/intermediates/cxx/Debug/4lq6t6k1/obj/arm64-v8a/libnhook.so", 31 | "runtimeFiles": [] 32 | } 33 | }, 34 | "toolchains": { 35 | "toolchain": { 36 | "cCompilerExecutable": "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang.lld", 37 | "cppCompilerExecutable": "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++.lld" 38 | } 39 | }, 40 | "cFileExtensions": [], 41 | "cppFileExtensions": [ 42 | "cpp" 43 | ] 44 | } -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/android_gradle_build_mini.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildFiles": [ 3 | "/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/CMakeLists.txt" 4 | ], 5 | "cleanCommandsComponents": [ 6 | [ 7 | "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja", 8 | "-C", 9 | "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a", 10 | "clean" 11 | ] 12 | ], 13 | "buildTargetsCommandComponents": [ 14 | "/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja", 15 | "-C", 16 | "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a", 17 | "{LIST_OF_TARGETS_TO_BUILD}" 18 | ], 19 | "libraries": { 20 | "imgui::@6890427a1f51a3e7e1df": { 21 | "artifactName": "imgui", 22 | "abi": "arm64-v8a", 23 | "output": "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/libimgui.a", 24 | "runtimeFiles": [] 25 | }, 26 | "nhook::@6890427a1f51a3e7e1df": { 27 | "artifactName": "nhook", 28 | "abi": "arm64-v8a", 29 | "output": "/Users/ligoudan/Desktop/XposedNHook/app/build/intermediates/cxx/Debug/4lq6t6k1/obj/arm64-v8a/libnhook.so", 30 | "runtimeFiles": [] 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/build_file_index.txt: -------------------------------------------------------------------------------- 1 | /Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp/CMakeLists.txt -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "0") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "TRUE") 38 | endif() 39 | 40 | # Set default install directory permissions. 41 | if(NOT DEFINED CMAKE_OBJDUMP) 42 | set(CMAKE_OBJDUMP "/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump") 43 | endif() 44 | 45 | if(CMAKE_INSTALL_COMPONENT) 46 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 47 | else() 48 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 49 | endif() 50 | 51 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 52 | "${CMAKE_INSTALL_MANIFEST_FILES}") 53 | file(WRITE "/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a/${CMAKE_INSTALL_MANIFEST}" 54 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 55 | -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/compile_commands.json.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/compile_commands.json.bin -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/configure_fingerprint.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/configure_fingerprint.bin -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/libimgui.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/.cxx/Debug/4lq6t6k1/arm64-v8a/libimgui.a -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/metadata_generation_command.txt: -------------------------------------------------------------------------------- 1 | -H/Users/ligoudan/Desktop/XposedNHook/app/src/main/cpp 2 | -DCMAKE_SYSTEM_NAME=Android 3 | -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 4 | -DCMAKE_SYSTEM_VERSION=24 5 | -DANDROID_PLATFORM=android-24 6 | -DANDROID_ABI=arm64-v8a 7 | -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a 8 | -DANDROID_NDK=/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620 9 | -DCMAKE_ANDROID_NDK=/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620 10 | -DCMAKE_TOOLCHAIN_FILE=/Users/ligoudan/Library/Android/sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake 11 | -DCMAKE_MAKE_PROGRAM=/Users/ligoudan/Library/Android/sdk/cmake/3.22.1/bin/ninja 12 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/ligoudan/Desktop/XposedNHook/app/build/intermediates/cxx/Debug/4lq6t6k1/obj/arm64-v8a 13 | -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/ligoudan/Desktop/XposedNHook/app/build/intermediates/cxx/Debug/4lq6t6k1/obj/arm64-v8a 14 | -DCMAKE_BUILD_TYPE=Debug 15 | -B/Users/ligoudan/Desktop/XposedNHook/app/.cxx/Debug/4lq6t6k1/arm64-v8a 16 | -GNinja 17 | Build command args: [] 18 | Version: 2 -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/prefab_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled": false, 3 | "packages": [] 4 | } -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/arm64-v8a/symbol_folder_index.txt: -------------------------------------------------------------------------------- 1 | /Users/ligoudan/Desktop/XposedNHook/app/build/intermediates/cxx/Debug/4lq6t6k1/obj/arm64-v8a -------------------------------------------------------------------------------- /app/.cxx/Debug/4lq6t6k1/hash_key.txt: -------------------------------------------------------------------------------- 1 | # Values used to calculate the hash in this folder name. 2 | # Should not depend on the absolute path of the project itself. 3 | # - AGP: 7.4.2. 4 | # - $NDK is the path to NDK 23.1.7779620. 5 | # - $PROJECT is the path to the parent folder of the root Gradle build file. 6 | # - $ABI is the ABI to be built with. The specific value doesn't contribute to the value of the hash. 7 | # - $HASH is the hash value computed from this text. 8 | # - $CMAKE is the path to CMake 3.22.1. 9 | # - $NINJA is the path to Ninja. 10 | -H$PROJECT/app/src/main/cpp 11 | -DCMAKE_SYSTEM_NAME=Android 12 | -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 13 | -DCMAKE_SYSTEM_VERSION=24 14 | -DANDROID_PLATFORM=android-24 15 | -DANDROID_ABI=$ABI 16 | -DCMAKE_ANDROID_ARCH_ABI=$ABI 17 | -DANDROID_NDK=$NDK 18 | -DCMAKE_ANDROID_NDK=$NDK 19 | -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake 20 | -DCMAKE_MAKE_PROGRAM=$NINJA 21 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$PROJECT/app/build/intermediates/cxx/Debug/$HASH/obj/$ABI 22 | -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$PROJECT/app/build/intermediates/cxx/Debug/$HASH/obj/$ABI 23 | -DCMAKE_BUILD_TYPE=Debug 24 | -B$PROJECT/app/.cxx/Debug/$HASH/$ABI 25 | -GNinja -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.androidApplication) 3 | } 4 | 5 | android { 6 | namespace 'cn.mrack.xposed.nhook' 7 | compileSdk 34 8 | 9 | defaultConfig { 10 | applicationId "cn.mrack.xposed.nhook" 11 | minSdk 24 12 | targetSdk 34 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | 18 | ndk { 19 | abiFilters 'arm64-v8a' 20 | } 21 | 22 | // externalNativeBuild { 23 | // cmake { 24 | // cppFlags "-std=c++17 -fvisibility=hidden -fvisibility-inlines-hidden -mllvm -sobf -mllvm -sub -mllvm -sub_loop=2 -mllvm -icall -mllvm -ibr -mllvm -igv" 25 | // } 26 | // } 27 | // ndkVersion "26.1.10909125" 28 | 29 | } 30 | 31 | buildTypes { 32 | release { 33 | minifyEnabled true 34 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 35 | } 36 | } 37 | compileOptions { 38 | sourceCompatibility JavaVersion.VERSION_1_8 39 | targetCompatibility JavaVersion.VERSION_1_8 40 | } 41 | externalNativeBuild { 42 | cmake { 43 | path file('src/main/cpp/CMakeLists.txt') 44 | version '3.22.1' 45 | } 46 | } 47 | 48 | 49 | buildFeatures { 50 | buildConfig = true 51 | } 52 | packagingOptions { 53 | jniLibs { 54 | useLegacyPackaging true 55 | } 56 | } 57 | ndkVersion '26.3.11579264' 58 | 59 | // project.tasks.whenTaskAdded { task -> 60 | // if (task.name == 'stripDebugDebugSymbols') { 61 | // task.finalizedBy dealAfterMergeDebugNativeLibs 62 | // } 63 | // if (task.name == 'stripReleaseDebugSymbols') { 64 | // task.finalizedBy dealAfterMergeReleaseNativeLibs 65 | // } 66 | // } 67 | 68 | // 69 | // task dealAfterMergeReleaseNativeLibs() { 70 | // doLast { 71 | // var arch = ["arm64", "v7a"] 72 | // var version = "release" 73 | // generate(version, arch) 74 | // } 75 | // } 76 | // 77 | // task dealAfterMergeDebugNativeLibs() { 78 | // doLast { 79 | // var arch = ["arm64", "v7a"] 80 | // var version = "debug" 81 | // generate(version, arch) 82 | // } 83 | // } 84 | 85 | } 86 | 87 | 88 | dependencies { 89 | compileOnly 'de.robv.android.xposed:api:82' 90 | } 91 | 92 | 93 | //def generate(version, archs) { 94 | // def MERGED_NATIVE_LIBS_PATH = "$buildDir/intermediates/stripped_native_libs" 95 | // var fileList = fileTree("$MERGED_NATIVE_LIBS_PATH/$version").matching { 96 | // include '**/lib*.so' 97 | // }.collect() 98 | // var length = 32000 99 | // for (final def data in fileList) { 100 | // for (arch in archs) { 101 | // if (data.path.contains("$arch")) { 102 | // byte[] fileBytes = data.bytes 103 | // if (fileBytes == "placeholder".bytes) { 104 | // continue 105 | // } 106 | // data.bytes = "placeholder".bytes 107 | // delete file("src/main/java/cn/mrack/so/$arch") 108 | // file("src/main/java/cn/mrack/so/$arch").mkdirs() 109 | // int i = fileBytes.length / length 110 | // String totalText = ""; 111 | // for (int j = 0; j < i; j++) { 112 | // byte[] temp = new byte[length]; 113 | // System.arraycopy(fileBytes, j * length, temp, 0, length); 114 | // // hex 115 | // file("src/main/java/cn/mrack/so/$arch/SoData${j}.java").text = "package cn.mrack.so.$arch;\n" + 116 | // "public class SoData$j {\n" + 117 | // " protected static String data${j} = \"" + temp.collect { String.format("%02X", it) }.join("") + "\";\n" + 118 | // "}"; 119 | // totalText += "SoData${j}.data${j} + "; 120 | // } 121 | // byte[] temp = new byte[fileBytes.length - i * length]; 122 | // System.arraycopy(fileBytes, i * length, temp, 0, fileBytes.length - i * length); 123 | // file("src/main/java/cn/mrack/so/$arch/SoData${i}.java").text = "package cn.mrack.so.$arch;\n" + 124 | // "public class SoData${i} {\n" + 125 | // " protected static String data${i} = \"" + temp.collect { String.format("%02X", it) }.join("") + "\";\n" + 126 | // "}"; 127 | // totalText += "SoData${i}.data${i}"; 128 | // 129 | // file("src/main/java/cn/mrack/so/$arch/SoData.java").text = "package cn.mrack.so.$arch;\n" + 130 | // "public class SoData {\n" + 131 | // " public static byte[] data = hexToBytes(" + totalText + ");\n" + 132 | // " public static String md5 = \"${fileBytes.md5().toLowerCase()}\";\n" + 133 | // " public static byte[] hexToBytes(String hex) {\n" + 134 | // " byte[] bytes = new byte[hex.length() / 2];\n" + 135 | // " for (int i = 0; i < hex.length(); i += 2) {\n" + 136 | // " bytes[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i + 1), 16));\n" + 137 | // " }\n" + 138 | // " return bytes;\n" + 139 | // " }\n" + 140 | // "}"; 141 | // 142 | // } 143 | // } 144 | // 145 | // } 146 | //} -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class cn.mrack.xposed.nhook.NHook 24 | -keepclasseswithmembers class cn.mrack.so.*.SoData 25 | -keepclasseswithmembers class cn.mrack.xposed.nhook.MainHook 26 | -keep class cn.mrack.xposed.nhook.SettingsActivity { 27 | isModuleActive(); 28 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 14 | 17 | 20 | 21 | 24 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | cn.mrack.xposed.nhook.MainHook -------------------------------------------------------------------------------- /app/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html. 3 | # For more examples on how to use CMake, see https://github.com/android/ndk-samples. 4 | 5 | # Sets the minimum CMake version required for this project. 6 | cmake_minimum_required(VERSION 3.22.1) 7 | 8 | # Declares the project name. The project name can be accessed via ${ PROJECT_NAME}, 9 | # Since this is the top level CMakeLists.txt, the project name is also accessible 10 | # with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level 11 | # build script scope). 12 | project("nhook") 13 | 14 | set(CMAKE_CXX_STANDARD 20) 15 | 16 | 17 | set(LINKER_FLAGS "-ffixed-x18 -Wl,--hash-style=both") 18 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format -fdata-sections -ffunction-sections -fvisibility=hidden -Wl,--exclude-libs,ALL") 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti -fvisibility=hidden -Wl,--exclude-libs,ALL") 20 | 21 | include_directories(.) 22 | 23 | find_library(egl EGL) 24 | find_library(GLESV2_LIB GLESv2) 25 | find_library(android android) 26 | add_library(local_dobby STATIC IMPORTED) 27 | add_library(local_qbdi STATIC IMPORTED) 28 | 29 | set_target_properties(local_dobby PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI}/libdobby.a) 30 | set_target_properties(local_qbdi PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI}/libQBDI.a) 31 | 32 | include_directories(imgui) 33 | 34 | add_library(${CMAKE_PROJECT_NAME} SHARED 35 | # List C/C++ source files with relative paths to this CMakeLists.txt. 36 | nhook.cpp 37 | linker_hook.cpp 38 | vm.cpp 39 | utils.cpp 40 | 41 | #demo 42 | demo/qbdihook.cpp 43 | demo/modmenu.cpp 44 | demo/ytbssl.cpp 45 | demo/modmenu_native.cpp 46 | demo/il2cpp_dumper.cpp 47 | demo/md5.cpp 48 | demo/sha1.hpp 49 | ) 50 | 51 | 52 | 53 | include_directories(./imgui) 54 | 55 | add_library(imgui STATIC 56 | imgui/imgui.cpp 57 | imgui/imgui_draw.cpp 58 | imgui/imgui_tables.cpp 59 | imgui/imgui_widgets.cpp 60 | imgui/backends/imgui_impl_android.cpp 61 | imgui/backends/imgui_impl_opengl3.cpp) 62 | 63 | # Specifies libraries CMake should link to your target library. You 64 | # can link libraries from various origins, such as libraries defined in this 65 | # build script, prebuilt third-party libraries, or Android system libraries. 66 | target_link_libraries(${CMAKE_PROJECT_NAME} 67 | # List libraries link to the target library 68 | android 69 | local_dobby 70 | local_qbdi 71 | EGL 72 | GLESv3 73 | imgui 74 | log) -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_H_ 19 | #define QBDI_H_ 20 | 21 | #ifdef __cplusplus 22 | #include "QBDI/Memory.hpp" 23 | #include "QBDI/VM.h" 24 | #else 25 | #include "QBDI/Memory.h" 26 | #include "QBDI/VM_C.h" 27 | #endif 28 | 29 | #include "QBDI/Logs.h" 30 | #include "QBDI/Version.h" 31 | 32 | #endif // QBDI_H_ 33 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Bitmask.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_BITMASK_H_ 19 | #define QBDI_BITMASK_H_ 20 | 21 | #ifdef __cplusplus 22 | #include 23 | 24 | namespace QBDI { 25 | 26 | template 27 | struct EnableBitMaskOperators { 28 | static const bool enable = false; 29 | }; 30 | 31 | template 32 | typename std::enable_if::enable, Enum>::type 33 | operator|(Enum lhs, Enum rhs) { 34 | using underlying = typename std::underlying_type::type; 35 | return static_cast(static_cast(lhs) | 36 | static_cast(rhs)); 37 | } 38 | 39 | template 40 | typename std::enable_if::enable, Enum>::type & 41 | operator|=(Enum &lhs, Enum rhs) { 42 | using underlying = typename std::underlying_type::type; 43 | lhs = static_cast(static_cast(lhs) | 44 | static_cast(rhs)); 45 | return lhs; 46 | } 47 | 48 | #define _QBDI_ENABLE_BITMASK_OPERATORS(x) \ 49 | template <> \ 50 | struct EnableBitMaskOperators { \ 51 | static const bool enable = true; \ 52 | }; 53 | 54 | } // namespace QBDI 55 | #else 56 | #define _QBDI_ENABLE_BITMASK_OPERATORS(x) 57 | #endif 58 | 59 | #endif // QBDI_BITMASK_H_ 60 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_CONFIG_H_ 19 | #define QBDI_CONFIG_H_ 20 | 21 | /* #undef QBDI_ARCH_ARM */ 22 | #define QBDI_ARCH_AARCH64 1 23 | /* #undef QBDI_ARCH_X86 */ 24 | /* #undef QBDI_ARCH_X86_64 */ 25 | 26 | /* #undef QBDI_PLATFORM_WINDOWS */ 27 | /* #undef QBDI_PLATFORM_LINUX */ 28 | #define QBDI_PLATFORM_ANDROID 1 29 | /* #undef QBDI_PLATFORM_OSX */ 30 | /* #undef QBDI_PLATFORM_IOS */ 31 | 32 | /* #undef QBDI_NOT_AVX_SUPPORT */ 33 | 34 | /* #undef QBDI_BITS_32 */ 35 | #define QBDI_BITS_64 1 36 | 37 | /* #undef QBDI_LOG_DEBUG */ 38 | 39 | /* #undef QBDI_EXPORT_SYM */ 40 | 41 | #ifdef __cplusplus 42 | namespace QBDI { 43 | 44 | static constexpr bool is_android = 1; 45 | static constexpr bool is_linux = 0; 46 | static constexpr bool is_osx = 0; 47 | static constexpr bool is_ios = 0; 48 | static constexpr bool is_windows = 0; 49 | 50 | 51 | static constexpr bool is_arm = 0; 52 | static constexpr bool is_aarch64 = 1; 53 | static constexpr bool is_x86 = 0; 54 | static constexpr bool is_x86_64 = 0; 55 | 56 | static constexpr bool it_bits_32 = 0; 57 | static constexpr bool is_bits_64 = 1; 58 | 59 | static constexpr bool has_debug_log = 0; 60 | } 61 | #endif // __cplusplus 62 | 63 | #endif // QBDI_CONFIG_H_ 64 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_ERRORS_H_ 19 | #define QBDI_ERRORS_H_ 20 | 21 | #include "QBDI/Platform.h" 22 | 23 | #ifdef __cplusplus 24 | namespace QBDI { 25 | #endif 26 | 27 | /*! QBDI Error values 28 | */ 29 | typedef enum { 30 | _QBDI_EI(INVALID_EVENTID) = 0xffffffff, /*!< Mark a returned event id as 31 | * invalid 32 | */ 33 | } VMError; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif // QBDI_ERRORS_H_ 40 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/InstAnalysis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 本文件属于 QBDI 项目的一部分。 3 | * 4 | * 版权所有 2017 - 2023 Quarkslab 5 | * 6 | * 根据 Apache 许可证,版本 2.0(以下简称“许可证”)许可; 7 | * 除非符合许可证,否则您不得使用此文件。 8 | * 您可以从以下地址获得许可证副本: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * 除非适用法律要求或书面同意,根据许可证分发的软件按“原样”分发, 13 | * 无任何明示或暗示的担保或条件。 14 | * 有关许可证下许可的特定语言的详细信息,请参阅许可证。 15 | */ 16 | #ifndef QBDI_INSTANALYSIS_H_ 17 | #define QBDI_INSTANALYSIS_H_ 18 | 19 | #include 20 | 21 | #include "QBDI/Bitmask.h" 22 | #include "QBDI/Platform.h" 23 | #include "QBDI/State.h" 24 | 25 | #ifdef __cplusplus 26 | namespace QBDI { 27 | #endif 28 | 29 | /*! 寄存器操作类型(读取/写入/读写) */ 30 | typedef enum { 31 | _QBDI_EI(REGISTER_UNUSED) = 0, /*!< 未使用寄存器 */ 32 | _QBDI_EI(REGISTER_READ) = 1, /*!< 寄存器读取操作 */ 33 | _QBDI_EI(REGISTER_WRITE) = 1 << 1, /*!< 寄存器写入操作 */ 34 | _QBDI_EI(REGISTER_READ_WRITE) = 3, /*!< 寄存器读写操作 */ 35 | } RegisterAccessType; 36 | 37 | _QBDI_ENABLE_BITMASK_OPERATORS(RegisterAccessType) 38 | 39 | /*! 指令条件 */ 40 | typedef enum { 41 | _QBDI_EI(CONDITION_NONE) = 0x0, /*!< 指令无条件 */ 42 | // ConditionType ^ 0x1 反转条件,除 CONDITION_NONE 外 43 | _QBDI_EI(CONDITION_ALWAYS) = 0x2, /*!< 指令始终为真 */ 44 | _QBDI_EI(CONDITION_NEVER) = 0x3, /*!< 指令始终为假 */ 45 | _QBDI_EI(CONDITION_EQUALS) = 0x4, /*!< 等于 ('==') */ 46 | _QBDI_EI(CONDITION_NOT_EQUALS) = 0x5, /*!< 不等于 ('!=') */ 47 | _QBDI_EI(CONDITION_ABOVE) = 0x6, /*!< 大于(无符号 '>') */ 48 | _QBDI_EI(CONDITION_BELOW_EQUALS) = 0x7, /*!< 小于等于(无符号 '<=') */ 49 | _QBDI_EI(CONDITION_ABOVE_EQUALS) = 0x8, /*!< 大于等于(无符号 '>=') */ 50 | _QBDI_EI(CONDITION_BELOW) = 0x9, /*!< 小于(无符号 '<') */ 51 | _QBDI_EI(CONDITION_GREAT) = 0xa, /*!< 大于(有符号 '>') */ 52 | _QBDI_EI(CONDITION_LESS_EQUALS) = 0xb, /*!< 小于等于(有符号 '<=') */ 53 | _QBDI_EI(CONDITION_GREAT_EQUALS) = 0xc, /*!< 大于等于(有符号 '>=') */ 54 | _QBDI_EI(CONDITION_LESS) = 0xd, /*!< 小于(有符号 '<') */ 55 | _QBDI_EI(CONDITION_EVEN) = 0xe, /*!< 偶数 */ 56 | _QBDI_EI(CONDITION_ODD) = 0xf, /*!< 奇数 */ 57 | _QBDI_EI(CONDITION_OVERFLOW) = 0x10, /*!< 溢出 */ 58 | _QBDI_EI(CONDITION_NOT_OVERFLOW) = 0x11, /*!< 无溢出 */ 59 | _QBDI_EI(CONDITION_SIGN) = 0x12, /*!< 符号 */ 60 | _QBDI_EI(CONDITION_NOT_SIGN) = 0x13, /*!< 无符号 */ 61 | } ConditionType; 62 | 63 | /*! 操作数类型 */ 64 | typedef enum { 65 | _QBDI_EI(OPERAND_INVALID) = 0, /*!< 无效操作数 */ 66 | _QBDI_EI(OPERAND_IMM), /*!< 立即数操作数 */ 67 | _QBDI_EI(OPERAND_GPR), /*!< 寄存器操作数 */ 68 | _QBDI_EI(OPERAND_PRED), /*!< 谓词操作数 */ 69 | _QBDI_EI(OPERAND_FPR), /*!< 浮点寄存器操作数 */ 70 | _QBDI_EI(OPERAND_SEG), /*!< 段寄存器或不支持的寄存器操作数 */ 71 | } OperandType; 72 | 73 | typedef enum { 74 | _QBDI_EI(OPERANDFLAG_NONE) = 0, /*!< 无标志 */ 75 | _QBDI_EI(OPERANDFLAG_ADDR) = 1 << 0, /*!< 操作数用于计算地址 */ 76 | _QBDI_EI(OPERANDFLAG_PCREL) = 1 << 1, /*!< 操作数值相对 PC */ 77 | _QBDI_EI(OPERANDFLAG_UNDEFINED_EFFECT) = 1 << 2, /*!< 操作数角色未完全定义 */ 78 | _QBDI_EI(OPERANDFLAG_IMPLICIT) = 1 << 3, /*!< 操作数是隐式的 */ 79 | } OperandFlag; 80 | 81 | _QBDI_ENABLE_BITMASK_OPERATORS(OperandFlag) 82 | 83 | /*! 包含 VM 提供的操作数分析结果的结构体 */ 84 | typedef struct { 85 | // 通用字段 86 | OperandType type; /*!< 操作数类型 */ 87 | OperandFlag flag; /*!< 操作数标志 */ 88 | sword value; /*!< 操作数值(如果为立即数),或寄存器 ID */ 89 | uint8_t size; /*!< 操作数大小(以字节为单位) */ 90 | // 寄存器特定字段 91 | uint8_t regOff; /*!< 子寄存器在寄存器中的偏移(以位为单位) */ 92 | int16_t regCtxIdx; /*!< VM 状态中的寄存器索引(如果未知则小于 0) */ 93 | const char *regName; /*!< 寄存器名称 */ 94 | RegisterAccessType regAccess; /*!< 寄存器访问类型(读取、写入、读写) */ 95 | } OperandAnalysis; 96 | 97 | /*! 指令分析类型 */ 98 | typedef enum { 99 | _QBDI_EI(ANALYSIS_INSTRUCTION) = 1, /*!< 指令分析(地址、助记符等) */ 100 | _QBDI_EI(ANALYSIS_DISASSEMBLY) = 1 << 1, /*!< 指令反汇编 */ 101 | _QBDI_EI(ANALYSIS_OPERANDS) = 1 << 2, /*!< 指令操作数分析 */ 102 | _QBDI_EI(ANALYSIS_SYMBOL) = 1 << 3, /*!< 指令符号 */ 103 | } AnalysisType; 104 | 105 | _QBDI_ENABLE_BITMASK_OPERATORS(AnalysisType) 106 | 107 | /*! 包含 VM 提供的指令分析结果的结构体 */ 108 | typedef struct { 109 | // ANALYSIS_INSTRUCTION 110 | const char *mnemonic; /*!< LLVM 助记符 111 | * (注意:如果未使用 ANALYSIS_INSTRUCTION,则为 NULL) 112 | */ 113 | rword address; /*!< 指令地址 */ 114 | uint32_t instSize; /*!< 指令大小(以字节为单位) */ 115 | CPUMode cpuMode; /*!< 指令 CPU 模式 */ 116 | bool affectControlFlow; /*!< 如果指令影响控制流,则为 true */ 117 | bool isBranch; /*!< 如果指令像“跳转”一样,则为 true */ 118 | bool isCall; /*!< 如果指令像“调用”一样,则为 true */ 119 | bool isReturn; /*!< 如果指令像“返回”一样,则为 true */ 120 | bool isCompare; /*!< 如果指令是比较指令,则为 true */ 121 | bool isPredicable; /*!< 如果指令包含谓词(即条件),则为 true */ 122 | bool isMoveImm; /*!< 如果此指令是立即数移动(包括条件移动),则为 true */ 123 | bool mayLoad; /*!< 如果 QBDI 检测到此指令为加载指令,则为 true */ 124 | bool mayStore; /*!< 如果 QBDI 检测到此指令为存储指令,则为 true */ 125 | uint32_t loadSize; /*!< 预期读取访问的大小, 126 | * 如果无法确定大小,则 mayLoad 可能为 true 且值为 0 127 | */ 128 | uint32_t storeSize; /*!< 预期写入访问的大小, 129 | * 如果无法确定大小,则 mayStore 可能为 true 且值为 0 130 | */ 131 | ConditionType condition; /*!< 与指令关联的条件 */ 132 | bool mayLoad_LLVM; /*!< 0.7.1 版本中的 mayLoad */ 133 | bool mayStore_LLVM; /*!< 0.7.1 版本中的 mayStore */ 134 | // ANALYSIS_DISASSEMBLY 135 | char *disassembly; /*!< 指令反汇编 136 | * (注意:如果未使用 ANALYSIS_DISASSEMBLY,则为 NULL) 137 | */ 138 | // ANALYSIS_OPERANDS 139 | RegisterAccessType flagsAccess; /*!< 标志访问类型(无访问、读取、写入、读写) 140 | * (注意:如果未使用 ANALYSIS_OPERANDS,则为 REGISTER_UNUSED) 141 | */ 142 | uint8_t numOperands; /*!< 指令使用的操作数数量 */ 143 | OperandAnalysis *operands; /*!< 包含 VM 提供的操作数分析结果的结构体 144 | * (注意:如果未使用 ANALYSIS_OPERANDS,则为 NULL) 145 | */ 146 | // ANALYSIS_SYMBOL 147 | const char *symbol; /*!< 指令符号 148 | * (注意:如果未使用 ANALYSIS_SYMBOL 或未找到符号,则为 NULL) 149 | */ 150 | uint32_t symbolOffset; /*!< 指令符号偏移 */ 151 | const char *module; /*!< 指令模块名称 152 | * (注意:如果未使用 ANALYSIS_SYMBOL 或未找到模块,则为 NULL) 153 | */ 154 | // INTERNAL 155 | uint32_t analysisType; /*!< 内部:指令分析类型 156 | * (不建议使用) 157 | */ 158 | } InstAnalysis; 159 | 160 | #ifdef __cplusplus 161 | } 162 | #endif 163 | 164 | #endif // QBDI_INSTANALYSIS_H_ 165 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Logs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_LOGS_H_ 19 | #define QBDI_LOGS_H_ 20 | 21 | #include 22 | #include "QBDI/Platform.h" 23 | 24 | #ifdef __cplusplus 25 | #include 26 | #endif 27 | 28 | #ifdef __cplusplus 29 | namespace QBDI { 30 | extern "C" { 31 | #endif 32 | 33 | /*! Each log has a priority (or level) which can be used to control verbosity. 34 | * In production builds, only Warning and Error logs are kept. 35 | */ 36 | typedef enum { 37 | _QBDI_EI(DEBUG) = 0, /*!< Debug logs */ 38 | _QBDI_EI(INFO), /*!< Info logs (default) */ 39 | _QBDI_EI(WARNING), /*!< Warning logs */ 40 | _QBDI_EI(ERROR), /*!< Error logs */ 41 | _QBDI_EI(DISABLE) = 0xff, /*!< Disable logs message */ 42 | } LogPriority; 43 | 44 | /*! Redirect logs to a file. 45 | * 46 | * @param[in] filename the path of the file to append the log 47 | * @param[in] truncate Set to true to clear the file before append the log 48 | */ 49 | QBDI_EXPORT void qbdi_setLogFile(const char *filename, bool truncate); 50 | 51 | /*! Write log to the console (stderr) 52 | */ 53 | QBDI_EXPORT void qbdi_setLogConsole(); 54 | 55 | /*! Write log to the default location (stderr for linux, android_logger for 56 | * android) 57 | */ 58 | QBDI_EXPORT void qbdi_setLogDefault(); 59 | 60 | /*! Enable logs matching priority. 61 | * 62 | * @param[in] priority Filter logs with greater or equal priority. 63 | */ 64 | QBDI_EXPORT void qbdi_setLogPriority(LogPriority priority); 65 | 66 | #ifdef __cplusplus 67 | 68 | /* 69 | * C API C++ bindings 70 | */ 71 | 72 | /*! Redirect logs to a file. 73 | * 74 | * @param[in] filename the path of the file to append the log 75 | * @param[in] truncate Set to true to clear the file before append the log 76 | */ 77 | QBDI_EXPORT void setLogFile(const std::string &filename, bool truncate = false); 78 | 79 | /*! Enable logs matching priority. 80 | * 81 | * @param[in] priority Filter logs with greater or equal priority. 82 | */ 83 | inline void setLogPriority(LogPriority priority = LogPriority::INFO) { 84 | return qbdi_setLogPriority(priority); 85 | } 86 | 87 | /*! Write log to the console (stderr) 88 | */ 89 | inline void setLogConsole() { return qbdi_setLogConsole(); } 90 | 91 | /*! Write log to the default location (stderr for linux, android_logger for 92 | * android) 93 | */ 94 | inline void setLogDefault() { return qbdi_setLogDefault(); } 95 | 96 | } // "C" 97 | 98 | } // QBDI:: 99 | #endif 100 | 101 | #endif // QBDI_LOGS_H_ 102 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_MEMORY_H_ 19 | #define QBDI_MEMORY_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "QBDI/Platform.h" 26 | #include "QBDI/State.h" 27 | 28 | #ifdef __cplusplus 29 | namespace QBDI { 30 | extern "C" { 31 | #endif 32 | 33 | /*! Memory access rights. 34 | */ 35 | typedef enum { 36 | QBDI_PF_NONE = 0, /*!< No access */ 37 | QBDI_PF_READ = 1, /*!< Read access */ 38 | QBDI_PF_WRITE = 2, /*!< Write access */ 39 | QBDI_PF_EXEC = 4 /*!< Execution access */ 40 | } qbdi_Permission; 41 | 42 | /*! Map of a memory area (region). 43 | */ 44 | typedef struct { 45 | rword start; /*!< Range start value. */ 46 | rword end; /*!< Range end value (always excluded). */ 47 | qbdi_Permission permission; /*!< Region access rights 48 | * (PF_READ, PF_WRITE, PF_EXEC). 49 | */ 50 | char *name; /*!< Region name or path (useful when a region 51 | * is mapping a module). 52 | */ 53 | } qbdi_MemoryMap; 54 | 55 | /*! Get a list of all the memory maps (regions) of a process. 56 | * 57 | * @param[in] pid The identifier of the process. 58 | * @param[in] full_path Return the full path of the module in name field 59 | * @param[out] size Will be set to the number of strings in the returned array. 60 | * 61 | * @return An array of MemoryMap object. 62 | */ 63 | QBDI_EXPORT qbdi_MemoryMap *qbdi_getRemoteProcessMaps(rword pid, bool full_path, 64 | size_t *size); 65 | 66 | /*! Get a list of all the memory maps (regions) of the current process. 67 | * 68 | * @param[in] full_path Return the full path of the module in name field 69 | * @param[out] size Will be set to the number of strings in the returned array. 70 | * 71 | * @return An array of MemoryMap object. 72 | */ 73 | QBDI_EXPORT qbdi_MemoryMap *qbdi_getCurrentProcessMaps(bool full_path, 74 | size_t *size); 75 | 76 | /*! Free an array of memory maps objects. 77 | * 78 | * @param[in] arr An array of MemoryMap object. 79 | * @param[in] size Number of elements in the array. 80 | */ 81 | QBDI_EXPORT void qbdi_freeMemoryMapArray(qbdi_MemoryMap *arr, size_t size); 82 | 83 | /*! Get a list of all the module names loaded in the process memory. 84 | * If no modules are found, size is set to 0 and this function returns NULL. 85 | * 86 | * @param[out] size Will be set to the number of strings in the returned 87 | * array. 88 | * 89 | * @return An array of C strings, each one containing the name of a loaded 90 | * module. This array needs to be free'd by the caller by repetively 91 | * calling free() on each of its element then finally on the array 92 | * itself. 93 | */ 94 | QBDI_EXPORT char **qbdi_getModuleNames(size_t *size); 95 | 96 | /*! Allocate a block of memory of a specified sized with an aligned base 97 | * address. 98 | * 99 | * @param[in] size Allocation size in bytes. 100 | * @param[in] align Base address alignement in bytes. 101 | * 102 | * @return Pointer to the allocated memory or NULL in case an error was 103 | * encountered. 104 | * 105 | */ 106 | QBDI_EXPORT void *qbdi_alignedAlloc(size_t size, size_t align); 107 | 108 | /*! Free a block of aligned memory allocated with alignedAlloc. 109 | * 110 | * @param[in] ptr Pointer to the allocated memory. 111 | * 112 | */ 113 | QBDI_EXPORT void qbdi_alignedFree(void *ptr); 114 | 115 | /*! Allocate a new stack and setup the GPRState accordingly. 116 | * The allocated stack needs to be freed with alignedFree(). 117 | * 118 | * @param[in] ctx GPRState which will be setup to use the new stack. 119 | * @param[in] stackSize Size of the stack to be allocated. 120 | * @param[out] stack The newly allocated stack pointer will be returned 121 | * in the variable pointed by stack. 122 | * 123 | * @return True if stack allocation was successfull. 124 | */ 125 | QBDI_EXPORT bool qbdi_allocateVirtualStack(GPRState *ctx, uint32_t stackSize, 126 | uint8_t **stack); 127 | 128 | /*! Simulate a call by modifying the stack and registers accordingly. 129 | * 130 | * @param[in] ctx GPRState where the simulated call will be setup. 131 | * The state needs to point to a valid stack for 132 | * example setup with allocateVirtualStack(). 133 | * @param[in] returnAddress Return address of the call to simulate. 134 | * @param[in] argNum The number of arguments in the variadic list. 135 | * @param[in] ... A variadic list of arguments. 136 | */ 137 | QBDI_EXPORT void qbdi_simulateCall(GPRState *ctx, rword returnAddress, 138 | uint32_t argNum, ...); 139 | 140 | /*! Simulate a call by modifying the stack and registers accordingly 141 | * (stdarg version). 142 | * 143 | * @param[in] ctx GPRState where the simulated call will be setup. 144 | * The state needs to point to a valid stack 145 | * for example setup with allocateVirtualStack(). 146 | * @param[in] returnAddress Return address of the call to simulate. 147 | * @param[in] argNum The number of arguments in the va_list object. 148 | * @param[in] ap An stdarg va_list object. 149 | */ 150 | QBDI_EXPORT void qbdi_simulateCallV(GPRState *ctx, rword returnAddress, 151 | uint32_t argNum, va_list ap); 152 | 153 | /*! Simulate a call by modifying the stack and registers accordingly 154 | * (C array version). 155 | * 156 | * @param[in] ctx GPRState where the simulated call will be setup. 157 | * The state needs to point to a valid stack for 158 | * example setup with allocateVirtualStack(). 159 | * @param[in] returnAddress Return address of the call to simulate. 160 | * @param[in] argNum The number of arguments in the array args. 161 | * @param[in] args An array or arguments. 162 | */ 163 | QBDI_EXPORT void qbdi_simulateCallA(GPRState *ctx, rword returnAddress, 164 | uint32_t argNum, const rword *args); 165 | 166 | #ifdef __cplusplus 167 | } 168 | } 169 | #endif 170 | 171 | #endif // QBDI_MEMORY_H_ 172 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Options.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_OPTION_AARCH64_H_ 19 | #define QBDI_OPTION_AARCH64_H_ 20 | 21 | #include 22 | 23 | #include "QBDI/Bitmask.h" 24 | #include "QBDI/Platform.h" 25 | 26 | #ifdef __cplusplus 27 | namespace QBDI { 28 | #endif 29 | 30 | typedef enum { 31 | _QBDI_EI(NO_OPT) = 0, /*!< Default value */ 32 | // general options between 0 and 23 33 | _QBDI_EI(OPT_DISABLE_FPR) = 1 << 0, /*!< Disable all operation on FPU 34 | * (SSE, AVX, SIMD). May break 35 | * the execution if the target 36 | * use the FPU 37 | */ 38 | _QBDI_EI(OPT_DISABLE_OPTIONAL_FPR) = 1 << 1, /*!< Disable context switch 39 | * optimisation when the target 40 | * execblock doesn't used FPR 41 | */ 42 | // architecture specific option between 24 and 31 43 | _QBDI_EI(OPT_DISABLE_LOCAL_MONITOR) = 44 | 1 << 24, /*!< Disable the local monitor for instruction like stxr */ 45 | _QBDI_EI(OPT_BYPASS_PAUTH) = 1 << 25, /*!< Disable pointeur authentication */ 46 | _QBDI_EI(OPT_ENABLE_BTI) = 1 << 26, /*!< Enable BTI on instrumented code*/ 47 | } Options; 48 | 49 | _QBDI_ENABLE_BITMASK_OPERATORS(Options) 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* QBDI_OPTION_AARCH64_H_ */ 56 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_PLATFORM_H_ 19 | #define QBDI_PLATFORM_H_ 20 | 21 | #include "QBDI/Config.h" 22 | 23 | #ifdef QBDI_PLATFORM_WINDOWS 24 | #define QBDI_ALIGNED(n) __declspec(align(n)) 25 | #define QBDI_NOINLINE __declspec(noinline) 26 | #define QBDI_NOSTACKPROTECTOR 27 | #define _QBDI_FORCE_USE 28 | #define _QBDI_UNREACHABLE() __assume(0) 29 | #define QBDI_DISABLE_ASAN __declspec(no_sanitize_address) 30 | #define QBDI_FORCE_EXPORT __declspec(dllexport) 31 | #else 32 | #define QBDI_ALIGNED(n) __attribute__((aligned(n))) 33 | #define QBDI_NOINLINE __attribute__((noinline)) 34 | #define QBDI_NOSTACKPROTECTOR __attribute__((no_stack_protector)) 35 | #define _QBDI_FORCE_USE __attribute__((__used__)) 36 | #define _QBDI_UNREACHABLE() __builtin_unreachable() 37 | #define QBDI_DISABLE_ASAN __attribute__((no_sanitize_address)) 38 | #define QBDI_FORCE_EXPORT __attribute__((visibility("default"))) 39 | #endif 40 | 41 | #ifdef QBDI_EXPORT_SYM 42 | #define QBDI_EXPORT QBDI_FORCE_EXPORT 43 | #else 44 | #define QBDI_EXPORT 45 | #endif 46 | 47 | #if defined(__has_feature) 48 | #if __has_feature(address_sanitizer) 49 | #define _QBDI_ASAN_ENABLED_ 50 | #endif 51 | #endif 52 | 53 | #ifdef __cplusplus 54 | #define _QBDI_EI(X) X 55 | #else 56 | #define _QBDI_EI(X) QBDI_##X 57 | #endif 58 | 59 | #endif // QBDI_PLATFORM_H_ 60 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/State.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_STATE_AARCH64_H_ 19 | #define QBDI_STATE_AARCH64_H_ 20 | 21 | #ifdef __cplusplus 22 | #include 23 | #endif 24 | #include 25 | #include 26 | #include "QBDI/Platform.h" 27 | 28 | // ============================================================================ 29 | // AARCH64 Context 30 | // ============================================================================ 31 | 32 | #define PRIRWORD PRIx64 33 | 34 | #define QBDI_NUM_FPR 32 35 | 36 | #ifdef __cplusplus 37 | namespace QBDI { 38 | #endif // __cplusplus 39 | 40 | /*! ARM CPU modes. 41 | */ 42 | typedef enum { AARCH64 = 0, DEFAULT = 0, COUNT } CPUMode; 43 | 44 | typedef uint64_t rword; 45 | typedef int64_t sword; 46 | 47 | // SPHINX_AARCH64_FPRSTATE_BEGIN 48 | /*! ARM Floating Point Register context. 49 | */ 50 | typedef struct QBDI_ALIGNED(8) { 51 | __uint128_t v0; 52 | __uint128_t v1; 53 | __uint128_t v2; 54 | __uint128_t v3; 55 | 56 | __uint128_t v4; 57 | __uint128_t v5; 58 | __uint128_t v6; 59 | __uint128_t v7; 60 | 61 | __uint128_t v8; 62 | __uint128_t v9; 63 | __uint128_t v10; 64 | __uint128_t v11; 65 | 66 | __uint128_t v12; 67 | __uint128_t v13; 68 | __uint128_t v14; 69 | __uint128_t v15; 70 | 71 | __uint128_t v16; 72 | __uint128_t v17; 73 | __uint128_t v18; 74 | __uint128_t v19; 75 | 76 | __uint128_t v20; 77 | __uint128_t v21; 78 | __uint128_t v22; 79 | __uint128_t v23; 80 | 81 | __uint128_t v24; 82 | __uint128_t v25; 83 | __uint128_t v26; 84 | __uint128_t v27; 85 | 86 | __uint128_t v28; 87 | __uint128_t v29; 88 | __uint128_t v30; 89 | __uint128_t v31; 90 | 91 | rword fpcr; 92 | rword fpsr; 93 | } FPRState; 94 | // SPHINX_AARCH64_FPRSTATE_END 95 | 96 | // SPHINX_AARCH64_GPRSTATE_BEGIN 97 | /*! ARM General Purpose Register context. 98 | */ 99 | typedef struct QBDI_ALIGNED(8) { 100 | rword x0; 101 | rword x1; 102 | rword x2; 103 | rword x3; 104 | rword x4; 105 | rword x5; 106 | rword x6; 107 | rword x7; 108 | rword x8; 109 | rword x9; 110 | rword x10; 111 | rword x11; 112 | rword x12; 113 | rword x13; 114 | rword x14; 115 | rword x15; 116 | rword x16; 117 | rword x17; 118 | rword x18; 119 | rword x19; 120 | rword x20; 121 | rword x21; 122 | rword x22; 123 | rword x23; 124 | rword x24; 125 | rword x25; 126 | rword x26; 127 | rword x27; 128 | rword x28; 129 | rword x29; // FP (x29) 130 | rword lr; // LR (x30) 131 | 132 | rword sp; 133 | rword nzcv; 134 | rword pc; 135 | // ? rword daif; ? 136 | 137 | /* Internal CPU state 138 | * Local monitor state for exclusive load/store instruction 139 | */ 140 | struct { 141 | rword addr; 142 | rword enable; /* 0=>disable, 1=>exclusive state, use a rword to not break 143 | align */ 144 | } localMonitor; 145 | 146 | } GPRState; 147 | // SPHINX_AARCH64_GPRSTATE_END 148 | 149 | static const char *const GPR_NAMES[] = { 150 | "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8", "X9", 151 | "X10", "X11", "X12", "X13", "X14", "X15", "X16", "X17", "X18", "X19", 152 | "X20", "X21", "X22", "X23", "X24", "X25", "X26", "X27", "X28", 153 | "X29", // FP 154 | "LR", 155 | 156 | "SP", "NZCV", "PC", 157 | }; 158 | 159 | static const unsigned int NUM_GPR = 32; 160 | static const unsigned int AVAILABLE_GPR = 28; 161 | static const unsigned int REG_RETURN = 0; 162 | static const unsigned int REG_BP = 29; 163 | static const unsigned int REG_LR = 30; 164 | static const unsigned int REG_SP = 31; 165 | static const unsigned int REG_PC = 33; 166 | static const unsigned int REG_FLAG = 32; 167 | 168 | #ifdef __cplusplus 169 | #define QBDI_GPR_GET(state, i) (reinterpret_cast(state)[i]) 170 | #define QBDI_GPR_SET(state, i, v) \ 171 | (reinterpret_cast(state)[i] = v) 172 | #else 173 | #define QBDI_GPR_GET(state, i) (((rword *)state)[i]) 174 | #define QBDI_GPR_SET(state, i, v) (((rword *)state)[i] = v) 175 | #endif 176 | 177 | #ifdef __cplusplus 178 | } // namespace QBDI 179 | #endif // __cplusplus 180 | 181 | #endif // QBDI_STATE_AARCH64_H_ 182 | -------------------------------------------------------------------------------- /app/src/main/cpp/QBDI/Version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of QBDI. 3 | * 4 | * Copyright 2017 - 2023 Quarkslab 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | #ifndef QBDI_VERSION_H_ 19 | #define QBDI_VERSION_H_ 20 | 21 | #include 22 | #include "QBDI/Platform.h" 23 | 24 | #ifdef __cplusplus 25 | namespace QBDI { 26 | extern "C" { 27 | #endif 28 | 29 | #define QBDI_VERSION ((0 << 16 ) | \ 30 | (10 << 8 ) | \ 31 | (0 << 0 )) 32 | #define QBDI_VERSION_STRING "0.10.0" 33 | 34 | #define QBDI_VERSION_MAJOR 0 35 | #define QBDI_VERSION_MINOR 10 36 | #define QBDI_VERSION_PATCH 0 37 | #define QBDI_VERSION_DEV 0 38 | 39 | #define QBDI_ARCHITECTURE_STRING "AARCH64" 40 | #define QBDI_PLATFORM_STRING "android" 41 | 42 | /*! Return QBDI version. 43 | * 44 | * @param[out] version QBDI version encoded as an unsigned integer (0xMMmmpp). 45 | * @return QBDI version as a string (major.minor.patch). 46 | */ 47 | QBDI_EXPORT const char* qbdi_getVersion(uint32_t* version); 48 | 49 | #ifdef __cplusplus 50 | /*! Return QBDI version. 51 | * 52 | * @param[out] version QBDI version encoded as an unsigned integer (0xMMmmpp). 53 | * @return QBDI version as a string (major.minor.patch). 54 | */ 55 | inline const char* getVersion(uint32_t* version) { 56 | return qbdi_getVersion(version); 57 | } 58 | 59 | } // "C" 60 | } // QBDI:: 61 | #endif 62 | 63 | #endif // QBDI_VERSION_H_ 64 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/il2cpp-class.h: -------------------------------------------------------------------------------- 1 | #ifndef IL2CPP_CLASS 2 | #define IL2CPP_CLASS 3 | 4 | typedef uint16_t Il2CppChar; 5 | typedef uintptr_t il2cpp_array_size_t; 6 | typedef int32_t TypeDefinitionIndex; 7 | typedef int32_t GenericParameterIndex; 8 | typedef char Il2CppNativeChar; 9 | 10 | typedef struct Il2CppMemoryCallbacks Il2CppMemoryCallbacks; 11 | typedef struct Il2CppImage Il2CppImage; 12 | typedef struct Il2CppClass Il2CppClass; 13 | typedef struct Il2CppArrayBounds Il2CppArrayBounds; 14 | typedef struct Il2CppAssembly Il2CppAssembly; 15 | typedef struct Il2CppArrayType Il2CppArrayType; 16 | typedef struct Il2CppGenericClass Il2CppGenericClass; 17 | typedef struct Il2CppReflectionType Il2CppReflectionType; 18 | typedef struct MonitorData MonitorData; 19 | typedef Il2CppClass Il2CppVTable; 20 | typedef struct EventInfo EventInfo; 21 | typedef struct FieldInfo FieldInfo; 22 | typedef struct PropertyInfo PropertyInfo; 23 | typedef struct Il2CppDomain Il2CppDomain; 24 | typedef struct Il2CppException Il2CppException; 25 | typedef struct Il2CppObject Il2CppObject; 26 | typedef struct Il2CppReflectionMethod Il2CppReflectionMethod; 27 | typedef struct Il2CppString Il2CppString; 28 | typedef struct Il2CppThread Il2CppThread; 29 | typedef struct Il2CppStackFrameInfo Il2CppStackFrameInfo; 30 | typedef struct Il2CppManagedMemorySnapshot Il2CppManagedMemorySnapshot; 31 | typedef struct Il2CppDebuggerTransport Il2CppDebuggerTransport; 32 | typedef struct Il2CppMethodDebugInfo Il2CppMethodDebugInfo; 33 | typedef struct Il2CppCustomAttrInfo Il2CppCustomAttrInfo; 34 | typedef const struct ___Il2CppMetadataTypeHandle *Il2CppMetadataTypeHandle; 35 | typedef const struct ___Il2CppMetadataGenericParameterHandle *Il2CppMetadataGenericParameterHandle; 36 | 37 | typedef void (*Il2CppMethodPointer)(); 38 | 39 | typedef void (*il2cpp_register_object_callback)(Il2CppObject **arr, int size, void *userdata); 40 | 41 | typedef void *(*il2cpp_liveness_reallocate_callback)(void *ptr, size_t size, void *userdata); 42 | 43 | typedef void (*Il2CppFrameWalkFunc)(const Il2CppStackFrameInfo *info, void *user_data); 44 | 45 | typedef size_t(*Il2CppBacktraceFunc)(Il2CppMethodPointer *buffer, size_t maxSize); 46 | 47 | typedef const Il2CppNativeChar *(*Il2CppSetFindPlugInCallback)(const Il2CppNativeChar *); 48 | 49 | typedef void (*Il2CppLogCallback)(const char *); 50 | 51 | typedef enum { 52 | IL2CPP_UNHANDLED_POLICY_LEGACY, 53 | IL2CPP_UNHANDLED_POLICY_CURRENT 54 | } Il2CppRuntimeUnhandledExceptionPolicy; 55 | 56 | typedef enum { 57 | IL2CPP_GC_MODE_DISABLED = 0, 58 | IL2CPP_GC_MODE_ENABLED = 1, 59 | IL2CPP_GC_MODE_MANUAL = 2 60 | } Il2CppGCMode; 61 | 62 | typedef enum Il2CppStat { 63 | IL2CPP_STAT_NEW_OBJECT_COUNT, 64 | IL2CPP_STAT_INITIALIZED_CLASS_COUNT, 65 | IL2CPP_STAT_METHOD_COUNT, 66 | IL2CPP_STAT_CLASS_STATIC_DATA_SIZE, 67 | IL2CPP_STAT_GENERIC_INSTANCE_COUNT, 68 | IL2CPP_STAT_GENERIC_CLASS_COUNT, 69 | IL2CPP_STAT_INFLATED_METHOD_COUNT, 70 | IL2CPP_STAT_INFLATED_TYPE_COUNT, 71 | } Il2CppStat; 72 | 73 | typedef enum Il2CppTypeEnum { 74 | IL2CPP_TYPE_END = 0x00, 75 | IL2CPP_TYPE_VOID = 0x01, 76 | IL2CPP_TYPE_BOOLEAN = 0x02, 77 | IL2CPP_TYPE_CHAR = 0x03, 78 | IL2CPP_TYPE_I1 = 0x04, 79 | IL2CPP_TYPE_U1 = 0x05, 80 | IL2CPP_TYPE_I2 = 0x06, 81 | IL2CPP_TYPE_U2 = 0x07, 82 | IL2CPP_TYPE_I4 = 0x08, 83 | IL2CPP_TYPE_U4 = 0x09, 84 | IL2CPP_TYPE_I8 = 0x0a, 85 | IL2CPP_TYPE_U8 = 0x0b, 86 | IL2CPP_TYPE_R4 = 0x0c, 87 | IL2CPP_TYPE_R8 = 0x0d, 88 | IL2CPP_TYPE_STRING = 0x0e, 89 | IL2CPP_TYPE_PTR = 0x0f, 90 | IL2CPP_TYPE_BYREF = 0x10, 91 | IL2CPP_TYPE_VALUETYPE = 0x11, 92 | IL2CPP_TYPE_CLASS = 0x12, 93 | IL2CPP_TYPE_VAR = 0x13, 94 | IL2CPP_TYPE_ARRAY = 0x14, 95 | IL2CPP_TYPE_GENERICINST = 0x15, 96 | IL2CPP_TYPE_TYPEDBYREF = 0x16, 97 | IL2CPP_TYPE_I = 0x18, 98 | IL2CPP_TYPE_U = 0x19, 99 | IL2CPP_TYPE_FNPTR = 0x1b, 100 | IL2CPP_TYPE_OBJECT = 0x1c, 101 | IL2CPP_TYPE_SZARRAY = 0x1d, 102 | IL2CPP_TYPE_MVAR = 0x1e, 103 | IL2CPP_TYPE_CMOD_REQD = 0x1f, 104 | IL2CPP_TYPE_CMOD_OPT = 0x20, 105 | IL2CPP_TYPE_INTERNAL = 0x21, 106 | IL2CPP_TYPE_MODIFIER = 0x40, 107 | IL2CPP_TYPE_SENTINEL = 0x41, 108 | IL2CPP_TYPE_PINNED = 0x45, 109 | IL2CPP_TYPE_ENUM = 0x55, 110 | IL2CPP_TYPE_IL2CPP_TYPE_INDEX = 0xff 111 | } Il2CppTypeEnum; 112 | 113 | typedef struct Il2CppType { 114 | union { 115 | void *dummy; 116 | TypeDefinitionIndex klassIndex; 117 | const Il2CppType *type; 118 | Il2CppArrayType *array; 119 | GenericParameterIndex genericParameterIndex; 120 | Il2CppGenericClass *generic_class; 121 | } data; 122 | unsigned int attrs: 16; 123 | Il2CppTypeEnum type: 8; 124 | unsigned int num_mods: 6; 125 | unsigned int byref: 1; 126 | unsigned int pinned: 1; 127 | } Il2CppType; 128 | 129 | typedef struct MethodInfo { 130 | Il2CppMethodPointer methodPointer; 131 | } MethodInfo; 132 | 133 | typedef struct Il2CppObject { 134 | union { 135 | Il2CppClass *klass; 136 | Il2CppVTable *vtable; 137 | }; 138 | MonitorData *monitor; 139 | } Il2CppObject; 140 | 141 | typedef struct Il2CppArray { 142 | Il2CppObject obj; 143 | Il2CppArrayBounds *bounds; 144 | il2cpp_array_size_t max_length; 145 | void *vector[32]; 146 | } Il2CppArray; 147 | 148 | #endif 149 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/il2cpp-tabledefs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * Field Attributes (21.1.5). 5 | */ 6 | 7 | #define FIELD_ATTRIBUTE_FIELD_ACCESS_MASK 0x0007 8 | #define FIELD_ATTRIBUTE_COMPILER_CONTROLLED 0x0000 9 | #define FIELD_ATTRIBUTE_PRIVATE 0x0001 10 | #define FIELD_ATTRIBUTE_FAM_AND_ASSEM 0x0002 11 | #define FIELD_ATTRIBUTE_ASSEMBLY 0x0003 12 | #define FIELD_ATTRIBUTE_FAMILY 0x0004 13 | #define FIELD_ATTRIBUTE_FAM_OR_ASSEM 0x0005 14 | #define FIELD_ATTRIBUTE_PUBLIC 0x0006 15 | 16 | #define FIELD_ATTRIBUTE_STATIC 0x0010 17 | #define FIELD_ATTRIBUTE_INIT_ONLY 0x0020 18 | #define FIELD_ATTRIBUTE_LITERAL 0x0040 19 | #define FIELD_ATTRIBUTE_NOT_SERIALIZED 0x0080 20 | #define FIELD_ATTRIBUTE_SPECIAL_NAME 0x0200 21 | #define FIELD_ATTRIBUTE_PINVOKE_IMPL 0x2000 22 | 23 | /* For runtime use only */ 24 | #define FIELD_ATTRIBUTE_RESERVED_MASK 0x9500 25 | #define FIELD_ATTRIBUTE_RT_SPECIAL_NAME 0x0400 26 | #define FIELD_ATTRIBUTE_HAS_FIELD_MARSHAL 0x1000 27 | #define FIELD_ATTRIBUTE_HAS_DEFAULT 0x8000 28 | #define FIELD_ATTRIBUTE_HAS_FIELD_RVA 0x0100 29 | 30 | /* 31 | * Method Attributes (22.1.9) 32 | */ 33 | 34 | #define METHOD_IMPL_ATTRIBUTE_CODE_TYPE_MASK 0x0003 35 | #define METHOD_IMPL_ATTRIBUTE_IL 0x0000 36 | #define METHOD_IMPL_ATTRIBUTE_NATIVE 0x0001 37 | #define METHOD_IMPL_ATTRIBUTE_OPTIL 0x0002 38 | #define METHOD_IMPL_ATTRIBUTE_RUNTIME 0x0003 39 | 40 | #define METHOD_IMPL_ATTRIBUTE_MANAGED_MASK 0x0004 41 | #define METHOD_IMPL_ATTRIBUTE_UNMANAGED 0x0004 42 | #define METHOD_IMPL_ATTRIBUTE_MANAGED 0x0000 43 | 44 | #define METHOD_IMPL_ATTRIBUTE_FORWARD_REF 0x0010 45 | #define METHOD_IMPL_ATTRIBUTE_PRESERVE_SIG 0x0080 46 | #define METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL 0x1000 47 | #define METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED 0x0020 48 | #define METHOD_IMPL_ATTRIBUTE_NOINLINING 0x0008 49 | #define METHOD_IMPL_ATTRIBUTE_MAX_METHOD_IMPL_VAL 0xffff 50 | 51 | #define METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK 0x0007 52 | #define METHOD_ATTRIBUTE_COMPILER_CONTROLLED 0x0000 53 | #define METHOD_ATTRIBUTE_PRIVATE 0x0001 54 | #define METHOD_ATTRIBUTE_FAM_AND_ASSEM 0x0002 55 | #define METHOD_ATTRIBUTE_ASSEM 0x0003 56 | #define METHOD_ATTRIBUTE_FAMILY 0x0004 57 | #define METHOD_ATTRIBUTE_FAM_OR_ASSEM 0x0005 58 | #define METHOD_ATTRIBUTE_PUBLIC 0x0006 59 | 60 | #define METHOD_ATTRIBUTE_STATIC 0x0010 61 | #define METHOD_ATTRIBUTE_FINAL 0x0020 62 | #define METHOD_ATTRIBUTE_VIRTUAL 0x0040 63 | #define METHOD_ATTRIBUTE_HIDE_BY_SIG 0x0080 64 | 65 | #define METHOD_ATTRIBUTE_VTABLE_LAYOUT_MASK 0x0100 66 | #define METHOD_ATTRIBUTE_REUSE_SLOT 0x0000 67 | #define METHOD_ATTRIBUTE_NEW_SLOT 0x0100 68 | 69 | #define METHOD_ATTRIBUTE_STRICT 0x0200 70 | #define METHOD_ATTRIBUTE_ABSTRACT 0x0400 71 | #define METHOD_ATTRIBUTE_SPECIAL_NAME 0x0800 72 | 73 | #define METHOD_ATTRIBUTE_PINVOKE_IMPL 0x2000 74 | #define METHOD_ATTRIBUTE_UNMANAGED_EXPORT 0x0008 75 | 76 | /* 77 | * For runtime use only 78 | */ 79 | #define METHOD_ATTRIBUTE_RESERVED_MASK 0xd000 80 | #define METHOD_ATTRIBUTE_RT_SPECIAL_NAME 0x1000 81 | #define METHOD_ATTRIBUTE_HAS_SECURITY 0x4000 82 | #define METHOD_ATTRIBUTE_REQUIRE_SEC_OBJECT 0x8000 83 | 84 | /* 85 | * Type Attributes (21.1.13). 86 | */ 87 | #define TYPE_ATTRIBUTE_VISIBILITY_MASK 0x00000007 88 | #define TYPE_ATTRIBUTE_NOT_PUBLIC 0x00000000 89 | #define TYPE_ATTRIBUTE_PUBLIC 0x00000001 90 | #define TYPE_ATTRIBUTE_NESTED_PUBLIC 0x00000002 91 | #define TYPE_ATTRIBUTE_NESTED_PRIVATE 0x00000003 92 | #define TYPE_ATTRIBUTE_NESTED_FAMILY 0x00000004 93 | #define TYPE_ATTRIBUTE_NESTED_ASSEMBLY 0x00000005 94 | #define TYPE_ATTRIBUTE_NESTED_FAM_AND_ASSEM 0x00000006 95 | #define TYPE_ATTRIBUTE_NESTED_FAM_OR_ASSEM 0x00000007 96 | 97 | #define TYPE_ATTRIBUTE_LAYOUT_MASK 0x00000018 98 | #define TYPE_ATTRIBUTE_AUTO_LAYOUT 0x00000000 99 | #define TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT 0x00000008 100 | #define TYPE_ATTRIBUTE_EXPLICIT_LAYOUT 0x00000010 101 | 102 | #define TYPE_ATTRIBUTE_CLASS_SEMANTIC_MASK 0x00000020 103 | #define TYPE_ATTRIBUTE_CLASS 0x00000000 104 | #define TYPE_ATTRIBUTE_INTERFACE 0x00000020 105 | 106 | #define TYPE_ATTRIBUTE_ABSTRACT 0x00000080 107 | #define TYPE_ATTRIBUTE_SEALED 0x00000100 108 | #define TYPE_ATTRIBUTE_SPECIAL_NAME 0x00000400 109 | 110 | #define TYPE_ATTRIBUTE_IMPORT 0x00001000 111 | #define TYPE_ATTRIBUTE_SERIALIZABLE 0x00002000 112 | 113 | #define TYPE_ATTRIBUTE_STRING_FORMAT_MASK 0x00030000 114 | #define TYPE_ATTRIBUTE_ANSI_CLASS 0x00000000 115 | #define TYPE_ATTRIBUTE_UNICODE_CLASS 0x00010000 116 | #define TYPE_ATTRIBUTE_AUTO_CLASS 0x00020000 117 | 118 | #define TYPE_ATTRIBUTE_BEFORE_FIELD_INIT 0x00100000 119 | #define TYPE_ATTRIBUTE_FORWARDER 0x00200000 120 | 121 | #define TYPE_ATTRIBUTE_RESERVED_MASK 0x00040800 122 | #define TYPE_ATTRIBUTE_RT_SPECIAL_NAME 0x00000800 123 | #define TYPE_ATTRIBUTE_HAS_SECURITY 0x00040000 124 | 125 | /* 126 | * Flags for Params (22.1.12) 127 | */ 128 | #define PARAM_ATTRIBUTE_IN 0x0001 129 | #define PARAM_ATTRIBUTE_OUT 0x0002 130 | #define PARAM_ATTRIBUTE_OPTIONAL 0x0010 131 | #define PARAM_ATTRIBUTE_RESERVED_MASK 0xf000 132 | #define PARAM_ATTRIBUTE_HAS_DEFAULT 0x1000 133 | #define PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL 0x2000 134 | #define PARAM_ATTRIBUTE_UNUSED 0xcfe0 135 | 136 | // Flags for Generic Parameters (II.23.1.7) 137 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_NON_VARIANT 0x00 138 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_COVARIANT 0x01 139 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_CONTRAVARIANT 0x02 140 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_VARIANCE_MASK 0x03 141 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_REFERENCE_TYPE_CONSTRAINT 0x04 142 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_NOT_NULLABLE_VALUE_TYPE_CONSTRAINT 0x08 143 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_DEFAULT_CONSTRUCTOR_CONSTRAINT 0x10 144 | #define IL2CPP_GENERIC_PARAMETER_ATTRIBUTE_SPECIAL_CONSTRAINT_MASK 0x1C 145 | 146 | /** 147 | * 21.5 AssemblyRefs 148 | */ 149 | #define ASSEMBLYREF_FULL_PUBLIC_KEY_FLAG 0x00000001 150 | #define ASSEMBLYREF_RETARGETABLE_FLAG 0x00000100 151 | #define ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG 0x00008000 152 | #define ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG 0x00004000 153 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/il2cpp_dumper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/30. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_IL2CPP_DUMPER_H 6 | #define XPOSEDNHOOK_IL2CPP_DUMPER_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "il2cpp-tabledefs.h" 14 | #include "il2cpp-class.h" 15 | 16 | bool dump(int, const char *); 17 | 18 | void dumpIL2cpp(const char *); 19 | 20 | void *get_il2cpp_handle(); 21 | 22 | 23 | class Il2CppApi { 24 | public: 25 | static std::map il2cpp_functions; 26 | 27 | static void *get(const std::string &name) { 28 | if (il2cpp_functions.find(name) == il2cpp_functions.end()) { 29 | void *address = dlsym(il2cpp_handle, name.c_str()); 30 | if (address == nullptr) { 31 | return nullptr; 32 | } 33 | il2cpp_functions[name] = address; 34 | } 35 | assert(il2cpp_functions[name] != nullptr); 36 | return il2cpp_functions[name]; 37 | } 38 | 39 | static void *il2cpp_handle; 40 | static size_t il2cpp_base; 41 | }; 42 | 43 | #define IL2CPP_API(functionName, returnType, paramType, param) \ 44 | typedef returnType (*functionName##_t) paramType; \ 45 | static functionName##_t functionName##_ptr; \ 46 | static returnType functionName paramType { \ 47 | functionName##_ptr = (functionName##_t)Il2CppApi::get(#functionName); \ 48 | return functionName##_ptr param; \ 49 | } 50 | 51 | #endif //XPOSEDNHOOK_IL2CPP_DUMPER_H 52 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/md5.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by kanxue on 2020/12/29. 3 | // 4 | 5 | #ifndef MD5_MD5_H 6 | #define MD5_MD5_H 7 | #include 8 | typedef unsigned long uint32; 9 | 10 | struct MD5Context { 11 | uint32 buf[4]; 12 | uint32 bits[2]; 13 | unsigned char in[64]; 14 | }; 15 | 16 | void MD5Init (struct MD5Context *context); 17 | void MD5Update (struct MD5Context *context, unsigned char const *buf, unsigned len); 18 | void MD5Final (unsigned char digest[16], struct MD5Context *context); 19 | void MD5Transform (uint32 buf[4], const unsigned char in[64]); 20 | 21 | /* 22 | * This is needed to make RSAREF happy on some MS-DOS compilers. 23 | */ 24 | typedef struct MD5Context MD5_CTX; 25 | #endif //MD5_MD5_H 26 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/modmenu.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/23. 3 | // 4 | #include 5 | #include 6 | #include 7 | 8 | extern "C" JNIEXPORT jstring JNICALL 9 | Java_cn_mrack_xposed_nhook_NHook_test111(JNIEnv *env, jclass thiz, jint value) { 10 | char buf[128]; 11 | sprintf(buf, "value: %d", value); 12 | // write code here 13 | return env->NewStringUTF(buf); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/modmenu_native.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/28. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_MODMENU_NATIVE_H 6 | #define XPOSEDNHOOK_MODMENU_NATIVE_H 7 | 8 | #include "imgui.h" 9 | #include 10 | 11 | void test_modmenu_native(); 12 | 13 | void input_inject(); 14 | 15 | void render(); 16 | 17 | class Window { 18 | private: 19 | int ViewPort[4]; 20 | 21 | public: 22 | static Window *instance() { 23 | static Window *instance = NULL; 24 | if (instance == NULL) instance = new Window; 25 | return instance; 26 | } 27 | 28 | bool getViewPort() { 29 | glGetIntegerv(GL_VIEWPORT, this->ViewPort); 30 | if (this->ViewPort[2] && this->ViewPort[3]) return true; 31 | return false; 32 | } 33 | 34 | float getX() { 35 | return (float) this->ViewPort[0]; 36 | } 37 | 38 | float getY() { 39 | return (float) this->ViewPort[1]; 40 | } 41 | 42 | float getW() { 43 | return (float) this->ViewPort[2]; 44 | } 45 | 46 | float getH() { 47 | return (float) this->ViewPort[3]; 48 | } 49 | 50 | float getWidth() { 51 | return (this->getW() + (this->getX() * 2.0f)); 52 | } 53 | 54 | float getHeight() { 55 | return (this->getH() + (this->getY() * 2.0f)); 56 | } 57 | 58 | ImVec2 getSize() { 59 | return ImVec2(this->getWidth(), this->getHeight()); 60 | } 61 | 62 | ImVec2 getCenter() { 63 | return ImVec2(this->getWidth() / 2.0f, this->getHeight() / 2.0f); 64 | } 65 | 66 | ImVec2 getScale() { 67 | return ImVec2(this->getWidth() * 0.00052083333f, this->getHeight() * 0.00092592592f); 68 | } 69 | 70 | bool isRotation() { 71 | if (this->getWidth() < this->getHeight()) return true; 72 | return false; 73 | } 74 | }; 75 | 76 | #endif //XPOSEDNHOOK_MODMENU_NATIVE_H 77 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/qbdihook.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/28. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_QBDIHOOK_H 6 | #define XPOSEDNHOOK_QBDIHOOK_H 7 | 8 | #include "jni.h" 9 | #include "dobby/dobby.h" 10 | 11 | void test_QBDI(); 12 | 13 | extern "C" JNIEXPORT jstring JNICALL 14 | Java_cn_mrack_xposed_nhook_NHook_sign1(JNIEnv *env, jclass thiz, jstring sign); 15 | void vm_handle_add(void *address, DobbyRegisterContext *ctx); 16 | #endif //XPOSEDNHOOK_QBDIHOOK_H 17 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/ytbssl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/28. 3 | // 4 | 5 | #include "ytbssl.h" 6 | #include "utils.h" 7 | #include "linker_hook.h" 8 | 9 | int (*SSL_callback)(void *ctx, void *out_alert); 10 | 11 | int hook_SSL_callback(void *ctx, void *out_alert) { 12 | int res = SSL_callback(ctx, out_alert); 13 | return 0; 14 | } 15 | 16 | void (*SSL_CTX_set_custom_verify)(void *ctx, int mode, void *callback); 17 | 18 | void hook_SSL_CTX_set_custom_verify(void *ctx, int mode, void *callback) { 19 | LOGD("SSL_CTX_set_custom_verify callback %p", callback); 20 | SSL_CTX_set_custom_verify(ctx, mode, callback); 21 | DobbyHook(callback, (void *) hook_SSL_callback, 22 | (void **) &SSL_callback); 23 | } 24 | 25 | void test_youtube() { 26 | hook_module_load(); 27 | } 28 | 29 | void module_load(const char *file_path) { 30 | std::string path = file_path; 31 | if (path.find("libcronet") == std::string::npos) { 32 | return; 33 | } 34 | const char *file_name = strrchr(file_path, '/'); 35 | const std::pair &info = find_info_from_maps(file_name + 1); 36 | u_char *base = (u_char *) info.first; 37 | size_t size = info.second; 38 | int offset = search_hex((u_char *) base, size, 39 | "????01B9????00F9C0035FD6"); 40 | if (offset > 0) { 41 | void *p_SSL_CTX_set_custom_verify = (void *) (offset + info.first); 42 | LOGD("SSL_CTX_set_custom_verify: %p", p_SSL_CTX_set_custom_verify); 43 | DobbyHook(p_SSL_CTX_set_custom_verify, (void *) hook_SSL_CTX_set_custom_verify, 44 | (void **) &SSL_CTX_set_custom_verify); 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/cpp/demo/ytbssl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/28. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_YTBSSL_H 6 | #define XPOSEDNHOOK_YTBSSL_H 7 | 8 | void test_youtube(); 9 | 10 | void hook_SSL_CTX_set_custom_verify(void *ctx, int mode, void *callback); 11 | 12 | #endif //XPOSEDNHOOK_YTBSSL_H 13 | -------------------------------------------------------------------------------- /app/src/main/cpp/dobby/dobby.h: -------------------------------------------------------------------------------- 1 | #ifndef dobby_h 2 | #define dobby_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | typedef uintptr_t addr_t; 12 | typedef uint32_t addr32_t; 13 | typedef uint64_t addr64_t; 14 | 15 | typedef void *dobby_dummy_func_t; 16 | typedef void *asm_func_t; 17 | 18 | #if defined(__arm__) 19 | typedef struct { 20 | uint32_t dummy_0; 21 | uint32_t dummy_1; 22 | 23 | uint32_t dummy_2; 24 | uint32_t sp; 25 | 26 | union { 27 | uint32_t r[13]; 28 | struct { 29 | uint32_t r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; 30 | } regs; 31 | } general; 32 | 33 | uint32_t lr; 34 | } DobbyRegisterContext; 35 | #elif defined(__arm64__) || defined(__aarch64__) 36 | #define ARM64_TMP_REG_NDX_0 17 37 | 38 | typedef union _FPReg { 39 | __int128_t q; 40 | struct { 41 | double d1; 42 | double d2; 43 | } d; 44 | struct { 45 | float f1; 46 | float f2; 47 | float f3; 48 | float f4; 49 | } f; 50 | } FPReg; 51 | 52 | // register context 53 | typedef struct { 54 | uint64_t dmmpy_0; // dummy placeholder 55 | uint64_t sp; 56 | 57 | uint64_t dmmpy_1; // dummy placeholder 58 | union { 59 | uint64_t x[29]; 60 | struct { 61 | uint64_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, 62 | x23, x24, x25, x26, x27, x28; 63 | } regs; 64 | } general; 65 | 66 | uint64_t fp; 67 | uint64_t lr; 68 | 69 | union { 70 | FPReg q[32]; 71 | struct { 72 | FPReg q0, q1, q2, q3, q4, q5, q6, q7; 73 | // [!!! READ ME !!!] 74 | // for Arm64, can't access q8 - q31, unless you enable full floating-point register pack 75 | FPReg q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21, q22, q23, q24, q25, q26, q27, q28, q29, 76 | q30, q31; 77 | } regs; 78 | } floating; 79 | } DobbyRegisterContext; 80 | #elif defined(_M_IX86) || defined(__i386__) 81 | typedef struct _RegisterContext { 82 | uint32_t dummy_0; 83 | uint32_t esp; 84 | 85 | uint32_t dummy_1; 86 | uint32_t flags; 87 | 88 | union { 89 | struct { 90 | uint32_t eax, ebx, ecx, edx, ebp, esp, edi, esi; 91 | } regs; 92 | } general; 93 | 94 | } DobbyRegisterContext; 95 | #elif defined(_M_X64) || defined(__x86_64__) 96 | typedef struct { 97 | uint64_t dummy_0; 98 | uint64_t rsp; 99 | 100 | union { 101 | struct { 102 | uint64_t rax, rbx, rcx, rdx, rbp, rsp, rdi, rsi, r8, r9, r10, r11, r12, r13, r14, r15; 103 | } regs; 104 | } general; 105 | 106 | uint64_t dummy_1; 107 | uint64_t flags; 108 | } DobbyRegisterContext; 109 | #endif 110 | 111 | #define install_hook_name(name, fn_ret_t, fn_args_t...) \ 112 | static fn_ret_t fake_##name(fn_args_t); \ 113 | static fn_ret_t (*orig_##name)(fn_args_t); \ 114 | /* __attribute__((constructor)) */ static void install_hook_##name(void *sym_addr) { \ 115 | DobbyHook(sym_addr, (dobby_dummy_func_t)fake_##name, (dobby_dummy_func_t *)&orig_##name); \ 116 | return; \ 117 | } \ 118 | fn_ret_t fake_##name(fn_args_t) 119 | 120 | // memory code patch 121 | int DobbyCodePatch(void *address, uint8_t *buffer, uint32_t buffer_size); 122 | 123 | // function inline hook 124 | int DobbyHook(void *address, dobby_dummy_func_t replace_func, dobby_dummy_func_t *origin_func); 125 | 126 | // dynamic binary instruction instrument 127 | // for Arm64, can't access q8 - q31, unless enable full floating-point register pack 128 | typedef void (*dobby_instrument_callback_t)(void *address, DobbyRegisterContext *ctx); 129 | int DobbyInstrument(void *address, dobby_instrument_callback_t pre_handler); 130 | 131 | // destroy and restore code patch 132 | int DobbyDestroy(void *address); 133 | 134 | const char *DobbyGetVersion(); 135 | 136 | // symbol resolver 137 | void *DobbySymbolResolver(const char *image_name, const char *symbol_name); 138 | 139 | // import table replace 140 | int DobbyImportTableReplace(char *image_name, char *symbol_name, dobby_dummy_func_t fake_func, 141 | dobby_dummy_func_t *orig_func); 142 | 143 | // for arm, Arm64, try use b xxx instead of ldr absolute indirect branch 144 | // for x86, x64, always use absolute indirect jump 145 | void dobby_enable_near_branch_trampoline(); 146 | void dobby_disable_near_branch_trampoline(); 147 | 148 | #ifdef __cplusplus 149 | } 150 | #endif 151 | 152 | #endif 153 | -------------------------------------------------------------------------------- /app/src/main/cpp/elfio/elfio_array.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-present by Serge Lamikhov-Center 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef ELFIO_ARRAY_HPP 24 | #define ELFIO_ARRAY_HPP 25 | 26 | #include 27 | 28 | namespace ELFIO { 29 | 30 | //------------------------------------------------------------------------------ 31 | template class array_section_accessor_template 32 | { 33 | public: 34 | //------------------------------------------------------------------------------ 35 | explicit array_section_accessor_template( const elfio& elf_file, 36 | S* section ) 37 | : elf_file( elf_file ), array_section( section ) 38 | { 39 | } 40 | 41 | //------------------------------------------------------------------------------ 42 | Elf_Xword get_entries_num() const 43 | { 44 | Elf_Xword entry_size = sizeof( T ); 45 | return array_section->get_size() / entry_size; 46 | } 47 | 48 | //------------------------------------------------------------------------------ 49 | bool get_entry( Elf_Xword index, Elf64_Addr& address ) const 50 | { 51 | if ( index >= get_entries_num() ) { // Is index valid 52 | return false; 53 | } 54 | 55 | const endianess_convertor& convertor = elf_file.get_convertor(); 56 | 57 | const T temp = *reinterpret_cast( array_section->get_data() + 58 | index * sizeof( T ) ); 59 | address = convertor( temp ); 60 | 61 | return true; 62 | } 63 | 64 | //------------------------------------------------------------------------------ 65 | void add_entry( Elf64_Addr address ) 66 | { 67 | const endianess_convertor& convertor = elf_file.get_convertor(); 68 | 69 | T temp = convertor( (T)address ); 70 | array_section->append_data( reinterpret_cast( &temp ), 71 | sizeof( temp ) ); 72 | } 73 | 74 | private: 75 | //------------------------------------------------------------------------------ 76 | const elfio& elf_file; 77 | S* array_section; 78 | }; 79 | 80 | template 81 | using array_section_accessor = array_section_accessor_template; 82 | template 83 | using const_array_section_accessor = 84 | array_section_accessor_template; 85 | 86 | } // namespace ELFIO 87 | 88 | #endif // ELFIO_ARRAY_HPP 89 | -------------------------------------------------------------------------------- /app/src/main/cpp/elfio/elfio_header.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-present by Serge Lamikhov-Center 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef ELF_HEADER_HPP 24 | #define ELF_HEADER_HPP 25 | 26 | #include 27 | 28 | namespace ELFIO { 29 | 30 | class elf_header 31 | { 32 | public: 33 | virtual ~elf_header() = default; 34 | 35 | virtual bool load( std::istream& stream ) = 0; 36 | virtual bool save( std::ostream& stream ) const = 0; 37 | 38 | // ELF header functions 39 | ELFIO_GET_ACCESS_DECL( unsigned char, class ); 40 | ELFIO_GET_ACCESS_DECL( unsigned char, elf_version ); 41 | ELFIO_GET_ACCESS_DECL( unsigned char, encoding ); 42 | ELFIO_GET_ACCESS_DECL( Elf_Half, header_size ); 43 | ELFIO_GET_ACCESS_DECL( Elf_Half, section_entry_size ); 44 | ELFIO_GET_ACCESS_DECL( Elf_Half, segment_entry_size ); 45 | 46 | ELFIO_GET_SET_ACCESS_DECL( Elf_Word, version ); 47 | ELFIO_GET_SET_ACCESS_DECL( unsigned char, os_abi ); 48 | ELFIO_GET_SET_ACCESS_DECL( unsigned char, abi_version ); 49 | ELFIO_GET_SET_ACCESS_DECL( Elf_Half, type ); 50 | ELFIO_GET_SET_ACCESS_DECL( Elf_Half, machine ); 51 | ELFIO_GET_SET_ACCESS_DECL( Elf_Word, flags ); 52 | ELFIO_GET_SET_ACCESS_DECL( Elf64_Addr, entry ); 53 | ELFIO_GET_SET_ACCESS_DECL( Elf_Half, sections_num ); 54 | ELFIO_GET_SET_ACCESS_DECL( Elf64_Off, sections_offset ); 55 | ELFIO_GET_SET_ACCESS_DECL( Elf_Half, segments_num ); 56 | ELFIO_GET_SET_ACCESS_DECL( Elf64_Off, segments_offset ); 57 | ELFIO_GET_SET_ACCESS_DECL( Elf_Half, section_name_str_index ); 58 | }; 59 | 60 | template struct elf_header_impl_types; 61 | template <> struct elf_header_impl_types 62 | { 63 | using Phdr_type = Elf32_Phdr; 64 | using Shdr_type = Elf32_Shdr; 65 | static const unsigned char file_class = ELFCLASS32; 66 | }; 67 | template <> struct elf_header_impl_types 68 | { 69 | using Phdr_type = Elf64_Phdr; 70 | using Shdr_type = Elf64_Shdr; 71 | static const unsigned char file_class = ELFCLASS64; 72 | }; 73 | 74 | template class elf_header_impl : public elf_header 75 | { 76 | public: 77 | //------------------------------------------------------------------------------ 78 | elf_header_impl( endianess_convertor* convertor, 79 | unsigned char encoding, 80 | const address_translator* translator ) 81 | : convertor( convertor ), translator( translator ) 82 | { 83 | header.e_ident[EI_MAG0] = ELFMAG0; 84 | header.e_ident[EI_MAG1] = ELFMAG1; 85 | header.e_ident[EI_MAG2] = ELFMAG2; 86 | header.e_ident[EI_MAG3] = ELFMAG3; 87 | header.e_ident[EI_CLASS] = elf_header_impl_types::file_class; 88 | header.e_ident[EI_DATA] = encoding; 89 | header.e_ident[EI_VERSION] = EV_CURRENT; 90 | header.e_version = ( *convertor )( (Elf_Word)EV_CURRENT ); 91 | header.e_ehsize = ( sizeof( header ) ); 92 | header.e_ehsize = ( *convertor )( header.e_ehsize ); 93 | header.e_shstrndx = ( *convertor )( (Elf_Half)1 ); 94 | header.e_phentsize = 95 | sizeof( typename elf_header_impl_types::Phdr_type ); 96 | header.e_shentsize = 97 | sizeof( typename elf_header_impl_types::Shdr_type ); 98 | header.e_phentsize = ( *convertor )( header.e_phentsize ); 99 | header.e_shentsize = ( *convertor )( header.e_shentsize ); 100 | } 101 | 102 | //------------------------------------------------------------------------------ 103 | bool load( std::istream& stream ) override 104 | { 105 | stream.seekg( ( *translator )[0] ); 106 | stream.read( reinterpret_cast( &header ), sizeof( header ) ); 107 | 108 | return ( stream.gcount() == sizeof( header ) ); 109 | } 110 | 111 | //------------------------------------------------------------------------------ 112 | bool save( std::ostream& stream ) const override 113 | { 114 | stream.seekp( ( *translator )[0] ); 115 | stream.write( reinterpret_cast( &header ), 116 | sizeof( header ) ); 117 | 118 | return stream.good(); 119 | } 120 | 121 | //------------------------------------------------------------------------------ 122 | // ELF header functions 123 | ELFIO_GET_ACCESS( unsigned char, class, header.e_ident[EI_CLASS] ); 124 | ELFIO_GET_ACCESS( unsigned char, elf_version, header.e_ident[EI_VERSION] ); 125 | ELFIO_GET_ACCESS( unsigned char, encoding, header.e_ident[EI_DATA] ); 126 | ELFIO_GET_ACCESS( Elf_Half, header_size, header.e_ehsize ); 127 | ELFIO_GET_ACCESS( Elf_Half, section_entry_size, header.e_shentsize ); 128 | ELFIO_GET_ACCESS( Elf_Half, segment_entry_size, header.e_phentsize ); 129 | 130 | ELFIO_GET_SET_ACCESS( Elf_Word, version, header.e_version ); 131 | ELFIO_GET_SET_ACCESS( unsigned char, os_abi, header.e_ident[EI_OSABI] ); 132 | ELFIO_GET_SET_ACCESS( unsigned char, 133 | abi_version, 134 | header.e_ident[EI_ABIVERSION] ); 135 | ELFIO_GET_SET_ACCESS( Elf_Half, type, header.e_type ); 136 | ELFIO_GET_SET_ACCESS( Elf_Half, machine, header.e_machine ); 137 | ELFIO_GET_SET_ACCESS( Elf_Word, flags, header.e_flags ); 138 | ELFIO_GET_SET_ACCESS( Elf_Half, section_name_str_index, header.e_shstrndx ); 139 | ELFIO_GET_SET_ACCESS( Elf64_Addr, entry, header.e_entry ); 140 | ELFIO_GET_SET_ACCESS( Elf_Half, sections_num, header.e_shnum ); 141 | ELFIO_GET_SET_ACCESS( Elf64_Off, sections_offset, header.e_shoff ); 142 | ELFIO_GET_SET_ACCESS( Elf_Half, segments_num, header.e_phnum ); 143 | ELFIO_GET_SET_ACCESS( Elf64_Off, segments_offset, header.e_phoff ); 144 | 145 | private: 146 | T header = {}; 147 | endianess_convertor* convertor = nullptr; 148 | const address_translator* translator = nullptr; 149 | }; 150 | 151 | } // namespace ELFIO 152 | 153 | #endif // ELF_HEADER_HPP 154 | -------------------------------------------------------------------------------- /app/src/main/cpp/elfio/elfio_modinfo.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-present by Serge Lamikhov-Center 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef ELFIO_MODINFO_HPP 24 | #define ELFIO_MODINFO_HPP 25 | 26 | #include 27 | #include 28 | 29 | namespace ELFIO { 30 | 31 | //------------------------------------------------------------------------------ 32 | template class modinfo_section_accessor_template 33 | { 34 | public: 35 | //------------------------------------------------------------------------------ 36 | explicit modinfo_section_accessor_template( S* section ) 37 | : modinfo_section( section ) 38 | { 39 | process_section(); 40 | } 41 | 42 | //------------------------------------------------------------------------------ 43 | Elf_Word get_attribute_num() const { return (Elf_Word)content.size(); } 44 | 45 | //------------------------------------------------------------------------------ 46 | bool 47 | get_attribute( Elf_Word no, std::string& field, std::string& value ) const 48 | { 49 | if ( no < content.size() ) { 50 | field = content[no].first; 51 | value = content[no].second; 52 | return true; 53 | } 54 | 55 | return false; 56 | } 57 | 58 | //------------------------------------------------------------------------------ 59 | bool get_attribute( const std::string_view& field_name, 60 | std::string& value ) const 61 | { 62 | for ( const auto [first, second] : content ) { 63 | if ( field_name == first ) { 64 | value = second; 65 | return true; 66 | } 67 | } 68 | 69 | return false; 70 | } 71 | 72 | //------------------------------------------------------------------------------ 73 | Elf_Word add_attribute( const std::string& field, const std::string& value ) 74 | { 75 | Elf_Word current_position = 0; 76 | 77 | if ( modinfo_section ) { 78 | // Strings are addeded to the end of the current section data 79 | current_position = (Elf_Word)modinfo_section->get_size(); 80 | 81 | std::string attribute = field + "=" + value; 82 | 83 | modinfo_section->append_data( attribute + '\0' ); 84 | content.emplace_back( field, value ); 85 | } 86 | 87 | return current_position; 88 | } 89 | 90 | //------------------------------------------------------------------------------ 91 | private: 92 | void process_section() 93 | { 94 | const char* pdata = modinfo_section->get_data(); 95 | if ( pdata ) { 96 | ELFIO::Elf_Xword i = 0; 97 | while ( i < modinfo_section->get_size() ) { 98 | while ( i < modinfo_section->get_size() && !pdata[i] ) 99 | i++; 100 | if ( i < modinfo_section->get_size() ) { 101 | std::string info = pdata + i; 102 | size_t loc = info.find( '=' ); 103 | content.emplace_back( info.substr( 0, loc ), 104 | info.substr( loc + 1 ) ); 105 | 106 | i += info.length(); 107 | } 108 | } 109 | } 110 | } 111 | 112 | //------------------------------------------------------------------------------ 113 | private: 114 | S* modinfo_section; 115 | std::vector> content; 116 | }; 117 | 118 | using modinfo_section_accessor = modinfo_section_accessor_template
; 119 | using const_modinfo_section_accessor = 120 | modinfo_section_accessor_template; 121 | 122 | } // namespace ELFIO 123 | 124 | #endif // ELFIO_MODINFO_HPP 125 | -------------------------------------------------------------------------------- /app/src/main/cpp/elfio/elfio_strings.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-present by Serge Lamikhov-Center 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef ELFIO_STRINGS_HPP 24 | #define ELFIO_STRINGS_HPP 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace ELFIO { 31 | 32 | //------------------------------------------------------------------------------ 33 | template class string_section_accessor_template 34 | { 35 | public: 36 | //------------------------------------------------------------------------------ 37 | explicit string_section_accessor_template( S* section ) 38 | : string_section( section ) 39 | { 40 | } 41 | 42 | //------------------------------------------------------------------------------ 43 | const char* get_string( Elf_Word index ) const 44 | { 45 | if ( string_section ) { 46 | const char* data = string_section->get_data(); 47 | if ( index < string_section->get_size() && nullptr != data ) { 48 | size_t string_length = 49 | strnlen( data + index, string_section->get_size() - index ); 50 | if ( string_length < ( string_section->get_size() - index ) ) 51 | return data + index; 52 | } 53 | } 54 | 55 | return nullptr; 56 | } 57 | 58 | //------------------------------------------------------------------------------ 59 | Elf_Word add_string( const char* str ) 60 | { 61 | Elf_Word current_position = 0; 62 | 63 | if ( string_section ) { 64 | // Strings are addeded to the end of the current section data 65 | current_position = 66 | static_cast( string_section->get_size() ); 67 | 68 | if ( current_position == 0 ) { 69 | char empty_string = '\0'; 70 | string_section->append_data( &empty_string, 1 ); 71 | current_position++; 72 | } 73 | string_section->append_data( 74 | str, static_cast( std::strlen( str ) + 1 ) ); 75 | } 76 | 77 | return current_position; 78 | } 79 | 80 | //------------------------------------------------------------------------------ 81 | Elf_Word add_string( const std::string& str ) 82 | { 83 | return add_string( str.c_str() ); 84 | } 85 | 86 | //------------------------------------------------------------------------------ 87 | private: 88 | S* string_section; 89 | }; 90 | 91 | using string_section_accessor = string_section_accessor_template
; 92 | using const_string_section_accessor = 93 | string_section_accessor_template; 94 | 95 | } // namespace ELFIO 96 | 97 | #endif // ELFIO_STRINGS_HPP 98 | -------------------------------------------------------------------------------- /app/src/main/cpp/elfio/elfio_version.hpp: -------------------------------------------------------------------------------- 1 | #define ELFIO_VERSION "3.12" 2 | -------------------------------------------------------------------------------- /app/src/main/cpp/elfio/elfio_versym.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-present by Serge Lamikhov-Center 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef ELFIO_VERSYM_HPP 24 | #define ELFIO_VERSYM_HPP 25 | 26 | namespace ELFIO { 27 | 28 | //------------------------------------------------------------------------------ 29 | template class versym_section_accessor_template 30 | { 31 | public: 32 | //------------------------------------------------------------------------------ 33 | explicit versym_section_accessor_template( S* section ) 34 | : versym_section( section ) 35 | { 36 | if ( section != nullptr ) { 37 | entries_num = decltype( entries_num )( section->get_size() / 38 | sizeof( Elf_Half ) ); 39 | } 40 | } 41 | 42 | //------------------------------------------------------------------------------ 43 | Elf_Word get_entries_num() const 44 | { 45 | if ( versym_section ) { 46 | return entries_num; 47 | } 48 | return 0; 49 | } 50 | 51 | //------------------------------------------------------------------------------ 52 | bool get_entry( Elf_Word no, Elf_Half& value ) const 53 | { 54 | if ( versym_section && ( no < get_entries_num() ) ) { 55 | value = ( (Elf_Half*)versym_section->get_data() )[no]; 56 | return true; 57 | } 58 | 59 | return false; 60 | } 61 | 62 | //------------------------------------------------------------------------------ 63 | bool modify_entry( Elf_Word no, Elf_Half value ) 64 | { 65 | if ( versym_section && ( no < get_entries_num() ) ) { 66 | ( (Elf_Half*)versym_section->get_data() )[no] = value; 67 | return true; 68 | } 69 | 70 | return false; 71 | } 72 | 73 | //------------------------------------------------------------------------------ 74 | bool add_entry( Elf_Half value ) 75 | { 76 | if ( !versym_section ) { 77 | return false; 78 | } 79 | 80 | versym_section->append_data( (const char*)&value, sizeof( Elf_Half ) ); 81 | ++entries_num; 82 | 83 | return true; 84 | } 85 | 86 | //------------------------------------------------------------------------------ 87 | private: 88 | S* versym_section = nullptr; 89 | Elf_Word entries_num = 0; 90 | }; 91 | 92 | using versym_section_accessor = versym_section_accessor_template
; 93 | using const_versym_section_accessor = 94 | versym_section_accessor_template; 95 | 96 | //------------------------------------------------------------------------------ 97 | template class versym_r_section_accessor_template 98 | { 99 | public: 100 | //------------------------------------------------------------------------------ 101 | versym_r_section_accessor_template( const elfio& elf_file, 102 | S* versym_r_section ) 103 | : elf_file( elf_file ), versym_r_section( versym_r_section ), 104 | entries_num( 0 ) 105 | { 106 | // Find .dynamic section 107 | const section* dynamic_section = elf_file.sections[".dynamic"]; 108 | 109 | if ( dynamic_section == nullptr ) { 110 | return; 111 | } 112 | 113 | const_dynamic_section_accessor dynamic_section_acc( elf_file, 114 | dynamic_section ); 115 | Elf_Xword dyn_sec_num = dynamic_section_acc.get_entries_num(); 116 | for ( Elf_Xword i = 0; i < dyn_sec_num; ++i ) { 117 | Elf_Xword tag; 118 | Elf_Xword value; 119 | std::string str; 120 | 121 | if ( dynamic_section_acc.get_entry( i, tag, value, str ) && 122 | tag == DT_VERNEEDNUM ) { 123 | entries_num = (Elf_Word)value; 124 | break; 125 | } 126 | } 127 | } 128 | 129 | //------------------------------------------------------------------------------ 130 | Elf_Word get_entries_num() const { return entries_num; } 131 | 132 | //------------------------------------------------------------------------------ 133 | bool get_entry( Elf_Word no, 134 | Elf_Half& version, 135 | std::string& file_name, 136 | Elf_Word& hash, 137 | Elf_Half& flags, 138 | Elf_Half& other, 139 | std::string& dep_name ) const 140 | { 141 | if ( versym_r_section == nullptr || ( no >= get_entries_num() ) ) { 142 | return false; 143 | } 144 | 145 | const_string_section_accessor string_section_acc( 146 | elf_file.sections[versym_r_section->get_link()] ); 147 | 148 | Elfxx_Verneed* verneed = (Elfxx_Verneed*)versym_r_section->get_data(); 149 | Elfxx_Vernaux* veraux = 150 | (Elfxx_Vernaux*)( (char*)verneed + verneed->vn_aux ); 151 | for ( Elf_Word i = 0; i < no; ++i ) { 152 | verneed = (Elfxx_Verneed*)( (char*)verneed + verneed->vn_next ); 153 | veraux = (Elfxx_Vernaux*)( (char*)verneed + verneed->vn_aux ); 154 | } 155 | 156 | version = verneed->vn_version; 157 | file_name = string_section_acc.get_string( verneed->vn_file ); 158 | hash = veraux->vna_hash; 159 | flags = veraux->vna_flags; 160 | other = veraux->vna_other; 161 | dep_name = string_section_acc.get_string( veraux->vna_name ); 162 | 163 | return true; 164 | } 165 | 166 | //------------------------------------------------------------------------------ 167 | private: 168 | const elfio& elf_file; 169 | S* versym_r_section = nullptr; 170 | Elf_Word entries_num = 0; 171 | }; 172 | 173 | using versym_r_section_accessor = versym_r_section_accessor_template
; 174 | using const_versym_r_section_accessor = 175 | versym_r_section_accessor_template; 176 | 177 | } // namespace ELFIO 178 | 179 | #endif // ELFIO_VERSYM_HPP 180 | -------------------------------------------------------------------------------- /app/src/main/cpp/hexdump.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 李狗蛋 on 11/7/24. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_HEXDUMP_H 6 | #define XPOSEDNHOOK_HEXDUMP_H 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include // for mincore 17 | #include // for sysconf 18 | 19 | 20 | // 将内存块按 hexdump 格式输出到日志缓冲区 21 | void hexdump_memory(std::stringstream &logbuf, const uint8_t* data, size_t size, uint64_t address) { 22 | size_t offset = 0; 23 | 24 | while (offset < size) { 25 | // 输出当前行的基址 26 | logbuf << std::hex << std::setw(8) << std::setfill('0') << (address + offset) << ": "; 27 | 28 | // 输出每一行的十六进制数据和ASCII字符 29 | std::string ascii; // 暂存 ASCII 字符串 30 | for (size_t i = 0; i < 16; ++i) { 31 | if (offset + i < size) { 32 | uint8_t byte = data[offset + i]; 33 | logbuf << std::setw(2) << std::setfill('0') << std::hex << static_cast(byte) << " "; 34 | ascii += (std::isprint(byte) ? static_cast(byte) : '.'); // 可打印字符直接显示,否则用 . 35 | } else { 36 | logbuf << " "; // 如果数据不足16字节,填充空格 37 | ascii += " "; 38 | } 39 | if (i == 7) logbuf << " "; // 中间分隔 40 | } 41 | 42 | // 输出 ASCII 表示 43 | logbuf << " |" << ascii << "|" << std::endl; 44 | offset += 16; 45 | } 46 | } 47 | 48 | 49 | 50 | 51 | #endif //XPOSEDNHOOK_HEXDUMP_H 52 | -------------------------------------------------------------------------------- /app/src/main/cpp/libs/arm64-v8a/libQBDI.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/cpp/libs/arm64-v8a/libQBDI.a -------------------------------------------------------------------------------- /app/src/main/cpp/libs/arm64-v8a/libdobby.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/cpp/libs/arm64-v8a/libdobby.a -------------------------------------------------------------------------------- /app/src/main/cpp/linker_hook.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/19. 3 | // 4 | 5 | #include "linker_hook.h" 6 | #include "elfio/elfio.hpp" 7 | #include "nhook.h" 8 | 9 | 10 | install_hook_name(android_dlopen_ext, void *, const char *filename, int flags, 11 | const void *extinfo) { 12 | void *ret = orig_android_dlopen_ext(filename, flags, extinfo); 13 | module_load(filename); 14 | return ret; 15 | } 16 | 17 | void hook_module_load() { 18 | void *address = get_address_from_module(get_linker_path(), "android_dlopen_ext"); 19 | if (address != nullptr) { 20 | install_hook_android_dlopen_ext(address); 21 | } else { 22 | LOGD("hook_module_load: android_dlopen_ext not found"); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/cpp/linker_hook.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/19. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_LINKER_HOOK_H 6 | #define XPOSEDNHOOK_LINKER_HOOK_H 7 | 8 | #include "utils.h" 9 | #include "dobby/dobby.h" 10 | #include 11 | 12 | void hook_module_load(); 13 | 14 | #endif //XPOSEDNHOOK_LINKER_HOOK_H 15 | -------------------------------------------------------------------------------- /app/src/main/cpp/nhook.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/19. 3 | // 4 | 5 | #include "nhook.h" 6 | 7 | #include "demo/qbdihook.h" 8 | #include "demo/ytbssl.h" 9 | #include "demo/modmenu_native.h" 10 | #include "linker_hook.h" 11 | #include 12 | #include 13 | #include "demo/il2cpp_dumper.h" 14 | #include "demo/md5.h" 15 | 16 | 17 | void md5(); 18 | 19 | extern "C" 20 | { 21 | 22 | JNIEXPORT void JNICALL 23 | Java_cn_mrack_xposed_nhook_NHook_initNativeHook(JNIEnv *env, jclass thiz, jobject context) { 24 | LOGD("initNativeHook"); 25 | gContext = env->NewGlobalRef(context); 26 | LOGD("test_QBDI"); 27 | test_QBDI(); 28 | LOGD("test_youtube"); 29 | 30 | 31 | // test_youtube(); 32 | // LOGD("dump_il2cpp"); 33 | // dumpIL2cpp(get_data_path(gContext)); 34 | } 35 | 36 | 37 | 38 | JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { 39 | LOGD("JNI_OnLoad"); 40 | JNIEnv *env; 41 | if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) { 42 | return -1; 43 | } 44 | 45 | jclass NHook = env->FindClass("cn/mrack/xposed/nhook/NHook"); 46 | 47 | 48 | gVm = vm; 49 | return JNI_VERSION_1_6; 50 | } 51 | 52 | } 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /app/src/main/cpp/nhook.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/19. 3 | // 4 | 5 | #ifndef NHOOK_H 6 | #define NHOOK_H 7 | 8 | #include 9 | #include 10 | 11 | void module_load(const char *filename); 12 | 13 | #endif -------------------------------------------------------------------------------- /app/src/main/cpp/utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/19. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_UTILS_H 6 | #define XPOSEDNHOOK_UTILS_H 7 | 8 | #include 9 | #include "dobby/dobby.h" 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef NDEBUG 15 | #define LOGD(...) 16 | #define LOGE(...) 17 | #define LOGI(...) 18 | #define LOGW(...) 19 | #else 20 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "MainHook", __VA_ARGS__) 21 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "MainHook", __VA_ARGS__) 22 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "MainHook", __VA_ARGS__) 23 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, "MainHook", __VA_ARGS__) 24 | #endif 25 | #define ANDROID_O 26 26 | #define ANDROID_O2 27 27 | #define ANDROID_P 28 28 | #define ANDROID_Q 29 29 | #define ANDROID_R 30 30 | #define ANDROID_S 31 31 | static int SDK_INT = -1; 32 | 33 | 34 | extern JavaVM *gVm; 35 | 36 | extern jobject gContext; 37 | 38 | const char *get_data_path(jobject context); 39 | 40 | int get_sdk_level(); 41 | 42 | char *get_linker_path(); 43 | 44 | std::pair find_info_from_maps(const char *soname); 45 | 46 | const char *find_path_from_maps(const char *soname); 47 | 48 | int boyer_moore_search(u_char *haystack, size_t haystackLen, u_char *needle, size_t needleLen); 49 | 50 | int search_hex(u_char *haystack, size_t haystackLen, const char *needle); 51 | 52 | uint64_t get_arg(DobbyRegisterContext *ctx, int index); 53 | 54 | void *get_address_from_module(const char *module_path, const char *symbol_name); 55 | 56 | #endif //XPOSEDNHOOK_UTILS_H 57 | -------------------------------------------------------------------------------- /app/src/main/cpp/vm.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mrack on 2024/4/19. 3 | // 4 | 5 | #ifndef XPOSEDNHOOK_VM_H 6 | #define XPOSEDNHOOK_VM_H 7 | 8 | #include "QBDI.h" 9 | #include 10 | #include "nhook.h" 11 | #include "dobby/dobby.h" 12 | #include 13 | 14 | 15 | void syn_regs(DobbyRegisterContext *ctx, QBDI::GPRState *state); 16 | 17 | #define LOGT(...) __android_log_print(ANDROID_LOG_DEBUG, "TRACER", __VA_ARGS__) 18 | 19 | class vm { 20 | 21 | public: 22 | QBDI::VM init(void *address); 23 | 24 | std::stringstream logbuf; 25 | private: 26 | }; 27 | 28 | 29 | #endif //XPOSEDNHOOK_VM_H 30 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/HookUtils.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Activity; 5 | import android.app.Application; 6 | import android.content.Context; 7 | import android.os.Bundle; 8 | import android.util.Log; 9 | 10 | import java.io.ByteArrayOutputStream; 11 | import java.io.File; 12 | import java.io.FileInputStream; 13 | import java.io.FileOutputStream; 14 | import java.security.MessageDigest; 15 | 16 | //import cn.mrack.so.arm64.SoData; 17 | import de.robv.android.xposed.XC_MethodHook; 18 | import de.robv.android.xposed.XposedHelpers; 19 | 20 | public class HookUtils { 21 | 22 | interface InitCallback { 23 | void onHook(Context context); 24 | } 25 | 26 | public static void attachApplication(InitCallback callback) { 27 | // hook application attach 28 | XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() { 29 | @Override 30 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 31 | // get the context 32 | Context context = (Context) param.args[0]; 33 | callback.onHook(context); 34 | } 35 | }); 36 | } 37 | 38 | public static void attachActivity(InitCallback callback) { 39 | XposedHelpers.findAndHookMethod(Activity.class, "onCreate", Bundle.class, new XC_MethodHook() { 40 | @Override 41 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 42 | Activity activity = (Activity) param.thisObject; 43 | callback.onHook(activity); 44 | } 45 | }); 46 | } 47 | 48 | public static void nativeHookInit(Context context) { 49 | // if (loadSo(context)) { 50 | // Log.d(TAG, "nativeHookInit: load so success"); 51 | // } else { 52 | // Log.e(TAG, "nativeHookInit: load so failed"); 53 | // } 54 | NHook.initNativeHook(context); 55 | } 56 | 57 | 58 | private static final String TAG = "HookUtils"; 59 | 60 | 61 | private static boolean verifyMd5(File file, String md5) { 62 | if (!file.exists()) { 63 | return false; 64 | } 65 | try { 66 | FileInputStream fileInputStream = new FileInputStream(file); 67 | byte[] buffer = new byte[1024]; 68 | int bytesRead; 69 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); 70 | while ((bytesRead = fileInputStream.read(buffer)) != -1) { 71 | byteArrayOutputStream.write(buffer, 0, bytesRead); 72 | } 73 | fileInputStream.close(); 74 | byte[] bytes = byteArrayOutputStream.toByteArray(); 75 | byteArrayOutputStream.close(); 76 | MessageDigest md = MessageDigest.getInstance("MD5"); 77 | byte[] fileMd5 = md.digest(bytes); 78 | StringBuilder sb = new StringBuilder(); 79 | for (byte b : fileMd5) { 80 | sb.append(Integer.toHexString((b & 0xFF) | 0x100).substring(1, 3)); 81 | } 82 | if (!sb.toString().equals(md5)) { 83 | return false; 84 | } 85 | return true; 86 | } catch (Exception e) { 87 | return false; 88 | } 89 | } 90 | 91 | // @SuppressLint("UnsafeDynamicallyLoadedCode") 92 | // private static boolean loadSo(Context context) { 93 | // try { 94 | // File file = context.getFileStreamPath("libnhook.so"); 95 | // String md5 = SoData.md5; 96 | // byte[] data = SoData.data; 97 | // if (!verifyMd5(file, md5)) { 98 | // FileOutputStream fileOutputStream = new FileOutputStream(file); 99 | // fileOutputStream.write(data); 100 | // fileOutputStream.close(); 101 | // } 102 | // System.load(file.getAbsolutePath()); 103 | // return true; 104 | // } catch (Exception e) { 105 | // Log.e(TAG, "loadSo: ", e); 106 | // return false; 107 | // } 108 | // } 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/MainHook.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | import android.util.Log; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import cn.mrack.xposed.nhook.menu.Menu; 10 | import cn.mrack.xposed.nhook.menu.PBoolean; 11 | import cn.mrack.xposed.nhook.menu.PInteger; 12 | import cn.mrack.xposed.nhook.menu.PString; 13 | import cn.mrack.xposed.nhook.menu.SurfaceImGUI; 14 | import de.robv.android.xposed.IXposedHookLoadPackage; 15 | import de.robv.android.xposed.XC_MethodReplacement; 16 | import de.robv.android.xposed.XposedHelpers; 17 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 18 | 19 | public class MainHook implements IXposedHookLoadPackage { 20 | private static final String TAG = "MainHook"; 21 | 22 | public static final boolean USE_NATIVE_MENU = true; 23 | 24 | private static final List packageList = new ArrayList() {{ 25 | add("com.google.android.youtube"); 26 | add("com.block.juggle"); 27 | add("com.tencent.tmgp.sgame"); 28 | add("com.colossi.survival.samurai"); 29 | }}; 30 | 31 | @Override 32 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) { 33 | if (lpparam.packageName.equals(BuildConfig.APPLICATION_ID)) { 34 | XposedHelpers.findAndHookMethod(BuildConfig.APPLICATION_ID + ".SettingsActivity", 35 | lpparam.classLoader, "isModuleActive", XC_MethodReplacement.returnConstant(Boolean.TRUE)); 36 | } else if (packageList.contains(lpparam.packageName)) { 37 | Log.d(TAG, "handleLoadPackage: " + lpparam.packageName + " loaded"); 38 | HookUtils.attachApplication(HookUtils::nativeHookInit); 39 | HookUtils.attachActivity(activity -> { 40 | if (USE_NATIVE_MENU){ 41 | createNativeMenu(activity); 42 | } else { 43 | createMenu(activity); 44 | } 45 | NHook.sign1("test sign trace"); 46 | }); 47 | } 48 | } 49 | 50 | private static void createNativeMenu(Context activity) { 51 | Menu menu = new Menu(activity); 52 | menu.attach(); 53 | menu.Surface(new SurfaceImGUI(activity)); 54 | } 55 | 56 | private static void createMenu(Context activity) { 57 | SharedPreferences sp = activity.getSharedPreferences("menu", Context.MODE_PRIVATE); 58 | Menu menu = new Menu(activity); 59 | menu.attach(); 60 | menu.Category("Value Change"); 61 | menu.Category("Value Change"); 62 | PBoolean value1 = PBoolean.of(sp, "test1", false); 63 | value1.setOnValueChangedListener((v, v1) -> { 64 | Log.d(TAG, "Switch: " + NHook.test111(v1 ? 1 : 0)); 65 | }); 66 | menu.Switch("Switch 1", value1); 67 | PInteger value = PInteger.of(sp, "test2", 0); 68 | value.setOnValueChangedListener((v, v1) -> { 69 | Log.d(TAG, "SeekBar: " + NHook.test111(v1)); 70 | }); 71 | menu.SeekBar("SeekBar 1", value, 0, 100, 5); 72 | 73 | menu.Category("Category 1"); 74 | menu.InputNum("InputNum 1", PInteger.of(0)); 75 | menu.InputText("InputText 1", PString.of("Hello World")); 76 | menu.Button("Button 1", PBoolean.of(sp, "test3", false)); 77 | menu.CheckBox("CheckBox 1", PBoolean.of(false)); 78 | menu.Switch("Switch 1", PBoolean.of(false)); 79 | menu.ButtonOnOff("Button 2", PBoolean.of(false)); 80 | menu.SeekBar("SeekBar 1", PInteger.of(0), 0, 100, 5); 81 | menu.CheckBox("CheckBox 2", PBoolean.of(false)); 82 | menu.ButtonLink("External Link ↗", "https://baidu.com"); 83 | menu.SeekBar("SeekBar 2", PInteger.of(0), -50, 100, 5); 84 | menu.SeekBar("SeekBar 3", PInteger.of(0), 0, 5); 85 | menu.RadioButton("Radio Button 1", new String[]{"Option 1", "Option 2", "Option 3"}, PInteger.of(0)); 86 | 87 | menu.startCollapse("Collapse 1"); 88 | 89 | menu.ButtonAction("Button 3", () -> { 90 | AlertDialog.Builder builder = new AlertDialog.Builder(activity); 91 | builder.setTitle("Alert"); 92 | builder.setMessage("This is an alert"); 93 | builder.setPositiveButton("OK", null); 94 | builder.show(); 95 | }); 96 | 97 | menu.ButtonLink("External Link ↗", "https://baidu.com"); 98 | menu.SeekBar("SeekBar 2", PInteger.of(0), -50, 100, 5); 99 | menu.SeekBar("SeekBar 3", PInteger.of(0), 0, 5); 100 | menu.Switch("Switch 1", PBoolean.of(false)); 101 | 102 | menu.endCollapse(); 103 | 104 | menu.TextView("This is a TextView not fully html supported. bold italic underline strikethrough color size face link"); 105 | 106 | menu.SeekBar("SeekBar 2", PInteger.of(0), -50, 100, 5); 107 | 108 | menu.WebTextView("" + "This is WebView, with REAL HTML support!" + "
Support CSS
" + "This is scrollable text" + ""); 109 | 110 | menu.SeekBar("SeekBar 3", PInteger.of(0), 0, 5); 111 | menu.RadioButton("Radio Button 1", new String[]{"Option 1", "Option 2", "Option 3"}, PInteger.of(0)); 112 | } 113 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/NHook.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook; 2 | 3 | import android.content.Context; 4 | 5 | public class NHook { 6 | public static native void initNativeHook(Context context); 7 | 8 | public static native String sign1(String data); 9 | 10 | public static native String test111(int value); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.preference.Preference; 6 | import android.preference.PreferenceFragment; 7 | import android.util.Log; 8 | 9 | public class SettingsActivity extends Activity { 10 | 11 | static { 12 | System.loadLibrary("nhook"); 13 | } 14 | 15 | public static class SettingsFragment extends PreferenceFragment { 16 | @Override 17 | public void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | addPreferencesFromResource(R.xml.settings); 20 | Preference moduleStatus = findPreference("module_status"); 21 | boolean active = isModuleActive(); 22 | Log.d("MainHook", "onCreate: " + active); 23 | moduleStatus.setEnabled(active); 24 | moduleStatus.setTitle(active ? "模块状态: [已激活]" : "模块状态: [未激活]"); 25 | HookUtils.nativeHookInit(getContext()); 26 | 27 | String sajdlaskkjdlaks = NHook.sign1("sajdlaskkjdlaks"); 28 | Log.d("MainHook", "onCreate: " + sajdlaskkjdlaks); 29 | 30 | Runtime rt=Runtime.getRuntime(); 31 | long maxMemory=rt.maxMemory(); 32 | Log.d("MainHook","当前最大内存空间 "+Long.toString(maxMemory/(1024*1024))); 33 | 34 | 35 | } 36 | } 37 | 38 | private static final String TAG = "SettingsActivity"; 39 | @Override 40 | public void onCreate(Bundle savedInstanceState) { 41 | super.onCreate(savedInstanceState); 42 | getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit(); 43 | } 44 | 45 | public static boolean isModuleActive() { 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/menu/Config.java: -------------------------------------------------------------------------------- 1 | 2 | package cn.mrack.xposed.nhook.menu; 3 | 4 | import android.graphics.Color; 5 | import android.text.Html; 6 | 7 | /** 8 | * Menu configuration 9 | */ 10 | public class Config { 11 | protected final int RADIO_BUTTON_COLOR = Color.parseColor("#FFFFFF"); 12 | protected final int COLLAPSE_BG_COLOR = Color.parseColor("#222D38"); 13 | protected final int NUMBER_TEXT_COLOR = Color.parseColor("#41c300"); 14 | protected final int SEEKBAR_NUMBER_NEG_COLOR = Color.parseColor("#FF0000"); 15 | protected final int SEEKBAR_NUMBER_POS_COLOR = Color.parseColor("#00FF00"); 16 | protected final int SEEKBAR_PROGRESS_COLOR = Color.parseColor("#80CBC4"); 17 | protected final int SEEKBAR_COLOR = Color.parseColor("#80CBC4"); 18 | protected final int CHECKBOX_COLOR = Color.parseColor("#80CBC4"); 19 | protected final String MENU_TITLE = Html.fromHtml("Moded By (your name)").toString(); 20 | protected final boolean MENU_TITLE_ENABLE = false; 21 | protected final String MENU_SUBTITLE = "https://site.com lorem ipsum dolor sit amet consectetur adipiscing elit"; 22 | protected final boolean MENU_SUBTITLE_ENABLE = false; 23 | protected final int MENU_WIDTH = 290; 24 | protected final int MENU_HEIGHT = 210; 25 | protected final int MENU_BG_COLOR = Color.parseColor("#EE1C2A35"); 26 | protected final int MENU_FEATURE_BG_COLOR = Color.parseColor("#DD141C22"); 27 | protected final int TEXT_COLOR_PRIMARY = Color.parseColor("#82CAFD"); 28 | protected final int TEXT_COLOR_SECONDARY = Color.parseColor("#FFFFFF"); 29 | protected final float MENU_COLLAPSED_ALPHA = 0.9f; 30 | protected final int MENU_BUTTON_BG_COLOR = Color.parseColor("#1C262D"); 31 | protected final int MENU_CATEGORY_BG_COLOR = Color.parseColor("#2F3D4C"); 32 | protected final String MENU_HIDE_BUTTON_TEXT = Html.fromHtml("△").toString(); 33 | protected final String MENU_CLOSE_BUTTON_TEXT = Html.fromHtml("✕").toString(); 34 | protected final int BTN_ON_BG_COLOR = Color.parseColor("#1b5e20"); 35 | protected final int BTN_OFF_BG_COLOR = Color.parseColor("#7f0000"); 36 | protected final int MENU_LAUNCHER_ICON_SIZE = 42; 37 | protected final String MENU_LAUNCHER_ICON = "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAADNNJREFUeF7tnV1oXMcVgM/M/VnJWksrZeW1ZceWLSUFUUip+0tf8lAoFAqFQKCUQAvFD23zFCdxmj7ch7b5f3Kbh1BooZRCIFAoFAp5yEvpb0oDxdBEtmVHli2vIkvyytLuvTPTzl2vvPrZ3bl7586MdEevmjnnzDnfzp2fMzMIDuLfTOCPw22/URv2BrzIIw3sUt9zfEIc5gEmBLl7NdtxWIRCoA3HIbgREsen0Wbohn5xLazCkQZcChoHzV1o3zfo8cAt37w36ER0MIRCwWGNAQZuJu1CEDGC/E0P6nXi4o2lY4c24L0g2s8+zMRRWTukUjk/BEUYqhP3kIuRn7W+bvJdyhrMie5BDdYXF19f12lLP7r3DQA86HQQHQbHKTKGcD+NzboOQowCITW8we7uFxjMBmAm8CciGI5oNEIpcbIOoEz5GDvExe7qggtrJo8djASA/9qJj0fAc4oyg6JNVkhqToOumtgrGAXA+ExQJPVwFDM6qC1YGSqmCG84Be9O9VJQy1BNItFGAMB/8WGxMHZQA78zIhwEr1ZfNqFH0ArA9PTThZX64EMHpqtP9NsDgJDUSoWNT2ZnL9aTVpVVXhsAE48G5UZUH5PVkP0sx3cLywsfBks62qAcgPGZ7xede8PlSPP8XYeze60nkENrS9VLbyodHygFoDJ1/ghhXsk055tkj4PClcXLr99WZZMSACYng4EVdLfiIr+gqmH7WU/EGvUSO7w4NxdsZt2OzAEYPfP8iAO4knVDDqJ8AnTxzpVXVrNsW6YAHJ1+YTyiMJplAw66bBfDnVuzL1WzamdWAKDyw88dy+30Tna0QlJb+vjVmwDAZIvOAIC3nbGpDybysqgjOyCd5PHFo+XL3v8hkLv9LBeAs+e80vL4hIuoHexlQEbEcH1lrLoA778VyhIvD4CZwK+s144Tx/NkGWfl7PaAQ8Jwcah4Q9YOoxwAzp7zKkvDJ2zw1SAbQ1Bem5fRE0gAIHBLp8PjtttXE/yWlvhzcPWxeYAnSRrNaQFAY1MvnrADvjQh6L9uc2D40/k0s4NUAJQffm7CTvX6D6CUms0p4kK/svoGwC7y9Oty+fXSLBb1BYBd3pUfxLQS+102TgwA39ip4frJtAbb+vI9UKSF60k3kBIDUDr9zCm7qyc/eDIk8l3ElatvXEsiKxEAdj8/iWv1lE2aTyAMAM/kYZsjE3qaZbUm8QAaWF0QzSwSBuDo5IVJm8aVJAz6yvLjarfmXp4TsUAIAJvAKeJKs8qIJpr2BCBO3abFU2Y1z1oj4oESrl3rlXLeEwC72ifiakPLCKwSdgUgPqM35B1X3TyKcBkx+AwAOwGMDaXSj9A6AJpnCP6NGU2de08pGcPYKQOgYQQszntggOoAbI1SsoSxs5zKXsmVnfXwRrcTSF0BGJt68WG1Gz14mCH4ITD2dcl+aIpD6I+Iwc8B6Foi+RgVGYFPA6BHAGiPtHa8AsA+Qg78ByhTmuO/V5vubxh93Km9HQHgBzXZZl3htI8Hn10EBlOJgpO0MILLiKGnRSFgDL4IAF9IquZ++b8jBH/rs660amigsNDpQGpHAFT/+hnCP8rsl7/TlXFPQH/WzcMM2AgA/iowlu5HgNACAH0XAco0vbtbW7r1AnsCoPrb3/zms99LQ15AEEPom53GBBjBOGPoGzTt+OO+HRihdYTYHyiDzNK7ezW501hgTwBUj/wZ/6UBC3o1Qu7/UYCAvrtTJv/lY8BPyAp+Sz6HgAJ9R1tP0GFGsBuAmcAvb9Yn5Tq7uzQG6DsA8D2VOgHglwjYr3cDgJ5I3e13HHGhBQTsHcXt3FK3NFCY25lMugsAHat+jMEPAKFvKXUMY79DCH7RrjPlgE/UfG0Dw71WB3cBcGT6x1OqL2QyAoB4qse+KxrFNOWQg36lY4rIL666PfuTy+22bwNA9eCvZYgJADCGvgTAPp8msOJ10T8QYn8VLy+v5M7B4DYAxiefPcqwOyxPnZgkMwDAT/Ve5BFrT+9SeAUh+pve5eSXQDRaq869dqsleTsAUxemdVzCqBsAvryLkPNt+e7uLJEx8lsdy8b8Msvq5ZdndwGgq/vnhugGAAAeZQy+phIAhOBPAPChSp0tXe2fga0eQGe6l34A0OcYY19WGQyE0F8A2D9V6twCoO0ami0AdGb86AYAAXyFMvisymBgBP9iAH9WqbOlK6KssXI/Y6gJAL9y/Xr9jA5jTPgE5A0A7vOlk4Ur/Kr7GIDyp547DKFzLK8AAOTrExDH2SM3l/776t0YAJ3ffxN6gLwNArnPW+njMQCqt3539jS6xwB5mga2fN/aIo4BGD/z7CNZPbMi8lnRDUCzF8rHQtCD+X/Eqlde+wiBht0/03qAJgD5WApu9z3fHUQmnPgxoQeAHGwG7fzh8RNEaOTkhVHPReMiXXVWZYwAoLkimSb/T9Q92raDdxoYRqyKdM8A4u7XJoSIwiO1HJ8J8Bs9tV/zYlPCpMZVXFhIavySJ8W5/7vts0mh4jGTWZJPBZHOPYD2xti0cJmhFZPFTxGjyiMXznR6S1dMjKxS9mCILE+KyonfSi6feeFR0QrZl7NHw7L38XYNhgHQNM4eDlWHgZEAqGu+1WQByDkDRgKg+xOgW79KJg0DQPcgULd+laFv6rLTwC2fmzkNzRKJeBpoF4KaLjZtISrLwLdkxwtBdim4Ne00534CFcG/P93esJtB8W6kOfcTqAp+rIdvBtntYLO2o1UCEG8H24QQI46mqYz7lq44IcSmhOUXgDglzCaF5heAOCmU9wd5Tws3JSdR5XcAQSst3B4MMeF4usrYt3Zc+ZNzH9ujYWbcT6AcgG1Hw/J+ODSPn4Bth0Pzfjw8jwBsOx7O+5/S5IVJFyNfeV9kQBecNwDan5SxV8QYAKDqH137y2IPAND0OES8E6f5plDd+pUD0PaIhL0mzgAAVQLQ8Zq4eEEopxdF5qkH6HpRpK67AnUHQLd+lT1A16tiuSF5vCw6LwD0vCyaA5DH6+LzAoDQdfE6dgd13w+gW7+qT4DQgxHcGNV3BuhOydKtXwkAwk/G8HsDFa8J6L4fQLd+FQAkejSKG6Q6W1h3WrZu/VlCkPjZuHhNIHcPRx7cgyF9PRypoxcA0H00S7d++f1A30/HclNUjwVazdd9OFO3fpkYpHo8WseMQGbjcy8r7fPx3IHT008XVmjxVO6duQ8dUMK1a7OzF+vdTO/6fHyroo7VwX3ob6NM3mvVby8DhQDgFU05RWyUlw01pj3jp5eJwgCYcIKoV2Ps/5se4Cd+qpferIn4QxiAeFYwdf4IYV5JRLAto8cD7eleIhYkAoALLJ1+5pSL/IKIcFtGrQci1qivXH3jWhKtiQGYnAwGarh+MokSW1aNB4q0cH1uLthMoi0xAFz46JnnRxzAlSSKbNlsPUCALt658spqUi19ARDPCqZfGI8ojCZVaMvL94CL4c6t2Zeq/UjuGwCuTHXeQD8NPPB1BFb7uvkgFQB8xjE29eIJzOjggXe0gQ28v9EzH19z1OdfWgAA4G2ndPqDEy6idmbQZxD6qRYxXF+56t0ACKJ+6rfqSAAAAM6e8ypLwyeI43lpjLF1xTzgkDBcLK/Nw/tvhWI1OpeSAwCXPxP4lfXacQtB2pB0rx8Hf6h4Ay4FDRma5AHArTl7zistj0/Yz4GM0OyWEXf7Y9UFGb98uZ+AbbYG7thUeMwODOVC0BzwPbYA8CSRKVluD/DAMn4D6THwnKJMY3MrqznVu5lmtN/Jd1kBEOuzi0XpkU2zyCOiPVMAuAF22VgkDHuX6Xd5N4nGzAHgxvANpBV0t2J3EcVCw3f1SuzwYtKNHTHp20spAaCl0uYT9A5R0v383hK7l1AKADeFZxY594bLkaYLqdI6LKv6PI2LHFpbEs3kkWWHcgBahttE0wchFE3glBX0djnaAOBGxCnn9cGHcjtdDEmtVNj4pFfqdhaBb8nUCsDW2KByfigsFsbysnjEF3W8Wn15cfH19SyDKyLbCABahvIDqaQejh5UEHjgnYJ3p3opEMrYFQlg2jJGAdDeIxAfjxyYT0NIak6Drprwi98JjJEAbBk5E/gTEQxHNBqhlDhpaVdZn1/I5GJ3dcGFNVk7d1nYbzYAbS3mJ5XpIDoMjlNkDOEsnJFWJr+EEQip4Q1218Rf+17t2zcAtBvPYYAiDCHiHtK9nhBR1ig40T2owfp+Cbox08C0v7i4/uOBW755b9CJ6GAIhYLDGgMM3EzA5s+sEORvelCvExdvLB07tAHvpUvJkuKDFEIycVQKe+RUnQn8cbjtN2rD3oAXeaSBXep7jk+IwzzAhCB3L0XxW7oh0IbjENwIiePTaDN0Q7+4FlbhSMPkb3m/jvsfyER0DjwqKGYAAAAASUVORK5CYII="; 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/menu/PBoolean.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook.menu; 2 | 3 | 4 | import android.content.SharedPreferences; 5 | 6 | /** 7 | * Wrapper class for primitive boolean, to be used as a parameter for Menu 8 | */ 9 | public class PBoolean extends PValue { 10 | public PBoolean(SharedPreferences sp, String key, Boolean value) { 11 | super(sp, key, value); 12 | } 13 | 14 | public PBoolean(Boolean value) { 15 | super(value); 16 | } 17 | 18 | public static PBoolean of(SharedPreferences sp, String key, Boolean value) { 19 | return new PBoolean(sp, key, value); 20 | } 21 | 22 | public static PBoolean of(Boolean value) { 23 | return new PBoolean(value); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/menu/PInteger.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook.menu; 2 | 3 | 4 | import android.content.SharedPreferences; 5 | 6 | /** 7 | * Wrapper class for primitive int, to be used as a parameter for Menu 8 | */ 9 | public class PInteger extends PValue { 10 | public PInteger(SharedPreferences sp, String key, Integer value) { 11 | super(sp, key, value); 12 | } 13 | 14 | public PInteger(Integer value) { 15 | super(value); 16 | } 17 | 18 | public static PInteger of(SharedPreferences sp, String key, Integer value) { 19 | return new PInteger(sp, key, value); 20 | } 21 | 22 | public static PInteger of(Integer value) { 23 | return new PInteger(value); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/menu/PString.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook.menu; 2 | 3 | import android.content.SharedPreferences; 4 | 5 | /** 6 | * Wrapper class for primitive String, to be used as a parameter for Menu 7 | */ 8 | public class PString extends PValue { 9 | public PString(SharedPreferences sp, String key, String value) { 10 | super(sp, key, value); 11 | } 12 | 13 | public PString(String value) { 14 | super(value); 15 | } 16 | 17 | public static PString of(SharedPreferences sp, String key, String value) { 18 | return new PString(sp, key, value); 19 | } 20 | 21 | public static PString of(String value) { 22 | return new PString(value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/menu/PValue.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook.menu; 2 | 3 | import android.content.SharedPreferences; 4 | 5 | public class PValue { 6 | public interface onValueChangedListener { 7 | void onValueChanged(T v, T v1); 8 | } 9 | 10 | private T value; 11 | private SharedPreferences sp; 12 | private String key; 13 | 14 | public PValue(SharedPreferences sp, String key, T value) { 15 | this.sp = sp; 16 | if (value instanceof Boolean) { 17 | this.value = (T) Boolean.valueOf(sp.getBoolean(key, (Boolean) value)); 18 | } else if (value instanceof Integer) { 19 | this.value = (T) Integer.valueOf(sp.getInt(key, (Integer) value)); 20 | } else if (value instanceof String) { 21 | this.value = (T) sp.getString(key, (String) value); 22 | } else { 23 | this.value = value; 24 | } 25 | this.key = key; 26 | } 27 | 28 | public PValue(T value) { 29 | this.value = value; 30 | } 31 | 32 | public T get() { 33 | return value; 34 | } 35 | 36 | public void set(T value) { 37 | T oldValue = this.value; 38 | this.value = value; 39 | if (listener != null) { 40 | listener.onValueChanged(oldValue, value); 41 | } 42 | if (sp != null){ 43 | if (value instanceof Boolean) { 44 | sp.edit().putBoolean(key, (Boolean) value).apply(); 45 | } else if (value instanceof Integer) { 46 | sp.edit().putInt(key, (Integer) value).apply(); 47 | } else if (value instanceof String) { 48 | sp.edit().putString(key, (String) value).apply(); 49 | } 50 | } 51 | } 52 | 53 | private onValueChangedListener listener; 54 | 55 | public void setOnValueChangedListener(onValueChangedListener listener) { 56 | this.listener = listener; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/cn/mrack/xposed/nhook/menu/SurfaceImGUI.java: -------------------------------------------------------------------------------- 1 | package cn.mrack.xposed.nhook.menu; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.Path; 8 | import android.graphics.PixelFormat; 9 | import android.os.RemoteException; 10 | import android.util.AttributeSet; 11 | import android.util.Log; 12 | import android.view.Surface; 13 | import android.view.SurfaceHolder; 14 | import android.view.SurfaceView; 15 | import android.view.WindowManager; 16 | 17 | public class SurfaceImGUI extends SurfaceView implements SurfaceHolder.Callback { 18 | 19 | private static final String TAG = "SurfaceImGUI"; 20 | public static native void initImGUI(Surface surface); 21 | 22 | public static native void destroyImGUI(); 23 | 24 | public static native void setOrientationImGUI(int orientation); 25 | 26 | public final WindowManager wms; 27 | 28 | @Override 29 | protected void onDetachedFromWindow() { 30 | super.onDetachedFromWindow(); 31 | Log.d(TAG, "onDetachedFromWindow: "); 32 | } 33 | 34 | @Override 35 | protected void onAttachedToWindow() { 36 | super.onAttachedToWindow(); 37 | Log.d(TAG, "onAttachedToWindow: "); 38 | } 39 | 40 | public SurfaceImGUI(Context context) { 41 | super(context); 42 | setZOrderOnTop(true); 43 | SurfaceHolder holder = getHolder(); 44 | holder.setFormat(PixelFormat.TRANSPARENT); 45 | getHolder().addCallback(this); 46 | wms = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 47 | } 48 | 49 | @Override 50 | public void surfaceCreated(SurfaceHolder surfaceHolder) { 51 | new Thread( () ->{ 52 | initImGUI(surfaceHolder.getSurface()); 53 | }).start(); 54 | } 55 | 56 | @Override 57 | public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) { 58 | setOrientationImGUI(wms.getDefaultDisplay().getRotation()); 59 | } 60 | 61 | @Override 62 | public void surfaceDestroyed(SurfaceHolder surfaceHolder) { 63 | destroyImGUI(); 64 | } 65 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | XposedNHook 3 | -------------------------------------------------------------------------------- /app/src/main/res/xml/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | plugins { 3 | alias(libs.plugins.androidApplication) apply false 4 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. For more details, visit 12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Enables namespacing of each library's R class so that its R class includes only the 19 | # resources declared in the library itself and none from the library's dependencies, 20 | # thereby reducing the size of the R class for that library 21 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | agp = "7.4.2" 3 | 4 | [libraries] 5 | 6 | [plugins] 7 | androidApplication = { id = "com.android.application", version.ref = "agp" } 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaotujinbnb/QBDI_trace_demo/c1123bf3bfe0dd2fe76aeb0bed4ff8de71d83e28/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 19 14:57:34 CST 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Wed Nov 13 00:23:53 CST 2024 8 | sdk.dir=/Users/ligoudan/Library/Android/sdk 9 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name "aliyunmaven" 5 | url "https://maven.aliyun.com/repository/public" 6 | } 7 | maven { 8 | name "aliyunGoogle" 9 | url "https://maven.aliyun.com/repository/google" 10 | } 11 | maven { url 'https://www.jitpack.io' } 12 | google { 13 | content { 14 | includeGroupByRegex("com\\.android.*") 15 | includeGroupByRegex("com\\.google.*") 16 | includeGroupByRegex("androidx.*") 17 | } 18 | } 19 | mavenCentral() 20 | gradlePluginPortal() 21 | 22 | } 23 | } 24 | dependencyResolutionManagement { 25 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 26 | repositories { 27 | maven { 28 | name "aliyunmaven" 29 | url "https://maven.aliyun.com/repository/public" 30 | } 31 | maven { 32 | name "aliyunGoogle" 33 | url "https://maven.aliyun.com/repository/google" 34 | } 35 | maven { url 'https://www.jitpack.io' } 36 | google() 37 | mavenCentral() 38 | } 39 | } 40 | 41 | rootProject.name = "XposedNHook" 42 | include ':app' 43 | --------------------------------------------------------------------------------