diff --git a/src/common/utils/hook.cpp b/src/common/utils/hook.cpp index 38134d74..1751af65 100644 --- a/src/common/utils/hook.cpp +++ b/src/common/utils/hook.cpp @@ -144,28 +144,6 @@ namespace utils::hook }); } - concurrency::container>& get_original_data_map() - { - static concurrency::container> og_data{}; - return og_data; - } - - void store_original_data(const void* /*data*/, size_t /*length*/) - { - /*get_original_data_map().access([data, length](std::map& og_map) - { - const auto data_ptr = static_cast(data); - for (size_t i = 0; i < length; ++i) - { - const auto pos = data_ptr + i; - if (!og_map.contains(pos)) - { - og_map[pos] = *pos; - } - } - });*/ - } - void* initialize_min_hook() { static class min_hook_init @@ -299,7 +277,6 @@ namespace utils::hook { this->clear(); this->place_ = place; - store_original_data(place, 14); if (MH_CreateHook(this->place_, target, &this->original_) != MH_OK) { @@ -357,8 +334,6 @@ namespace utils::hook auto* const ptr = library.get_iat_entry(target_library, process); if (!ptr) return {}; - store_original_data(ptr, sizeof(*ptr)); - DWORD protect; VirtualProtect(ptr, sizeof(*ptr), PAGE_EXECUTE_READWRITE, &protect); @@ -370,8 +345,6 @@ namespace utils::hook void nop(void* place, const size_t length) { - store_original_data(place, length); - DWORD old_protect{}; VirtualProtect(place, length, PAGE_EXECUTE_READWRITE, &old_protect); @@ -388,8 +361,6 @@ namespace utils::hook void copy(void* place, const void* data, const size_t length) { - store_original_data(place, length); - DWORD old_protect{}; VirtualProtect(place, length, PAGE_EXECUTE_READWRITE, &old_protect); @@ -594,26 +565,4 @@ namespace utils::hook return extract(data + 1); } - - std::vector query_original_data(const void* data, const size_t length) - { - std::vector og_data{}; - og_data.resize(length); - memcpy(og_data.data(), data, length); - - get_original_data_map().access([data, length, &og_data](const std::map& og_map) - { - auto* ptr = static_cast(data); - for (size_t i = 0; i < length; ++i) - { - auto entry = og_map.find(ptr + i); - if (entry != og_map.end()) - { - og_data[i] = entry->second; - } - } - }); - - return og_data; - } } diff --git a/src/common/utils/hook.hpp b/src/common/utils/hook.hpp index ade2fca2..62df41c3 100644 --- a/src/common/utils/hook.hpp +++ b/src/common/utils/hook.hpp @@ -211,6 +211,4 @@ namespace utils::hook { return static_cast(func)(args...); } - - std::vector query_original_data(const void* data, size_t length); }