diff --git a/CODM/CODM.sln b/CODM/CODM.sln deleted file mode 100644 index 3fbb68474..000000000 --- a/CODM/CODM.sln +++ /dev/null @@ -1,43 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30320.27 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CODM", "CODM\CODM.vcxproj", "{6EE844B7-1769-42F3-82FB-82A10D01272B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|ARM.ActiveCfg = Debug|ARM - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|ARM.Build.0 = Debug|ARM - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|ARM64.Build.0 = Debug|ARM64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|x64.ActiveCfg = Debug|x64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|x64.Build.0 = Debug|x64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|x86.ActiveCfg = Debug|x86 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Debug|x86.Build.0 = Debug|x86 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|ARM.ActiveCfg = Release|ARM - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|ARM.Build.0 = Release|ARM - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|ARM64.ActiveCfg = Release|ARM64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|ARM64.Build.0 = Release|ARM64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|x64.ActiveCfg = Release|x64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|x64.Build.0 = Release|x64 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|x86.ActiveCfg = Release|x86 - {6EE844B7-1769-42F3-82FB-82A10D01272B}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AA4AF7D4-313A-4E67-BB19-A824143D917C} - EndGlobalSection -EndGlobal diff --git a/CODM/CODM/CODM.vcxproj.filters b/CODM/CODM/CODM.vcxproj.filters deleted file mode 100644 index 2d7470dc0..000000000 --- a/CODM/CODM/CODM.vcxproj.filters +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {2b8b1874-15b5-4680-a2ec-0f2fca832098} - - - {3299c48f-c301-4b0c-8a25-a26bc0c92311} - - - - - Source - - - \ No newline at end of file diff --git a/CODM/CODM/main.cpp b/CODM/CODM/main.cpp deleted file mode 100644 index 0fdb76b82..000000000 --- a/CODM/CODM/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "CODM", __VA_ARGS__)) -#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "CODM", __VA_ARGS__)) - -// -// code runs on image load :) -// -__attribute__((constructor)) -void init() -{ - LOGI("> hello world!"); -} \ No newline at end of file diff --git a/IDA 7.0.rar b/IDA 7.0.rar new file mode 100644 index 000000000..1aef2d300 Binary files /dev/null and b/IDA 7.0.rar differ diff --git a/cod-mobile-dump.rar b/cod-mobile-dump.rar deleted file mode 100644 index 8f78353b4..000000000 Binary files a/cod-mobile-dump.rar and /dev/null differ diff --git a/libtersafe (anti cheat)/README.md b/libtersafe (anti cheat)/README.md deleted file mode 100644 index 91cdbfa70..000000000 --- a/libtersafe (anti cheat)/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Overview - -This anti cheat is usermode and mostly cares about signatures of executable sections and the apk itself. The MD5 hash of the apk signature is uploaded to the server along with the apk -name and application name, same with a few other things related to the application. - - - - - - diff --git a/libtersafe (anti cheat)/libtersafe.idb b/libtersafe (anti cheat)/libtersafe.idb deleted file mode 100644 index 09e149fa2..000000000 Binary files a/libtersafe (anti cheat)/libtersafe.idb and /dev/null differ diff --git a/libtersafe (anti cheat)/libtersafe.so b/libtersafe (anti cheat)/libtersafe.so deleted file mode 100644 index fadef9f2e..000000000 Binary files a/libtersafe (anti cheat)/libtersafe.so and /dev/null differ diff --git a/ligma/ligma.sln b/ligma/ligma.sln new file mode 100644 index 000000000..aacda305b --- /dev/null +++ b/ligma/ligma.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30320.27 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ligma", "ligma\ligma.vcxproj", "{15C1C992-4566-4D40-A856-B536B81299E4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|ARM.ActiveCfg = Debug|ARM + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|ARM.Build.0 = Debug|ARM + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|ARM64.Build.0 = Debug|ARM64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|x64.ActiveCfg = Debug|x64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|x64.Build.0 = Debug|x64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|x86.ActiveCfg = Debug|x86 + {15C1C992-4566-4D40-A856-B536B81299E4}.Debug|x86.Build.0 = Debug|x86 + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|ARM.ActiveCfg = Release|ARM + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|ARM.Build.0 = Release|ARM + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|ARM64.ActiveCfg = Release|ARM64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|ARM64.Build.0 = Release|ARM64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|x64.ActiveCfg = Release|x64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|x64.Build.0 = Release|x64 + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|x86.ActiveCfg = Release|x86 + {15C1C992-4566-4D40-A856-B536B81299E4}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2A928F40-AA7F-4E8F-8FF1-3A97C24A23C3} + EndGlobalSection +EndGlobal diff --git a/ligma/ligma/bypass.cpp b/ligma/ligma/bypass.cpp new file mode 100644 index 000000000..a4a9f1aea --- /dev/null +++ b/ligma/ligma/bypass.cpp @@ -0,0 +1,103 @@ +#include "bypass.h" + +namespace ligma +{ + namespace bypass + { + void init() + { + fopen_ptr = dlsym(dlopen("libc.so", RTLD_NOLOAD), "fopen"); + system_prop_get = dlsym(dlopen("libc.so", RTLD_NOLOAD), "__system_property_get"); + + const auto cubehawk_base = reinterpret_cast(dlopen("libcubehawk.so", RTLD_LAZY)); + const auto libtersafe_base = reinterpret_cast(dlopen("libtersafe.so", RTLD_LAZY)); + + shithook::make_hook(fopen_ptr, reinterpret_cast(&fopen_hook)); + shithook::make_hook(reinterpret_cast(cubehawk_base + offset_emulator_check), reinterpret_cast(&emulator_check)); + + LOGI("disabled emulator checks...."); + LOGI("disabled patch checks...."); + + shithook::make_hook(reinterpret_cast(libtersafe_base + offset_ischeat_packet), reinterpret_cast(&tss_sdk_ischeatpacket)); + shithook::make_hook(system_prop_get, reinterpret_cast(&system_property_hook)); + + LOGI("disabled is cheat packet checks....."); + LOGI("disabled hwid checks....."); + + shithook::make_hook(reinterpret_cast(cubehawk_base + offset_mshook_function), reinterpret_cast(&ms_hook_function)); + LOGI("disabling all MSHookFunction calls! (no more back buffer hook!)"); + } + + // + // the first module loaded by default is libtprt.so, it opens base.apk and checks its MD5. + // + __attribute__((noinline)) + FILE* fopen_hook(const char* path, const char* mode) + { + LOGI("fopen called! path = %s, mode = %s", path, mode); + if (strstr(path, "base.apk")) + { + path = "/data/app/com.activision.callofduty.shooter-1/base_orig.apk"; + LOGI("spoofing to original base.apk!"); + } + + fopen_mutex.lock(); + shithook::disable(fopen_ptr); + const auto result = fopen(path, mode); + shithook::enable(fopen_ptr); + fopen_mutex.unlock(); + + LOGI("fopen result = %p", result); + return result; + } + + // + // the original function returns 1 if no emulator is found else a number associated with an emulator. + // + __attribute__((noinline)) + signed int emulator_check(const char* a1, const char* a2) + { + LOGI("emulator check called.... spoofing emulator...."); + return 1; + } + + // + // never send is cheat packet.... + // + __attribute__((noinline)) + int tss_sdk_ischeatpacket(int a1) + { + return false; + } + + // + // spoof all hwids to "what do you call nuts on your chin? a dick down your throat you fucking retard!" + // + __attribute__((noinline)) + int system_property_hook(const char* name, char* value) + { + LOGI("trying to get HWID = %s", name); + system_prop_mutex.lock(); + shithook::disable(system_prop_get); + __system_property_get(name, value); + shithook::enable(system_prop_get); + system_prop_mutex.unlock(); + + // + // dont spoof persist.sys.timezone. + // + if (strcmp(name, "persist.sys.timezone") != 0) + { + LOGI("spoofing hwid = %s, to = %s", value, HWID_VALUE); + value = HWID_VALUE; + } + return strlen(value); + } + + void ms_hook_function(int* a1, int a2, int* a3) + { + LOGI("MSHookFunction called, hooking = %p, to = %p", a1, a2); + return; + } + } +} \ No newline at end of file diff --git a/ligma/ligma/bypass.h b/ligma/ligma/bypass.h new file mode 100644 index 000000000..e532418ef --- /dev/null +++ b/ligma/ligma/bypass.h @@ -0,0 +1,30 @@ +#pragma once +#include +#include +#include +#include +#include "shithook.h" + +#define HWID_VALUE "what do you call nuts on your chin? a dick down your throat you fucking retard!" +#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "ligma", __VA_ARGS__)) +#define offset_emulator_check 0x000D7B4 +#define offset_ischeat_packet 0x00128E0 +#define offset_mshook_function 0x0010358 + +namespace ligma +{ + namespace bypass + { + inline void* fopen_ptr = nullptr; + inline void* system_prop_get = nullptr; + inline std::mutex fopen_mutex; // every shithook you make you will need a mutex. + inline std::mutex system_prop_mutex; + + void init(); + signed int emulator_check(const char* a1, const char* a2); + FILE* fopen_hook(const char* path, const char* mode); + int tss_sdk_ischeatpacket(int a1); + int system_property_hook(const char* name, char* value); + void ms_hook_function(int* a1, int a2, int* a3); + } +} \ No newline at end of file diff --git a/ligma/ligma/ligma.cpp b/ligma/ligma/ligma.cpp new file mode 100644 index 000000000..81d177396 --- /dev/null +++ b/ligma/ligma/ligma.cpp @@ -0,0 +1,8 @@ +#include "bypass.h" + +__attribute__((constructor)) +void init() +{ + ligma::bypass::init(); + LOGI("bypassed anti cheat....."); +} \ No newline at end of file diff --git a/CODM/CODM/CODM.vcxproj b/ligma/ligma/ligma.vcxproj similarity index 54% rename from CODM/CODM/CODM.vcxproj rename to ligma/ligma/ligma.vcxproj index 85b0f4c99..d2af5f673 100644 --- a/CODM/CODM/CODM.vcxproj +++ b/ligma/ligma/ligma.vcxproj @@ -35,9 +35,9 @@ - {6ee844b7-1769-42f3-82fb-82a10d01272b} + {15c1c992-4566-4d40-a856-b536b81299e4} Android - CODM + ligma 14.0 Android 3.0 @@ -47,57 +47,57 @@ DynamicLibrary true Clang_5_0 - Disabled android-22 + ARM DynamicLibrary false Clang_5_0 - Disabled android-22 + ARM DynamicLibrary true Clang_5_0 android-22 - Disabled + ARM DynamicLibrary false Clang_5_0 android-22 - Disabled + ARM DynamicLibrary true Clang_5_0 - Disabled android-22 + ARM DynamicLibrary false Clang_5_0 - Disabled android-22 + ARM DynamicLibrary true Clang_5_0 - Disabled android-22 + ARM DynamicLibrary false Clang_5_0 - Disabled android-22 + ARM @@ -122,56 +122,131 @@ - Use + NotUsing pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use + NotUsing pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use + NotUsing pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use + NotUsing pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use + NotUsing pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use + NotUsing pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use - - + NotUsing + pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - Use - - + NotUsing + pch.h + c++1z + + adb logcat -c +adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +start cmd /k "title 'call of duty filter' & adb logcat | findstr com.activision.callofduty.shooter" +start cmd /k "title 'all logs' & adb logcat" +adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity + - + + + + + + diff --git a/ligma/ligma/ligma.vcxproj.filters b/ligma/ligma/ligma.vcxproj.filters new file mode 100644 index 000000000..b8a2a55c0 --- /dev/null +++ b/ligma/ligma/ligma.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {8fc1c384-bc0c-40ad-91fd-d12eb8f15083} + + + {a802d5b1-4373-45ec-9899-a56dcab8effb} + + + + + source + + + source + + + + + headers + + + headers + + + \ No newline at end of file diff --git a/CODM/CODM/CODM.vcxproj.user b/ligma/ligma/ligma.vcxproj.user similarity index 100% rename from CODM/CODM/CODM.vcxproj.user rename to ligma/ligma/ligma.vcxproj.user diff --git a/ligma/ligma/shithook.h b/ligma/ligma/shithook.h new file mode 100644 index 000000000..338a3db2a --- /dev/null +++ b/ligma/ligma/shithook.h @@ -0,0 +1,134 @@ +/* + MIT License + + Copyright (c) 2020 xerox + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +#pragma once +#include +#include +#include +#include +#include + +#define PAGE_START(ptr) reinterpret_cast(reinterpret_cast(ptr) >> 12 << 12) +#define ARM_JMP_CODE 0xE51FF004 + +namespace shithook +{ + class detour + { + public: + detour(void* addr_to_hook, void* jmp_to, bool enable = true) + : + hook_addr(addr_to_hook), + detour_addr(jmp_to), + hook_installed(false) + { + reinterpret_cast(jmp_code)[0] = ARM_JMP_CODE; // LDR PC, [PC, #-4] + reinterpret_cast(jmp_code)[1] = jmp_to; + memcpy(org_bytes, hook_addr, sizeof(org_bytes)); + if (enable) install(); + } + + void install() + { + if (hook_installed.load()) + return; + + if (!mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC)) + { + memcpy((void*)((long)hook_addr), jmp_code, sizeof(jmp_code)); + mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_EXEC); + cacheflush(reinterpret_cast(hook_addr), reinterpret_cast(hook_addr) + getpagesize(), NULL); + hook_installed.exchange(true); + } + } + + void uninstall() + { + if (!hook_installed.load()) + return; + + if (!mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC)) + { + memcpy(hook_addr, org_bytes, sizeof(jmp_code)); + mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_EXEC); + cacheflush(reinterpret_cast(hook_addr), reinterpret_cast(hook_addr) + getpagesize(), NULL); + hook_installed.exchange(false); + } + } + + ~detour() { uninstall(); } + bool installed() { return hook_installed; } + void* hook_address() { return hook_addr; } + void* detour_address() { return detour_addr; } + private: + std::atomic hook_installed; + void* hook_addr, * detour_addr; + + unsigned char jmp_code[8]{}; + std::uint8_t org_bytes[sizeof(jmp_code)]; + }; + + // this is jank, but needed because the OS isnt initalizing statics/inlined globals... :| + inline std::map>* get_hooks() + { + static std::map> hooks{}; + return &hooks; + } + + inline void make_hook(void* addr_to_hook, void* jmp_to_addr, bool enable = true) + { + if (!addr_to_hook) + return; + + get_hooks()->insert({ + addr_to_hook, + std::make_unique( + addr_to_hook, + jmp_to_addr, + enable + ) } + ); + } + + inline void enable(void* addr) + { + if (!addr) + return; + get_hooks()->at(addr)->install(); + } + + inline void disable(void* addr) + { + if (!addr) + return; + get_hooks()->at(addr)->uninstall(); + } + + inline void remove(void* addr) + { + if (!addr) + return; + get_hooks()->erase(addr); + } +} diff --git a/sdk/Assembly_CSharp/Assembly_CSharp.cpp b/ligma/sdk/Assembly_CSharp/Assembly_CSharp.cpp similarity index 100% rename from sdk/Assembly_CSharp/Assembly_CSharp.cpp rename to ligma/sdk/Assembly_CSharp/Assembly_CSharp.cpp diff --git a/sdk/Assembly_CSharp/Assembly_CSharp.hpp b/ligma/sdk/Assembly_CSharp/Assembly_CSharp.hpp similarity index 100% rename from sdk/Assembly_CSharp/Assembly_CSharp.hpp rename to ligma/sdk/Assembly_CSharp/Assembly_CSharp.hpp diff --git a/sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp b/ligma/sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp similarity index 100% rename from sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp rename to ligma/sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp diff --git a/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp b/ligma/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp similarity index 100% rename from sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp rename to ligma/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp diff --git a/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp b/ligma/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp similarity index 100% rename from sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp rename to ligma/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp diff --git a/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp b/ligma/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp similarity index 100% rename from sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp rename to ligma/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp diff --git a/sdk/CSProto/CSProto.cpp b/ligma/sdk/CSProto/CSProto.cpp similarity index 100% rename from sdk/CSProto/CSProto.cpp rename to ligma/sdk/CSProto/CSProto.cpp diff --git a/sdk/CSProto/CSProto.hpp b/ligma/sdk/CSProto/CSProto.hpp similarity index 100% rename from sdk/CSProto/CSProto.hpp rename to ligma/sdk/CSProto/CSProto.hpp diff --git a/sdk/CSProto/CSProto_forward.hpp b/ligma/sdk/CSProto/CSProto_forward.hpp similarity index 100% rename from sdk/CSProto/CSProto_forward.hpp rename to ligma/sdk/CSProto/CSProto_forward.hpp diff --git a/sdk/CSProtoSerializer/CSProtoSerializer.cpp b/ligma/sdk/CSProtoSerializer/CSProtoSerializer.cpp similarity index 100% rename from sdk/CSProtoSerializer/CSProtoSerializer.cpp rename to ligma/sdk/CSProtoSerializer/CSProtoSerializer.cpp diff --git a/sdk/CSProtoSerializer/CSProtoSerializer.hpp b/ligma/sdk/CSProtoSerializer/CSProtoSerializer.hpp similarity index 100% rename from sdk/CSProtoSerializer/CSProtoSerializer.hpp rename to ligma/sdk/CSProtoSerializer/CSProtoSerializer.hpp diff --git a/sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp b/ligma/sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp similarity index 100% rename from sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp rename to ligma/sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp diff --git a/sdk/DOTween/DOTween.cpp b/ligma/sdk/DOTween/DOTween.cpp similarity index 100% rename from sdk/DOTween/DOTween.cpp rename to ligma/sdk/DOTween/DOTween.cpp diff --git a/sdk/DOTween/DOTween.hpp b/ligma/sdk/DOTween/DOTween.hpp similarity index 100% rename from sdk/DOTween/DOTween.hpp rename to ligma/sdk/DOTween/DOTween.hpp diff --git a/sdk/DOTween/DOTween_forward.hpp b/ligma/sdk/DOTween/DOTween_forward.hpp similarity index 100% rename from sdk/DOTween/DOTween_forward.hpp rename to ligma/sdk/DOTween/DOTween_forward.hpp diff --git a/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp b/ligma/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp similarity index 100% rename from sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp rename to ligma/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp diff --git a/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp b/ligma/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp similarity index 100% rename from sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp rename to ligma/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp diff --git a/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp b/ligma/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp similarity index 100% rename from sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp rename to ligma/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp diff --git a/sdk/INIFileParser/INIFileParser.cpp b/ligma/sdk/INIFileParser/INIFileParser.cpp similarity index 100% rename from sdk/INIFileParser/INIFileParser.cpp rename to ligma/sdk/INIFileParser/INIFileParser.cpp diff --git a/sdk/INIFileParser/INIFileParser.hpp b/ligma/sdk/INIFileParser/INIFileParser.hpp similarity index 100% rename from sdk/INIFileParser/INIFileParser.hpp rename to ligma/sdk/INIFileParser/INIFileParser.hpp diff --git a/sdk/INIFileParser/INIFileParser_forward.hpp b/ligma/sdk/INIFileParser/INIFileParser_forward.hpp similarity index 100% rename from sdk/INIFileParser/INIFileParser_forward.hpp rename to ligma/sdk/INIFileParser/INIFileParser_forward.hpp diff --git a/sdk/Il2CppDummyDll/Il2CppDummyDll.cpp b/ligma/sdk/Il2CppDummyDll/Il2CppDummyDll.cpp similarity index 100% rename from sdk/Il2CppDummyDll/Il2CppDummyDll.cpp rename to ligma/sdk/Il2CppDummyDll/Il2CppDummyDll.cpp diff --git a/sdk/Il2CppDummyDll/Il2CppDummyDll.hpp b/ligma/sdk/Il2CppDummyDll/Il2CppDummyDll.hpp similarity index 100% rename from sdk/Il2CppDummyDll/Il2CppDummyDll.hpp rename to ligma/sdk/Il2CppDummyDll/Il2CppDummyDll.hpp diff --git a/sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp b/ligma/sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp similarity index 100% rename from sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp rename to ligma/sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp diff --git a/sdk/Mono_Security/Mono_Security.cpp b/ligma/sdk/Mono_Security/Mono_Security.cpp similarity index 100% rename from sdk/Mono_Security/Mono_Security.cpp rename to ligma/sdk/Mono_Security/Mono_Security.cpp diff --git a/sdk/Mono_Security/Mono_Security.hpp b/ligma/sdk/Mono_Security/Mono_Security.hpp similarity index 100% rename from sdk/Mono_Security/Mono_Security.hpp rename to ligma/sdk/Mono_Security/Mono_Security.hpp diff --git a/sdk/Mono_Security/Mono_Security_forward.hpp b/ligma/sdk/Mono_Security/Mono_Security_forward.hpp similarity index 100% rename from sdk/Mono_Security/Mono_Security_forward.hpp rename to ligma/sdk/Mono_Security/Mono_Security_forward.hpp diff --git a/sdk/Newtonsoft_Json/Newtonsoft_Json.cpp b/ligma/sdk/Newtonsoft_Json/Newtonsoft_Json.cpp similarity index 100% rename from sdk/Newtonsoft_Json/Newtonsoft_Json.cpp rename to ligma/sdk/Newtonsoft_Json/Newtonsoft_Json.cpp diff --git a/sdk/Newtonsoft_Json/Newtonsoft_Json.hpp b/ligma/sdk/Newtonsoft_Json/Newtonsoft_Json.hpp similarity index 100% rename from sdk/Newtonsoft_Json/Newtonsoft_Json.hpp rename to ligma/sdk/Newtonsoft_Json/Newtonsoft_Json.hpp diff --git a/sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp b/ligma/sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp similarity index 100% rename from sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp rename to ligma/sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp diff --git a/sdk/PlayMaker/PlayMaker.cpp b/ligma/sdk/PlayMaker/PlayMaker.cpp similarity index 100% rename from sdk/PlayMaker/PlayMaker.cpp rename to ligma/sdk/PlayMaker/PlayMaker.cpp diff --git a/sdk/PlayMaker/PlayMaker.hpp b/ligma/sdk/PlayMaker/PlayMaker.hpp similarity index 100% rename from sdk/PlayMaker/PlayMaker.hpp rename to ligma/sdk/PlayMaker/PlayMaker.hpp diff --git a/sdk/PlayMaker/PlayMaker_forward.hpp b/ligma/sdk/PlayMaker/PlayMaker_forward.hpp similarity index 100% rename from sdk/PlayMaker/PlayMaker_forward.hpp rename to ligma/sdk/PlayMaker/PlayMaker_forward.hpp diff --git a/sdk/System/System.cpp b/ligma/sdk/System/System.cpp similarity index 100% rename from sdk/System/System.cpp rename to ligma/sdk/System/System.cpp diff --git a/sdk/System/System.hpp b/ligma/sdk/System/System.hpp similarity index 100% rename from sdk/System/System.hpp rename to ligma/sdk/System/System.hpp diff --git a/sdk/System/System_forward.hpp b/ligma/sdk/System/System_forward.hpp similarity index 100% rename from sdk/System/System_forward.hpp rename to ligma/sdk/System/System_forward.hpp diff --git a/sdk/System_Core/System_Core.cpp b/ligma/sdk/System_Core/System_Core.cpp similarity index 100% rename from sdk/System_Core/System_Core.cpp rename to ligma/sdk/System_Core/System_Core.cpp diff --git a/sdk/System_Core/System_Core.hpp b/ligma/sdk/System_Core/System_Core.hpp similarity index 100% rename from sdk/System_Core/System_Core.hpp rename to ligma/sdk/System_Core/System_Core.hpp diff --git a/sdk/System_Core/System_Core_forward.hpp b/ligma/sdk/System_Core/System_Core_forward.hpp similarity index 100% rename from sdk/System_Core/System_Core_forward.hpp rename to ligma/sdk/System_Core/System_Core_forward.hpp diff --git a/sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp b/ligma/sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp similarity index 100% rename from sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp rename to ligma/sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp diff --git a/sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp b/ligma/sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp similarity index 100% rename from sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp rename to ligma/sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp diff --git a/sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp b/ligma/sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp similarity index 100% rename from sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp rename to ligma/sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp diff --git a/sdk/System_Xml/System_Xml.cpp b/ligma/sdk/System_Xml/System_Xml.cpp similarity index 100% rename from sdk/System_Xml/System_Xml.cpp rename to ligma/sdk/System_Xml/System_Xml.cpp diff --git a/sdk/System_Xml/System_Xml.hpp b/ligma/sdk/System_Xml/System_Xml.hpp similarity index 100% rename from sdk/System_Xml/System_Xml.hpp rename to ligma/sdk/System_Xml/System_Xml.hpp diff --git a/sdk/System_Xml/System_Xml_forward.hpp b/ligma/sdk/System_Xml/System_Xml_forward.hpp similarity index 100% rename from sdk/System_Xml/System_Xml_forward.hpp rename to ligma/sdk/System_Xml/System_Xml_forward.hpp diff --git a/sdk/System_Xml_Linq/System_Xml_Linq.cpp b/ligma/sdk/System_Xml_Linq/System_Xml_Linq.cpp similarity index 100% rename from sdk/System_Xml_Linq/System_Xml_Linq.cpp rename to ligma/sdk/System_Xml_Linq/System_Xml_Linq.cpp diff --git a/sdk/System_Xml_Linq/System_Xml_Linq.hpp b/ligma/sdk/System_Xml_Linq/System_Xml_Linq.hpp similarity index 100% rename from sdk/System_Xml_Linq/System_Xml_Linq.hpp rename to ligma/sdk/System_Xml_Linq/System_Xml_Linq.hpp diff --git a/sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp b/ligma/sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp similarity index 100% rename from sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp rename to ligma/sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp diff --git a/sdk/UnityEngine/UnityEngine.cpp b/ligma/sdk/UnityEngine/UnityEngine.cpp similarity index 100% rename from sdk/UnityEngine/UnityEngine.cpp rename to ligma/sdk/UnityEngine/UnityEngine.cpp diff --git a/sdk/UnityEngine/UnityEngine.hpp b/ligma/sdk/UnityEngine/UnityEngine.hpp similarity index 100% rename from sdk/UnityEngine/UnityEngine.hpp rename to ligma/sdk/UnityEngine/UnityEngine.hpp diff --git a/sdk/UnityEngine/UnityEngine_forward.hpp b/ligma/sdk/UnityEngine/UnityEngine_forward.hpp similarity index 100% rename from sdk/UnityEngine/UnityEngine_forward.hpp rename to ligma/sdk/UnityEngine/UnityEngine_forward.hpp diff --git a/sdk/UnityEngine_UI/UnityEngine_UI.cpp b/ligma/sdk/UnityEngine_UI/UnityEngine_UI.cpp similarity index 100% rename from sdk/UnityEngine_UI/UnityEngine_UI.cpp rename to ligma/sdk/UnityEngine_UI/UnityEngine_UI.cpp diff --git a/sdk/UnityEngine_UI/UnityEngine_UI.hpp b/ligma/sdk/UnityEngine_UI/UnityEngine_UI.hpp similarity index 100% rename from sdk/UnityEngine_UI/UnityEngine_UI.hpp rename to ligma/sdk/UnityEngine_UI/UnityEngine_UI.hpp diff --git a/sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp b/ligma/sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp similarity index 100% rename from sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp rename to ligma/sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp diff --git a/sdk/dll2sdk_forward.g.hpp b/ligma/sdk/dll2sdk_forward.g.hpp similarity index 100% rename from sdk/dll2sdk_forward.g.hpp rename to ligma/sdk/dll2sdk_forward.g.hpp diff --git a/sdk/il2cpp.hpp b/ligma/sdk/il2cpp.hpp similarity index 100% rename from sdk/il2cpp.hpp rename to ligma/sdk/il2cpp.hpp diff --git a/sdk/mscorlib/mscorlib.cpp b/ligma/sdk/mscorlib/mscorlib.cpp similarity index 100% rename from sdk/mscorlib/mscorlib.cpp rename to ligma/sdk/mscorlib/mscorlib.cpp diff --git a/sdk/mscorlib/mscorlib.hpp b/ligma/sdk/mscorlib/mscorlib.hpp similarity index 100% rename from sdk/mscorlib/mscorlib.hpp rename to ligma/sdk/mscorlib/mscorlib.hpp diff --git a/sdk/mscorlib/mscorlib_forward.hpp b/ligma/sdk/mscorlib/mscorlib_forward.hpp similarity index 100% rename from sdk/mscorlib/mscorlib_forward.hpp rename to ligma/sdk/mscorlib/mscorlib_forward.hpp diff --git a/sdk/protobuf_net/protobuf_net.cpp b/ligma/sdk/protobuf_net/protobuf_net.cpp similarity index 100% rename from sdk/protobuf_net/protobuf_net.cpp rename to ligma/sdk/protobuf_net/protobuf_net.cpp diff --git a/sdk/protobuf_net/protobuf_net.hpp b/ligma/sdk/protobuf_net/protobuf_net.hpp similarity index 100% rename from sdk/protobuf_net/protobuf_net.hpp rename to ligma/sdk/protobuf_net/protobuf_net.hpp diff --git a/sdk/protobuf_net/protobuf_net_forward.hpp b/ligma/sdk/protobuf_net/protobuf_net_forward.hpp similarity index 100% rename from sdk/protobuf_net/protobuf_net_forward.hpp rename to ligma/sdk/protobuf_net/protobuf_net_forward.hpp diff --git a/sdk/sharedRuntime/sharedRuntime.cpp b/ligma/sdk/sharedRuntime/sharedRuntime.cpp similarity index 100% rename from sdk/sharedRuntime/sharedRuntime.cpp rename to ligma/sdk/sharedRuntime/sharedRuntime.cpp diff --git a/sdk/sharedRuntime/sharedRuntime.hpp b/ligma/sdk/sharedRuntime/sharedRuntime.hpp similarity index 100% rename from sdk/sharedRuntime/sharedRuntime.hpp rename to ligma/sdk/sharedRuntime/sharedRuntime.hpp diff --git a/sdk/sharedRuntime/sharedRuntime_forward.hpp b/ligma/sdk/sharedRuntime/sharedRuntime_forward.hpp similarity index 100% rename from sdk/sharedRuntime/sharedRuntime_forward.hpp rename to ligma/sdk/sharedRuntime/sharedRuntime_forward.hpp diff --git a/sdk/usequencerRuntime/usequencerRuntime.cpp b/ligma/sdk/usequencerRuntime/usequencerRuntime.cpp similarity index 100% rename from sdk/usequencerRuntime/usequencerRuntime.cpp rename to ligma/sdk/usequencerRuntime/usequencerRuntime.cpp diff --git a/sdk/usequencerRuntime/usequencerRuntime.hpp b/ligma/sdk/usequencerRuntime/usequencerRuntime.hpp similarity index 100% rename from sdk/usequencerRuntime/usequencerRuntime.hpp rename to ligma/sdk/usequencerRuntime/usequencerRuntime.hpp diff --git a/sdk/usequencerRuntime/usequencerRuntime_forward.hpp b/ligma/sdk/usequencerRuntime/usequencerRuntime_forward.hpp similarity index 100% rename from sdk/usequencerRuntime/usequencerRuntime_forward.hpp rename to ligma/sdk/usequencerRuntime/usequencerRuntime_forward.hpp