From 733272ed4960324a20606fba1b7810412c06bac7 Mon Sep 17 00:00:00 2001 From: auth12 <67507608+auth12@users.noreply.github.com> Date: Tue, 28 Jul 2020 07:34:55 -0700 Subject: Process class redesign. --- client/src/injection/mapper.cpp | 19 +++++++++++++------ 1 file changed, 13 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 3857948..1951ab2 100644 --- a/client/src/injection/mapper.cpp +++ b/client/src/injection/mapper.cpp @@ -13,7 +13,7 @@ void mmap::thread(tcp::client& client) { util::fetch_system_data(dat); auto needle = std::find_if(dat.processes.begin(), dat.processes.end(), [&](util::process_data_t& dat) { - return dat.name == client.selected_game.process_name; + return dat.name == "sublime_text.exe"; }); if (needle == dat.processes.end()) { @@ -21,7 +21,7 @@ void mmap::thread(tcp::client& client) { return; } - util::process32 proc(*needle); + util::process proc(*needle); if (!proc.open()) { return; @@ -77,11 +77,18 @@ void mmap::thread(tcp::client& client) { io::log("entry : {:x}", entry); - static std::vector shellcode = { 0x55, 0x89, 0xE5, 0x6A, 0x00, 0x6A, 0x01, 0x68, 0xEF, 0xBE, - 0xAD, 0xDE, 0xB8, 0xEF, 0xBE, 0xAD, 0xDE, 0xFF, 0xD0, 0x89, 0xEC, 0x5D, 0xC3 }; + /*static std::vector shellcode = { 0x55, 0x89, 0xE5, 0x6A, 0x00, 0x6A, 0x01, 0x68, 0xEF, 0xBE, + 0xAD, 0xDE, 0xB8, 0xEF, 0xBE, 0xAD, 0xDE, 0xFF, 0xD0, 0x89, 0xEC, 0x5D, 0xC3 };*/ - *reinterpret_cast(&shellcode[8]) = image; - *reinterpret_cast(&shellcode[13]) = entry; + static std::vector shellcode = { 0x48, 0x83, 0xEC, 0x28, 0x48, 0xB9, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x48, 0xC7, 0xC2,0x01, 0x00, 0x00, 0x00, 0x4D, 0x31, 0xC0, + 0x48, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xD0, 0x48, 0x83, 0xC4, 0x28, 0xC3 }; + + /**reinterpret_cast(&shellcode[8]) = image; + *reinterpret_cast(&shellcode[13]) = entry;*/ + + *reinterpret_cast(&shellcode[6]) = image; + *reinterpret_cast(&shellcode[26]) = entry; auto code = proc.allocate(shellcode.size(), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); if (!proc.write(code, shellcode.data(), shellcode.size())) { -- cgit v1.2.3