From d120e7b489adc42a4489c63305413dfe52ed8bbf Mon Sep 17 00:00:00 2001 From: auth12 <67507608+auth12@users.noreply.github.com> Date: Thu, 6 Aug 2020 15:33:18 +0100 Subject: Improved CPU usage drastically. Switched to directx9. Reduced RAM usage by only remapping modules from a blacklist. --- client/src/util/util.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client/src/util/util.cpp') diff --git a/client/src/util/util.cpp b/client/src/util/util.cpp index fab886e..7103604 100644 --- a/client/src/util/util.cpp +++ b/client/src/util/util.cpp @@ -56,11 +56,13 @@ bool util::close_handle(HANDLE handle) { } -void pe::get_all_modules(std::unordered_map& modules) { +bool pe::get_all_modules(std::unordered_map& modules) { + modules.clear(); + auto peb = util::peb(); - if (!peb) return; + if (!peb) return false; - if (!peb->Ldr->InMemoryOrderModuleList.Flink) return; + if (!peb->Ldr->InMemoryOrderModuleList.Flink) return false; auto* list = &peb->Ldr->InMemoryOrderModuleList; @@ -74,4 +76,6 @@ void pe::get_all_modules(std::unordered_map& modules modules[name] = virtual_image(entry->DllBase); } + + return !modules.empty(); } \ No newline at end of file -- cgit v1.2.3