[skip ci] Replace submodule Dobby by LSPlt

It remains to implement HookFunction and UnhookFunction with LSPlt
This commit is contained in:
JingMatrix 2024-08-28 20:29:33 +02:00
parent 16c09cefce
commit 42cf1c2fd5
11 changed files with 14 additions and 14 deletions

6
.gitmodules vendored
View File

@ -1,9 +1,9 @@
[submodule "external/lsplant"]
path = external/lsplant
url = https://github.com/JingMatrix/LSPlant.git
[submodule "external/dobby"]
path = external/dobby
url = https://github.com/chiteroman/Dobby.git
[submodule "external/lsplt"]
path = external/lsplt
url = https://github.com/LSPosed/LSPlt
[submodule "external/fmt"]
path = external/fmt
url = https://github.com/fmtlib/fmt.git

View File

@ -58,9 +58,10 @@ You can contribute translation [here](https://crowdin.com/project/lsposed_jingma
- [Magisk](https://github.com/topjohnwu/Magisk/): makes all these possible
- [Riru](https://github.com/RikkaApps/Riru): provides a way to inject code into zygote process
- [XposedBridge](https://github.com/rovo89/XposedBridge): the OG Xposed framework APIs
- [Dobby](https://github.com/chiteroman/Dobby): used for inline hooking
- [LSPlt](https://github.com/LSPosed/LSPlt): used for inline hooking
- [LSPlant](https://github.com/JingMatrix/LSPlant): the core ART hooking framework
- [EdXposed](https://github.com/ElderDrivers/EdXposed): fork source
- ~[Dobby](https://github.com/chiteroman/Dobby): used for inline hooking~
- ~[SandHook](https://github.com/ganyao114/SandHook/): ART hooking framework for SandHook variant~
- ~[YAHFA](https://github.com/rk700/YAHFA): previous ART hooking framework~
- ~[dexmaker](https://github.com/linkedin/dexmaker) and [dalvikdx](https://github.com/JakeWharton/dalvik-dx): to dynamically generate YAHFA hooker classes~

View File

@ -12,5 +12,5 @@ add_library(${PROJECT_NAME} STATIC ${SRC_LIST})
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_include_directories(${PROJECT_NAME} PRIVATE src)
target_link_libraries(${PROJECT_NAME} PUBLIC dobby_static lsplant_static log fmt-header-only)
target_link_libraries(${PROJECT_NAME} PUBLIC lsplt_static lsplant_static log fmt-header-only)
target_link_libraries(${PROJECT_NAME} PRIVATE dex_builder_static)

View File

@ -19,7 +19,6 @@
*/
#include <dlfcn.h>
#include "dobby.h"
#include <sys/mman.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
@ -83,7 +82,8 @@ inline int HookFunction(void *original, void *replace, void **backup) {
info.dli_sname ? info.dli_sname : "(unknown symbol)", info.dli_saddr,
info.dli_fname ? info.dli_fname : "(unknown file)", info.dli_fbase);
}
return DobbyHook(original, reinterpret_cast<dobby_dummy_func_t>(replace), reinterpret_cast<dobby_dummy_func_t *>(backup));
/* return DobbyHook(original, reinterpret_cast<dobby_dummy_func_t>(replace), reinterpret_cast<dobby_dummy_func_t *>(backup)); */
return 1;
}
inline int UnhookFunction(void *original) {
@ -94,7 +94,8 @@ inline int UnhookFunction(void *original) {
info.dli_sname ? info.dli_sname : "(unknown symbol)", info.dli_saddr,
info.dli_fname ? info.dli_fname : "(unknown file)", info.dli_fbase);
}
return DobbyDestroy(original);
/* return DobbyDestroy(original); */
return 1;
}
inline std::string GetNativeBridgeSignature() {

View File

@ -26,7 +26,6 @@
#include "logging.h"
#include "utils/hook_helper.hpp"
#include <sys/mman.h>
#include <dobby.h>
#include <list>
#include <dlfcn.h>
#include "native_util.h"

View File

@ -24,7 +24,6 @@
#include "symbol_cache.h"
#include "elf_util.h"
#include <dobby.h>
#include "macros.h"
#include "config.h"
#include <vector>

View File

@ -225,7 +225,7 @@ void Logcat::ProcessBuffer(struct log_msg *buf) {
shortcut = true;
}
if (verbose_ && (shortcut || buf->id() == log_id::LOG_ID_CRASH ||
entry.pid == my_pid_ || tag == "Magisk"sv || tag == "Dobby"sv ||
entry.pid == my_pid_ || tag == "Magisk"sv || tag == "LSPlt"sv ||
tag.starts_with("Riru"sv) || tag.starts_with("zygisk"sv) ||
tag == "LSPlant"sv || tag.starts_with("LSPosed"sv))) [[unlikely]] {
verbose_print_count_ += PrintLogLine(entry, verbose_file_.get());

View File

@ -103,7 +103,8 @@ target_include_directories(cxx PRIVATE ${LIBCXX_INCLUDES} ${LIBCXXABI_INCLUDES})
link_libraries(cxx)
OPTION(LSPLANT_BUILD_SHARED OFF)
OPTION(LSPLT_BUILD_SHARED OFF)
add_subdirectory(lsplant/lsplant/src/main/jni)
add_subdirectory(dobby)
add_subdirectory(lsplt/lsplt/src/main/jni)
add_subdirectory(fmt)
target_compile_definitions(fmt-header-only INTERFACE FMT_STATIC_THOUSANDS_SEPARATOR=1 FMT_USE_FLOAT=0 FMT_USE_DOUBLE=0 FMT_USE_LONG_DOUBLE=0)

1
external/dobby vendored

@ -1 +0,0 @@
Subproject commit 7447fd9209bb43eba1e307f84df17613af5203dd

1
external/lsplt vendored Submodule

@ -0,0 +1 @@
Subproject commit cef80a97a73184b4def9b3e1148884365fc173fd

View File

@ -21,7 +21,6 @@
// Created by loves on 2/7/2021.
//
#include <dobby.h>
#include <thread>
#include <atomic>
#include <android/sharedmem.h>