aboutsummaryrefslogtreecommitdiff
path: root/client/src/injection/mapper.cpp
diff options
context:
space:
mode:
authorauth12 <[email protected]>2020-08-05 03:17:00 +0100
committerauth12 <[email protected]>2020-08-05 03:17:00 +0100
commit6b11856dbd89628ab198820c7dd1f117077a5420 (patch)
treed34ddff8f3658956b5c435a33c2829208ab2fc4f /client/src/injection/mapper.cpp
parentAdded ui. (diff)
downloadloader-6b11856dbd89628ab198820c7dd1f117077a5420.tar.xz
loader-6b11856dbd89628ab198820c7dd1f117077a5420.zip
More ui improvements.
Under the hood improvements.
Diffstat (limited to 'client/src/injection/mapper.cpp')
-rw-r--r--client/src/injection/mapper.cpp21
1 files changed, 15 insertions, 6 deletions
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<util::process_data_t> 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<std::string>();
- 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<util::process_data_t> 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<std::string>();
- 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();