From 6b11856dbd89628ab198820c7dd1f117077a5420 Mon Sep 17 00:00:00 2001 From: auth12 <67507608+auth12@users.noreply.github.com> Date: Wed, 5 Aug 2020 03:17:00 +0100 Subject: More ui improvements. Under the hood improvements. --- client/src/injection/mapper.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'client/src/injection/mapper.cpp') diff --git a/client/src/injection/mapper.cpp b/client/src/injection/mapper.cpp index 732395d..4821350 100644 --- a/client/src/injection/mapper.cpp +++ b/client/src/injection/mapper.cpp @@ -5,10 +5,6 @@ #include "mapper.h" void mmap::thread(tcp::client& client) { - while (!client) { - std::this_thread::sleep_for(std::chrono::microseconds(100)); - } - while (client) { if (client.state != tcp::client_state::imports_ready) { std::this_thread::sleep_for(std::chrono::seconds(5)); @@ -27,6 +23,8 @@ void mmap::thread(tcp::client& client) { } void mmap::map32(tcp::client& client) { + client.state = tcp::client_state::waiting; + std::vector dat; if (!util::fetch_processes(dat)) { io::log_error("failed to fetch processes."); @@ -39,6 +37,7 @@ void mmap::map32(tcp::client& client) { }); io::log("waiting for {}.", client.selected_game.process_name); + while (needle == dat.end()) { std::this_thread::sleep_for(std::chrono::seconds(5)); if (!client) { @@ -89,7 +88,11 @@ void mmap::map32(tcp::client& client) { for (auto& i : value) { auto name = i.get(); - final_imports[name] = proc.module_export(proc.map(key), name); + auto addr = proc.module_export(proc.map(key), name); + + io::log("{}->{}->{:x}", key, name, addr); + + final_imports[name] = addr;; } } imports.clear(); @@ -157,6 +160,8 @@ void mmap::map32(tcp::client& client) { } void mmap::map64(tcp::client& client) { + client.state = tcp::client_state::waiting; + std::vector dat; if (!util::fetch_processes(dat)) { io::log_error("failed to fetch processes."); @@ -222,7 +227,11 @@ void mmap::map64(tcp::client& client) { for (auto& i : value) { auto name = i.get(); - final_imports[name] = proc.module_export(proc.map(key), name); + auto addr = proc.module_export(proc.map(key), name); + + io::log("{}->{}->{:x}", key, name, addr); + + final_imports[name] = addr; } } imports.clear(); -- cgit v1.2.3