diff --git a/IDA 7.0.rar b/IDA 7.0.rar deleted file mode 100644 index 1aef2d300..000000000 Binary files a/IDA 7.0.rar and /dev/null differ diff --git a/anticheat/libtersafe.idb b/anticheat/libtersafe.idb index c41993f0a..204db8d8f 100644 Binary files a/anticheat/libtersafe.idb and b/anticheat/libtersafe.idb differ diff --git a/il2cpp_dump.so b/il2cpp_dump.so deleted file mode 100644 index d999b2667..000000000 Binary files a/il2cpp_dump.so and /dev/null differ diff --git a/ligma-cheat/ligma-cheat/bypass/bypass.cpp b/ligma-cheat/ligma-cheat/bypass/bypass.cpp index ad840252e..514aa442a 100644 --- a/ligma-cheat/ligma-cheat/bypass/bypass.cpp +++ b/ligma-cheat/ligma-cheat/bypass/bypass.cpp @@ -4,37 +4,44 @@ namespace ligma { namespace bypass { - // - // do not call anything that will call dlopen inside of callback.... - // - __attribute__((noinline)) void init(const std::function& callback) { ligma::utils::on_image_load("libil2cpp.so", callback); - ligma::utils::on_image_load("libxlua.so", [&](std::uintptr_t module_base, void* module_handle) -> bool - { - LOGI("libxlua.so base = %p", module_base); - ligma::hook::make_hook( - dlsym(dlopen("libxlua.so", RTLD_NOLOAD), "luaL_loadbufferx"), - reinterpret_cast(&load_bufferx_hook) - ); - LOGI("installed libxlua.so hooks!"); - return false; - }); + ligma::utils::on_image_load("libxlua.so", + [&](std::uintptr_t module_base, void* module_handle) -> bool + { + LOGI("libxlua.so base -> %p, module_handle -> %p", module_base, module_handle); + ligma::hook::make_hook(dlsym(module_handle, "luaL_loadbufferx"), &load_bufferx_hook); + LOGI("installed libxlua.so hooks!"); + return false; + } + ); - // TODO: add more hooks on libtersafe.so with dlsym_hook... - ligma::utils::on_image_load("libtersafe.so", [&](std::uintptr_t module_base, void* module_handle) -> bool - { - LOGI("libtersafe.so = %p", module_base); - return false; - }); + ligma::utils::on_image_load("libtersafe.so", + [&](std::uintptr_t module_base, void* module_handle) -> bool + { + LOGI("libtersafe.so -> %p, module_handle -> %p", module_base, module_handle); + + // all imports just return null now.... + ligma::hook::dlsym_hook({ module_handle, "^.*" }, &null_sub); + return false; + } + ); fopen_ptr = dlsym(dlopen("libc.so", RTLD_NOLOAD), "fopen"); system_prop_get = dlsym(dlopen("libc.so", RTLD_NOLOAD), "__system_property_get"); + ligma::hook::make_hook(fopen_ptr, reinterpret_cast(&fopen_hook)); ligma::hook::make_hook(system_prop_get, reinterpret_cast(&system_property_hook)); } + __attribute__((noinline)) + int null_sub() + { + LOGI("null_sub called, return -> null...."); + return NULL; + } + // // dont let a single lua script load! // @@ -77,12 +84,12 @@ namespace ligma system_prop_mutex.unlock(); // - // dont spoof persist.sys.timezone or these other ones. + // few things we dont spoof... // - if (strcmp(name, "persist.sys.timezone") != 0 && - strcmp(name, "ro.build.fingerprint") != 0 && - strcmp(name, "ro.revision") != 0 && - strcmp(name, "ro.build.version.sdk") != 0) + if (!strcmp(name, "persist.sys.timezone") && + !strcmp(name, "ro.build.fingerprint") && + !strcmp(name, "ro.revision") && + !strcmp(name, "ro.build.version.sdk")) value = HWID_VALUE; return strlen(value); diff --git a/ligma-cheat/ligma-cheat/bypass/bypass.h b/ligma-cheat/ligma-cheat/bypass/bypass.h index 1c0421eb3..24045621e 100644 --- a/ligma-cheat/ligma-cheat/bypass/bypass.h +++ b/ligma-cheat/ligma-cheat/bypass/bypass.h @@ -19,6 +19,7 @@ namespace ligma inline std::mutex system_prop_mutex; void init(const std::function& callback); + int null_sub(); FILE* fopen_hook(const char* path, const char* mode); int system_property_hook(const char* name, char* value); int load_bufferx_hook(void* L, const char* buff, size_t sz, const char* name, const char* mode); diff --git a/ligma-cheat/ligma-cheat/hooks/dlsym_hook.cpp b/ligma-cheat/ligma-cheat/hooks/dlsym_hook.cpp index d93be2622..84ad1d3c1 100644 --- a/ligma-cheat/ligma-cheat/hooks/dlsym_hook.cpp +++ b/ligma-cheat/ligma-cheat/hooks/dlsym_hook.cpp @@ -1,5 +1,4 @@ #include "dlsym_hook.h" -#include "../ligma.h" namespace ligma { @@ -26,24 +25,17 @@ namespace ligma __attribute__((noinline)) void* dlsym_handler(void* handle, const char* symbol) { - LOGI("dlsym hook called! handle = %p, symbol = %s", handle, symbol); - try - { - return get_dlsym_hooks()->at({ handle, symbol }); - } - catch (std::out_of_range& e) - {} + for (const auto& [map_handle, function_ptr] : *get_dlsym_hooks()) + if (map_handle.first == handle) + if(std::regex_match(symbol, std::regex(map_handle.second.data()))) + return function_ptr; + return dlsym_bypass(handle, symbol); } - void dlsym_unhook(const std::pair& symbol_data) + void dlsym_unhook(const std::pair& symbol_data) { - try - { - get_dlsym_hooks()->erase(symbol_data); - } - catch (std::out_of_range& e) - {} + get_dlsym_hooks()->erase(symbol_data); } } } \ No newline at end of file diff --git a/ligma-cheat/ligma-cheat/hooks/dlsym_hook.h b/ligma-cheat/ligma-cheat/hooks/dlsym_hook.h index 3498bb138..b3996a14a 100644 --- a/ligma-cheat/ligma-cheat/hooks/dlsym_hook.h +++ b/ligma-cheat/ligma-cheat/hooks/dlsym_hook.h @@ -3,6 +3,7 @@ #include #include #include +#include #include "shithook.h" #define LOGI(...) ((void)__android_log_print(4, "ligma", __VA_ARGS__)) @@ -18,7 +19,7 @@ namespace ligma void* dlsym_bypass(void* handle, const char* symbol); void* dlsym_handler(void* handle, const char* symbol); auto get_dlsym_hooks() -> std::map, void*>*; - void dlsym_unhook(const std::pair& symbol_data); + void dlsym_unhook(const std::pair& symbol_data); template inline void dlsym_hook(std::pair symbol_data, T* function_ptr) @@ -35,7 +36,7 @@ namespace ligma { { symbol_data.first, - std::string_view{ symbol_data.second } + std::string_view{symbol_data.second} }, reinterpret_cast(function_ptr) }